Chrome extension for stable Bilibili CDN routing and adaptive DASH segment pre-caching
JavaScript
22
8 commits
updated Aug 4, 2026
English | Simplified Chinese
Bili Pilot is an experimental Chrome and Firefox extension that helps stabilize high-bitrate Bilibili playback. It compares the signed CDN routes Bilibili already provides, supports manual route selection, and can pre-cache upcoming DASH segments from the best available route for each segment.
Bili Pilot is an independent community project. It is not affiliated with or endorsed by Bilibili.
This launch image uses a Retina capture from a real 4K HDR playback test. It shows Bili Pilot comparing Bilibili-provided CDN routes and caching future DASH segments beyond the player's existing buffer.
Bili Pilot works on desktop Chrome 111+ and Firefox 140+ for macOS, Windows, and Linux. Safari, mobile browsers, and browser extension stores are not supported yet.
Bili-Pilot-Chrome-x.y.z.zip from the repository's Releases page.chrome://extensions.bili-pilot folder containing manifest.json.Chrome may show a developer-mode warning after restart because this is not a Chrome Web Store installation. The extension must be reloaded from chrome://extensions after updating its files.
Use GitHub's Code → Download ZIP action or clone the repository, then load the repository folder containing manifest.json with the same steps above.
There is no build step and no runtime dependency. npm install is not required to use the extension.
Bili-Pilot-Firefox-x.y.z.xpi from the repository's Releases page.The Firefox artifact is signed by Mozilla. The Chrome ZIP is not a Firefox installer.
Developers can also test the same source build as a temporary extension:
about:debugging#/runtime/this-firefox in Firefox 140 or newer.manifest.json.Firefox removes temporary extensions when the browser exits. A normal persistent Firefox installation requires an XPI signed by Mozilla.
https://www.bilibili.com/video/... page and start playback.Planned, Downloading, Retrying, Ready, or Re-probing.Ready means the complete byte range is in memory and can be delivered to the player. A partial download is never marked ready and is never served as a cache hit.
A general speed test does not measure the path to the CDN serving a particular Bilibili media file. Bilibili may provide multiple signed URLs for one DASH track, and route quality can vary with time and byte position.
Bili Pilot therefore operates on the real active track:
sidx, probe future real segments at low priority, and download each complete segment from its best successful route.flowchart LR
A["Active Bilibili DASH track"] --> B["Signed CDN candidates"]
B --> C["Manual route selection"]
B --> D["Low-priority future-segment probes"]
D --> E["Best route for each segment"]
E --> F["Bounded complete-segment cache"]
F -->|"Complete Range"| G["Exact HTTP 206"]
F -->|"Partial or uncertain"| H["Original player request"]
For the full reasoning and observed failure model, read Problem and solution. For code boundaries and state ownership, read Architecture.
Bili Pilot requests only:
storage, for the pre-cache preference and non-sensitive local UI state;Signed URLs are used only for local Range requests. Bili Pilot does not collect or upload browsing history, cookies, page text, account information, signed media URLs, or playback analytics. It has no background service worker or remote configuration service.
Confirm that the extension is enabled, reload it on chrome://extensions, then reload the Bilibili tab.
Start playback and wait for a media request. Bili Pilot waits for evidence of the active track instead of guessing from inactive playurl representations.
The page may not have exposed a supported DASH playurl yet. Try a regular video page and start playback.
All signed routes may be slow or unavailable on the current network. Bili Pilot cannot invent another authorized CDN.
Check that pre-cache is enabled, at least 15 seconds are buffered, and the active track exposes a readable SegmentBase.indexRange and sidx. Playback may be paused; pre-cache is driven by safe buffered headroom rather than the play/pause state.
A large Range can transfer most bytes quickly and then stop near its tail. The player can hit its deadline even if that URL eventually returns HTTP 206. A successful small probe is useful evidence, not a guarantee that a later full segment will finish on time.
sidx; manual route selection can still work without one.The extension source is plain JavaScript and has no production dependencies. Node.js 18 or newer is needed only for tests.
npm test
npm run check
The suite covers active-track selection, signed routing, PCDN/MCDN classification, Range and sidx parsing, probe failure control, player-first scheduling, multi-CDN retry, cache assembly, protocol parity, stable UI rendering, locales, and the Manifest surface.
When editing extension files, reload the extension on chrome://extensions and then reload the Bilibili tab so both execution worlds receive the new code.
Issues and focused pull requests are welcome. Please include:
npm test and npm run check results for code changes.Do not post complete signed media URLs, cookies, account identifiers, or private browsing data.
MIT © Bili Pilot contributors
JavaScript
97.1%
HTML
2.2%
Chrome extension for stable Bilibili CDN routing and adaptive DASH segment pre-caching
JavaScript
22
8 commits
updated Aug 4, 2026
English | Simplified Chinese
Bili Pilot is an experimental Chrome and Firefox extension that helps stabilize high-bitrate Bilibili playback. It compares the signed CDN routes Bilibili already provides, supports manual route selection, and can pre-cache upcoming DASH segments from the best available route for each segment.
Bili Pilot is an independent community project. It is not affiliated with or endorsed by Bilibili.
This launch image uses a Retina capture from a real 4K HDR playback test. It shows Bili Pilot comparing Bilibili-provided CDN routes and caching future DASH segments beyond the player's existing buffer.
Bili Pilot works on desktop Chrome 111+ and Firefox 140+ for macOS, Windows, and Linux. Safari, mobile browsers, and browser extension stores are not supported yet.
Bili-Pilot-Chrome-x.y.z.zip from the repository's Releases page.chrome://extensions.bili-pilot folder containing manifest.json.Chrome may show a developer-mode warning after restart because this is not a Chrome Web Store installation. The extension must be reloaded from chrome://extensions after updating its files.
Use GitHub's Code → Download ZIP action or clone the repository, then load the repository folder containing manifest.json with the same steps above.
There is no build step and no runtime dependency. npm install is not required to use the extension.
Bili-Pilot-Firefox-x.y.z.xpi from the repository's Releases page.The Firefox artifact is signed by Mozilla. The Chrome ZIP is not a Firefox installer.
Developers can also test the same source build as a temporary extension:
about:debugging#/runtime/this-firefox in Firefox 140 or newer.manifest.json.Firefox removes temporary extensions when the browser exits. A normal persistent Firefox installation requires an XPI signed by Mozilla.
https://www.bilibili.com/video/... page and start playback.Planned, Downloading, Retrying, Ready, or Re-probing.Ready means the complete byte range is in memory and can be delivered to the player. A partial download is never marked ready and is never served as a cache hit.
A general speed test does not measure the path to the CDN serving a particular Bilibili media file. Bilibili may provide multiple signed URLs for one DASH track, and route quality can vary with time and byte position.
Bili Pilot therefore operates on the real active track:
sidx, probe future real segments at low priority, and download each complete segment from its best successful route.flowchart LR
A["Active Bilibili DASH track"] --> B["Signed CDN candidates"]
B --> C["Manual route selection"]
B --> D["Low-priority future-segment probes"]
D --> E["Best route for each segment"]
E --> F["Bounded complete-segment cache"]
F -->|"Complete Range"| G["Exact HTTP 206"]
F -->|"Partial or uncertain"| H["Original player request"]
For the full reasoning and observed failure model, read Problem and solution. For code boundaries and state ownership, read Architecture.
Bili Pilot requests only:
storage, for the pre-cache preference and non-sensitive local UI state;Signed URLs are used only for local Range requests. Bili Pilot does not collect or upload browsing history, cookies, page text, account information, signed media URLs, or playback analytics. It has no background service worker or remote configuration service.
Confirm that the extension is enabled, reload it on chrome://extensions, then reload the Bilibili tab.
Start playback and wait for a media request. Bili Pilot waits for evidence of the active track instead of guessing from inactive playurl representations.
The page may not have exposed a supported DASH playurl yet. Try a regular video page and start playback.
All signed routes may be slow or unavailable on the current network. Bili Pilot cannot invent another authorized CDN.
Check that pre-cache is enabled, at least 15 seconds are buffered, and the active track exposes a readable SegmentBase.indexRange and sidx. Playback may be paused; pre-cache is driven by safe buffered headroom rather than the play/pause state.
A large Range can transfer most bytes quickly and then stop near its tail. The player can hit its deadline even if that URL eventually returns HTTP 206. A successful small probe is useful evidence, not a guarantee that a later full segment will finish on time.
sidx; manual route selection can still work without one.The extension source is plain JavaScript and has no production dependencies. Node.js 18 or newer is needed only for tests.
npm test
npm run check
The suite covers active-track selection, signed routing, PCDN/MCDN classification, Range and sidx parsing, probe failure control, player-first scheduling, multi-CDN retry, cache assembly, protocol parity, stable UI rendering, locales, and the Manifest surface.
When editing extension files, reload the extension on chrome://extensions and then reload the Bilibili tab so both execution worlds receive the new code.
Issues and focused pull requests are welcome. Please include:
npm test and npm run check results for code changes.Do not post complete signed media URLs, cookies, account identifiers, or private browsing data.
MIT © Bili Pilot contributors
JavaScript
97.1%
HTML
2.2%