Back to notes
How-to guideBilibiliCDNBrowser Extension

The Secret Setting That Fixes Bilibili Buffering

Bilibili buffering overseas? DNS and VPN tricks are a coin toss, because the real problem is the slow CDN node Bilibili assigns you. Install one extension to lock videos onto the fastest node, plus what to use on Android and TV.

Updated 2 min29 viewsArticle language

Is Bilibili buffering like crazy for you too?

TL;DR: install the browser extension

TL;DR: install this in your browser (if you've got a Tampermonkey/Violentmonkey script that does the same thing, remove it first)

Before and after

Before

Extension off: the video comes from the Akamai node Bilibili assigned (cdn=…akamaized.net) at 66 kB/s

After

Extension on: the same video now comes from the 08ct node, 1080P+ at 3.3 MB/s

If you still want the details

Why DNS and VPN tricks are hit or miss

When Bilibili buffers outside China, the usual advice online is "use a VPN", "switch your DNS to 8.8.8.8" and so on. None of that is guaranteed to work.

The real reason is that Bilibili hands you a slow CDN node. All those tricks basically just raise your odds of landing a good node, they don't actually fix anything. That's why it's hit or miss: works for some people, does nothing for others.

If you want to know what a CDN actually is, I wrote a technical blog post about it: How to Actually Fix Bilibili Buffering for Good

The real fix: lock onto the fastest node

To really fix it, you need to know which node is the best one where you live, and then lock it in.

So I built this extension. If you mostly watch in a desktop browser, install the extension above and it forces videos onto the fastest node.

What about Android and TV?

On Android, skip the official app and use PiliNara, a third-party APK (way better, no ads)
https://github.com/Starfallan/PiliNara/releases

On a TV box or smart TV, skip the official TV app (it's straight-up trash) and use blbl
https://github.com/roge4444/blblRogerMod/releases

Same idea for all of them: these apps have a built-in speed test and let you lock the CDN node.


A few last words

This comes from 3+ years of stepping on every landmine myself. Not sponsored.

I built the extension for my own use, and it's free forever. Hope it helps whoever needs it. Feature requests or bug reports: leave a comment or DM me.

If it works for you, a 5-star review would mean a lot. Or drop a star on the GitHub repo:
https://github.com/a0972199950/bilibili-cdn-switcher?utm_source=lazy_cv&utm_medium=referral&utm_campaign=secret_setting_article&utm_content=en

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