yt-dlp Command Generator for Bilibili
Build a yt-dlp command for Bilibili, starting with the browser impersonation that avoids most 403 errors.
403 errors and quality limits
Bilibili rejects requests that do not look like a browser, which is why a plain command often returns 403. Impersonation is switched on in this preset because it is the fix in most cases.
1080p and above are usually reserved for logged-in or premium accounts, so cookies matter here for quality and not just for access. Multi-part videos appear as playlist entries.
Bilibili is the platform where a stale yt-dlp breaks fastest — the site reworks its API more often than any Western platform, and extractor updates land in yt-dlp releases within days of each change. When a download that worked last month starts failing, update first: yt-dlp -U. Impersonation (on by default in this preset) covers the browser-looking-headers part of the 403 problem; the rest is usually a missing or expired session.
Multi-part uploads — the P1/P2/P3 structure common for series — arrive as playlist entries, so whole-playlist handling fetches every part, and the playlist index in the output template keeps the parts in order. Danmaku (the scrolling comments) are a subtitle track to yt-dlp: --write-subs saves them as an .ass file, which is the only format they exist in. If you do not want them, do nothing — they are not merged unless asked.
Interaction qualities — the "dolby" and premium ladders — exist only for accounts holding them, and no flag reaches them without cookies from such an account. Region-locked content is the other wall: some uploads are visible only from mainland China, and a proxy in-region is the only route when the block is enforced at the CDN rather than the page. Geo-bypass occasionally works for the page-level block and never for the CDN one.
Bilibili serves its higher qualities as DASH with separate audio, so ffmpeg merges just like YouTube — the merge step is in this preset already. Audio-only extraction with -x works and is the fastest way to take just the sound from a long multi-part upload. For live replays, the replay becomes an ordinary VOD after the stream ends, so download it like any video; the live-recording options on this site are for the stream while it is happening.