b站现在用了很多奇怪的cdn镜像,将这些镜像切换成原生cdn即可
注:云帆cdn抓不到
https://github.com/kuainx/bili-cdn
if (/^https:\/\/[a-z.-\d]*bilivideo.com/i.test(url)) {
let node = url.match(/(?<=^https:\/\/)[a-z.-\d]*(?=.bilivideo.com)/i)[0];
if (url.indexOf("cn-sh-fx-bcache") == -1) {
let nNode = "cn-sh-fx-bcache-" + String(Math.floor(Math.random() * 9 + 1)).padStart(2, "0");
nurl = url.replace(/^https:\/\/[a-z.-\d]*bilivideo.com/i, "https://" + nNode + ".bilivideo.com");
console.log(`%c replace ${node} to ${nNode}`, "background-color:yellow");
} else {
console.log(`%c go ${node}`, "background-color:#00ff00");
}
}