BV <-> AV







🚀 由于新 BV 号已经不适合上面的算法,提供了新的方法,需要安装 【篡改猴/暴力猴/油猴】 插件,添加下面脚本
查看代码
            
// ==UserScript==
// @name         bilibili bv2av
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://*.bilibili.com/**
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const bvs = new URLSearchParams(location.search).get('bvs')?.split(',').filter(Boolean) || [];
    if (bvs.length) {
        const avs = [];
        const div = document.createElement('div');
        Object.assign(div.style, {
            zIndex: 9999,
            position: 'fixed',
            top: 0,
            right: 0,
            fontSize: '40px',
            backgroundColor: 'white',
            padding: '20px',
            left: 0,
            textAlign: 'center'
        })
        document.body.append(div);
        const update = (str) => {
            div.innerText = str;
        };
        let i = 0;
        update(`bv2av -> ${i}/${bvs.length}`)
        bvs.reduce(async (p, bv) => {
            await p;
            const res = await fetch('/video/' + bv).then(res => res.text());
            const [, aid] = res.match(/"aid":(\d+)/) || []
            if (aid) { avs.push(`${bv}\t${aid}`) }
            await new Promise(r => setTimeout(r, 200));
            i ++;
            update(`bv2av -> ${i}/${bvs.length}`)
        }, 1).then(() => {
            update(avs.join('\n'))
        })
    }
})();

            
        

🚀 单个复制方法:

把右边拖动到标签栏,之后在视频页点击即可复制 AV 号👉 复制AV
截图


相关视频,可以的话求个赞!👍

本页面由 柯灰 提供,前往 b 站关注我

    更新记录:
    📅 2023-02-15:修复 bv 转 av 后负数问题, av 转 bv 可能还有问题。
    📅 2023-02-11:支持批量转换,一行一个号,增加快捷复制功能。
    📅 2024-01-30:支持添加快捷键到书签栏以快捷复制 AV 号。
    

算法来源:
作者:mcfx
链接:https://www.zhihu.com/question/381784377/answer/1099438784