B站地址bv号自动跳转回av号

目前為 2020-03-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name B站地址bv号自动跳转回av号
// @description 略
// @language zh-CN
// @version 20200327
// @require https://gf.qytechs.cn/scripts/398808-bv%E5%8F%B7-av%E5%8F%B7/code/BV%E5%8F%B7%E2%87%86AV%E5%8F%B7.js?version=785053
// @match *://*.bilibili.com/*
// @author       mudan_cn
// @run_at document-start
// @grant        unsafeWindow
// @namespace https://gf.qytechs.cn/users/70322
// ==/UserScript==

switch([/www\.bilibili\.com\/video\/BV/,
        /search\.bilibili\.com\//].findIndex(e => e.test(location.href))){
    case 0:
        location.pathname = `/video/${bv2av(location.pathname.replace('/video/', ''))}`;
        break;
    case 1:
        unsafeWindow.onload = function() {
            document.querySelectorAll('a[href*="/BV"]').forEach(e => {
                var url = new URL(e.href);
                url.pathname = `/video/${bv2av(url.pathname.replace('/video/', ''))}`;
                e.href = url.href;
            });
        };
        break;
    case -1:
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址