Platform guide
How to download Bilibili videos with yt-dlp
Most Bilibili downloads come down to two things: your resolution is capped unless you log in, and a lot of videos are region-locked. Add the handful of errors people are hitting on recent builds and you have the whole picture.
Quick answer
# a single video (yt-dlp merges Bilibili's separate video + audio streams, so ffmpeg is required)
yt-dlp "https://www.bilibili.com/video/<BV-id>"
# cap or pick a resolution, e.g. 1080p and below
yt-dlp -S "res:1080" "https://www.bilibili.com/video/<BV-id>"We ran this in November 2026 (yt-dlp 2026.11.23) against a public video: yt-dlp -F lists DASH streams - video-only tiers plus a couple of audio-only m4a tracks - and yt-dlp picks the best of each and merges them with ffmpeg. If ffmpeg is missing the merge step fails; see the ffmpeg fix.
Resolutions above 480p/720p need a cookie
Bilibili hands anonymous requests the lower-quality streams. The 1080p, 1080p60, 4K and Hi-Res tiers are only offered to a logged-in account (some need a premium one). So the fix for "why is it so low-res" is almost always cookies, not flags:
yt-dlp --cookies-from-browser firefox "https://www.bilibili.com/video/<BV-id>"
yt-dlp -F --cookies-from-browser firefox "https://www.bilibili.com/video/<BV-id>" # now the higher tiers show upUse a browser that is logged in to Bilibili. More on exporting a session in using cookies with yt-dlp.
"This video may be deleted or geo-restricted"
ERROR: [BiliBili] <id>: This video may be deleted or geo-restricted. You might want to try a VPN or a proxy server (with --proxy)This is the one that trips up servers. A large share of Bilibili is restricted to mainland China, so a request from anywhere else - a laptop abroad, and almost always an AWS/GCP/Hetzner box - can't load the page. It is a region block, not something cookies or a client flag fixes. The request has to originate in a region where the video plays:
yt-dlp --proxy "http://user:pass@host:port" "https://www.bilibili.com/video/<BV-id>"If the same URL works in your browser but not yt-dlp, re-check that the browser isn't on a VPN yt-dlp doesn't share.
Multi-part videos, collections and favourites
Bilibili's multi-part videos (the ?p= pages, called an "anthology") and its collections/series are playlists to yt-dlp:
# every part of a multi-part video, in order
yt-dlp -o "%(title)s/%(playlist_index)02d - %(part_title)s.%(ext)s" \
"https://www.bilibili.com/video/<BV-id>"
# just parts 1 and 3-5
yt-dlp --playlist-items 1,3-5 "https://www.bilibili.com/video/<BV-id>"
# see what a URL contains before downloading
yt-dlp --flat-playlist --print "%(title)s" "https://www.bilibili.com/video/<BV-id>"If a collection or series URL fails to enumerate, update first - playlist parsing for some collection URLs was reported broken on recent builds (yt-dlp#18134).
Errors people are hitting right now
Bilibili's extractor sees frequent breakage, so update yt-dlp before anything else - most of these are fixed shortly after they're reported (update guide):
- 403 Forbidden (yt-dlp#18141): a recent run of 403s on Bilibili requests. Update first; if it persists on a server, it's usually the region/IP, not the flags.
- The download saved as
.html(yt-dlp#18147): yt-dlp wrote an error or challenge page to disk instead of the video. Run with-vand look for a 403 or geo message above it. - "No video formats found" on bangumi (yt-dlp#18115): bangumi (anime/series) URLs are both region-locked and frequently gated to premium accounts, so an anonymous request from outside the region often finds nothing. Cookies from a logged-in account in the right region are what's missing.
The mistake to avoid
Don't reach for -f format strings or random client flags when a Bilibili download is low-res or empty. Low-res means you're not logged in (add cookies); empty or "geo-restricted" means the region can't see it (a proxy in-region); an .html file or a 403 means update yt-dlp and read the -v output. The flag soup forums suggest rarely helps here.
Recurring sources
Pulling from the same sources on repeat?
Paste a link to preview what a maintained import API returns for it — across 1,000+ sites.
Building this into an app? See the API your backend calls instead
Frequently asked questions
Why does yt-dlp only give me 480p or 720p from Bilibili?
Bilibili only offers the higher-resolution streams (1080p and up, 1080p60, 4K, Hi-Res audio) to a logged-in account, and some need a premium account. Without cookies yt-dlp sees the lower tiers only. Pass a logged-in session with --cookies-from-browser firefox (or your browser), then yt-dlp -F will list the higher formats.
What does "This video may be deleted or geo-restricted" mean on Bilibili?
yt-dlp couldn't load the video page from your region. Much of Bilibili is restricted to mainland China, so requests from elsewhere - including most servers and datacenters - get this message. It is a region block, not a flag yt-dlp can toggle: you need the request to come from a region where the video plays (--proxy with a proxy there).
How do I download a multi-part Bilibili video or a whole collection?
A multi-part video (an 'anthology', the ?p= pages) and a collection/series are playlists to yt-dlp, so pointing it at the URL downloads every part. Use --playlist-items to pick specific parts, e.g. --playlist-items 1,3-5, and -o "%(title)s/%(playlist_index)02d - %(part_title)s.%(ext)s" to keep them in order.
yt-dlp saved a Bilibili download as an .html file - what happened?
yt-dlp wrote an error/challenge page to disk instead of the video, usually alongside a 403 or an extractor break. This was reported against recent builds (yt-dlp#18147). Update yt-dlp first - Bilibili extractor fixes land often - and if it persists, check -v output for a 403 or a geo-restriction before changing flags.