
| 🐟✋ |

|
社区昵称:lzstzr 资料
加好友
聊天
库存
截图
好友
群组
愿望单
评测
信誉+0/-0
本帖最后由 lzstzr 于 2020-3-23 23:11 编辑
算法已经被逆向了 https://www.zhihu.com/question/381784377/answer/1099438784
根据算法写了个小网页, 临时转换一下用
- // ==UserScript==
- // @name BilibiliAV
- // @namespace https://github.com/lzghzr/TampermonkeyJS
- // @version 0.0.1
- // @author lzghzr
- // @match https://www.bilibili.com/video/BV*
- // @description 将BV替换为AV
- // @license MIT
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- 'use strict';
- const table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF';
- const tr = {};
- for (let i = 0; i < 58; i++)
- tr[table[i]] = BigInt(i);
- const s = [9, 8, 1, 6, 2, 4, 0, 7, 3, 5];
- const xor = 177451812n;
- const add = 100618342136696320n;
- function dec(x) {
- let r = 0n;
- for (let i = 0; i < 10; i++)
- r += tr[x[s[i]]] * 58n ** BigInt(i);
- return (r - add) ^ xor;
- }
- function enc(x) {
- let y = BigInt(x);
- y = (y ^ xor) + add;
- let r = Array(10);
- for (let i = 0; i < 10; i++)
- r[s[i]] = table[Number(BigInt(y / 58n ** BigInt(i) % 58n))];
- return r.join('');
- }
- const BV = window.location.pathname.split('BV')[1];
- const AV = dec(BV);
- history.replaceState(null, '', `https://www.bilibili.com/video/av${AV}${window.location.search}`);
复制代码
再瞎写个脚本好了 |
-
-
AVBV.7z
817 Bytes, 下载次数: 0, 下载积分: 体力 -1 点
|