# How to download Bilibili videos with yt-dlp

Download Bilibili videos with yt-dlp: the basic command, why higher resolutions need a logged-in cookie, multi-part and collection URLs, and the errors people hit - 'may be deleted or geo-restricted', 403, the .html file, and 'No video formats found' on bangumi.

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

```bash
# 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](/guides/fix-ffmpeg-not-found).

## 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:

```bash
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 up
```

Use a browser that is logged in to Bilibili. More on exporting a session in [using cookies with yt-dlp](/guides/yt-dlp-cookies).

## "This video may be deleted or geo-restricted"

```bash
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:

```bash
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:

```bash
# 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](https://github.com/yt-dlp/yt-dlp/issues/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](/guides/update-yt-dlp)):

- **403 Forbidden** ([yt-dlp#18141](https://github.com/yt-dlp/yt-dlp/issues/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](https://github.com/yt-dlp/yt-dlp/issues/18147)): yt-dlp wrote an error or challenge page to disk instead of the video. Run with `-v` and look for a 403 or geo message above it.
- **"No video formats found" on bangumi** ([yt-dlp#18115](https://github.com/yt-dlp/yt-dlp/issues/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.

<DocCta variant="recurring-source" ctaVariant="bilibili-guide" />

<Faq />

## Related guides

- [Use cookies with yt-dlp](/guides/yt-dlp-cookies)
- [Update yt-dlp](/guides/update-yt-dlp)
- [Download playlists with yt-dlp](/guides/download-playlists)
- [Fix "ffmpeg not found"](/guides/fix-ffmpeg-not-found)
- [yt-dlp alternatives](/guides/yt-dlp-alternatives)