Back to notes
How-to guideBilibiliCDNBrowser Extension

一個神祕設定解決 Bilibili 影片卡頓

海外看 B 站卡頓,換 DNS、開 VPN 都是碰運氣,真正的原因是 B 站分給你慢的 CDN 節點。裝一個擴充把影片固定在最快的節點,順便附上 Android 與電視的做法。

Updated 2 min30 viewsArticle language

你各位B站看影片也卡成狗嗎?

懶人解法:瀏覽器裝擴充

懶得看原理,省流: 瀏覽器裝這個 (如果有竄改猴/油猴的同功能腳本記得先移除)

裝前裝後對比

Before

擴充關閉時:影片走 B 站分配的 Akamai 節點(cdn=…akamaized.net),下載速度 66 kB/s

After

擴充開啟後:同一支影片改走 08ct 節點,1080P+ 下載速度 3.3 MB/s

如果你還想繼續看

為什麼換 DNS、開 VPN 不一定有用

台灣看 bilibili 影片卡頓,搜尋網路常出現 VPN 啦,改 DNS 8.8.8.8 之類的,這些都不一定管用

因為真正的原因是B站給你分配了「慢速的 CDN 節點」。上面這些方法本質都是「提高拿到好節點的機率」,不能根治。所以跟哈密瓜一樣,有些人有用有些人沒用

如果想了解 CDN 是甚麼,可以看我這篇技術部落格文章:如何真正徹底解決 Bilibili 卡頓

真正的解法:固定最快的節點

真要徹底解決,你必須知道所在地區最好的節點,然後固定它

為此我做了這個插件,如果大家一般用電腦瀏覽器看,裝上面的擴充,強制影片走最快的節點

手機和電視怎麼辦

如果用Android看,不要用官方 APP,改用PiliNara這個三方 apk (好用很多沒廣告)
https://github.com/Starfallan/PiliNara/releases

如果用機上盒或智能電視,別用那什麼雲xx小電視(真的拉完了),用 blbl APP
https://github.com/roge4444/blblRogerMod/releases

原理都是一樣的,這些 APP 內建測速並固定 CDN 的功能


寫在最後

以上是我採雷三年多來的真心分享,非葉配

瀏覽器擴充是我自己做來給自己用的,永久免費。希望幫到有需求的人,有想要的功能或 bug 回報也可以留言或私訊

如果你裝上後覺得不錯,不妨順手留個五星鼓勵。或者到以下 Github 專案點個星星
https://github.com/a0972199950/bilibili-cdn-switcher?utm_source=lazy_cv&utm_medium=referral&utm_campaign=secret_setting_article&utm_content=zhtw

Comments(0)

No comments yet. Be the first to share your thoughts!

Related notes

The same 4K video before and after the extension: buffering at 9 KB/s before, 8.8 MB/s after
Tech share11 min

How to Actually Fix Bilibili Buffering for Good

Why popular Bilibili videos play fine overseas while unpopular ones stall: CDN caching and trips back to origin, why the narrowest link sets your speed, why DNS and VPN tricks are hit or miss, and how my extension picks a default node from real tests across 14 Taiwanese ISPs.

繁體中文 / English

CDNSpeedTest while the speed test is running
How-to guide6 min

How to Join the Bilibili CDN Speed Test

Step-by-step guide: download CDNSpeedTest.exe, pass the network check, log in with a QR code, and send the report so the extension can find the fastest Bilibili servers in your country.

繁體中文 / 简体中文 / English / 日本語 / 한국어

Notice on top of the Bilibili player saying the CDN was slow and playback switched to a backup node
Tech share14 min

Detecting CDN Failures in a Bilibili Extension and Falling Back to Backup Nodes

How the extension decides a CDN node is really broken: which errors to ignore, how to detect stalls from currentTime and the forward buffer, why it switches once quietly before asking you, and how it avoids bouncing between nodes. Also covers live streams.

繁體中文 / English

Cover: the Network panel domain changes from upos-hz-mirrorakam.akamaized.net to upos-sz-mirror08ct.bilivideo.com, above the four hook points: __playinfo__, the playurl API, .m4s segments and live streams
Tech share13 min

Rewriting Bilibili's Stream CDN on the Fly from a Chrome Extension's MAIN World

Bilibili's stream URLs arrive through SSR __playinfo__, the playurl API, segment requests and the live API. Using bilibili-cdn-switcher's code, this walks through hooking each path, what gets rewritten, and the traps: one-shot Response bodies, read-only XHR responseText, and speed tests that must bypass your own hooks.

繁體中文 / English

Cover: more testers, better defaults. A loop of four steps: test at home, get custom nodes, report back, update the default list (cdn-list.json), then back to users in the next release
Tech share23 min

How Crowdsourced Speed Tests Keep Improving Bilibili CDN Server Picks

How a Windows speed test app benchmarks 299 Bilibili nodes in people's homes, picks the 10 most stable with layered videos and a three-stage funnel, writes them into the extension on the spot, and sends reports back so each country's default nodes improve by market-share-weighted coverage and missing ISPs get recruited.

繁體中文 / English

Cover: one src/ folder goes through build.mjs into Chrome, Edge and Firefox zips (Chrome and Edge share one sha256), while Safari goes through an Xcode project to the App Store
Tech share19 min

Shipping a Bilibili Extension from One Codebase to Chrome, Edge, Firefox and Safari

How one src/ becomes four store builds, why the zips must be reproducible (with real sha256 runs and a line-ending gotcha), 5-language release notes guarded by a pre-push hook, and which release steps are scripted versus always done by hand.

繁體中文 / English

Cover: one page, two JS worlds. typeof chrome.storage is undefined in the MAIN world console and object in the ISOLATED world; both share the DOM and localStorage and talk via postMessage
Tech share14 min

Chrome Extensions: The Basics of MAIN World and ISOLATED World

Patched window.fetch in a content script and the page ignored you? What the MAIN and ISOLATED worlds can each see, the three ways to pick a world, when to split into two scripts, how they talk through localStorage and postMessage, and which forged messages to reject.

繁體中文 / English