BiliBoost
A Tampermonkey userscript that keeps Bilibili playable overseas. It probes CDN nodes and fetches in parallel until 4K streams smoothly.
- TYPE
- Personal Tool
- YEAR
- 2026
- ROLE
- Solo
- STACK
- JavaScript · Tampermonkey · Streams API
What it's for
Watching Bilibili from overseas hits the same wall every time: bandwidth is fine, but the video won’t load. A gigabit connection can’t push 1080p smoothly. It plays for a few seconds, rebuffers, or the progress bar just sits there. Popular videos work because they’re already in the edge cache. Unpopular ones miss it, both the primary and backup CDN nodes time out, and you’re stuck.
GitHub has plenty of CDN-switching scripts that try to fix this. But a single cross-border connection has a hard ceiling on throughput, so for high-bitrate video, swapping nodes barely moves the needle.
BiliBoost raises that ceiling. It aggregates buffering across multiple connections and picks better CDN nodes so the aggregation has good material to work with.
What it is
A single JavaScript file, run through Tampermonkey, that does both jobs inside the browser.
Node selection
Candidate nodes are probed with two-point sampling: the file head plus a deep offset into the file. A node that only cached the first few megabytes looks fast on a head-only probe, then stalls mid-video. Sampling a distant range catches those false positives before the player commits to a node.
Beating the per-connection throttle
The throttle is per connection, so the script splits large media requests into byte ranges, fetches from up to four nodes simultaneously, and stitches the pieces back into one stream with proper backpressure. In my measurements, a link that managed about 2 Mbps on a single stream aggregates to 22–103 Mbps.
Latency gets the same treatment. If a node hasn’t answered within about 900 ms, a second request goes to a backup node and the two race. First response wins.
Cache misses
When a node 404s or stalls, playback falls back down the candidate chain while better nodes are warmed in the background for the next segment. Under fairly extreme conditions, cold content that used to take 37 seconds to start now starts in about 250 ms. 4K plays fine.
Caveat
Tested on a network in California, US West Coast. The CDN selection strategy may work best there; other regions haven’t been tested.
How to use it
- 01
Install Tampermonkey
Add the Tampermonkey extension to your browser.
- 02
Add the script
Import bilibili-cdn-optimizer.user.js from the repo into Tampermonkey. It needs no extra configuration.
- 03
Open a video
The script runs by itself whenever a video plays.
- 04
Optional, open the panel
The floating panel shows live throughput and node health, runs a speed test, lets you pick a node by hand, and exports a diagnostic report. Settings persist in localStorage.