yt-dlp: Bilibili: Formats missing after passing cookies

Checklist

  • I’m reporting that yt-dlp is broken on a supported site
  • I’ve verified that I have updated yt-dlp to nightly or master (update instructions)
  • I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched known issues, the FAQ, and the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read about sharing account credentials and I’m willing to share it if required

Region

China

Provide a description that is worded well enough to be understood

  1. In Firefox 135.0.1, I logged in with a “大会员”(VIP) account.
  2. I used the cookies.txt extension to extract cookies of bilibili.com.
  3. I tried downloading a video with the cookies passed to yt-dlp, but was told: [BiliBili] Format(s) 4K 超清, 1080P 高码率 are missing; you have to become a premium member to download them. Use --cookies-from-browser or --cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies

Well, these formats are indeed for the VIPs only, but I think I am one of them? I used the same method to download videos before and never failed. Something must be changed by bilibili, but I have no idea.

I used --write-pages to extract some more info as attached.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['--verbose', '--write-pages', '--cookies', 'cookies.txt', 'https://www.bilibili.com/video/BV1YK4y1C7CU/']
[debug] Encodings: locale cp936, fs utf-8, pref cp936, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2025.02.26.232946 from yt-dlp/yt-dlp-nightly-builds [3042afb5f] (win_exe)
[debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.19041-SP0 (OpenSSL 1.1.1t  7 Feb 2023)
[debug] exe versions: ffmpeg 7.1-full_build-www.gyan.dev (setts), ffprobe 7.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2025.01.31, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.3.0, websockets-15.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Plugin directories: none
[debug] Loaded 1843 extractors
[BiliBili] Extracting URL: https://www.bilibili.com/video/BV1YK4y1C7CU/
[BiliBili] 1YK4y1C7CU: Downloading webpage
[BiliBili] Saving request to 1YK4y1C7CU_https_-_www.bilibili.com_video_BV1YK4y1C7CU_.dump
[BiliBili] BV1YK4y1C7CU: Extracting videos in anthology
[BiliBili] Saving request to BV1YK4y1C7CU_https_-_api.bilibili.com_x_player_pagelistbvid=BV1YK4y1C7CU_jsonp=jsonp.dump
[BiliBili] Format(s) 4K 超清, 1080P 高码率 are missing; you have to become a premium member to download them. Use --cookies-from-browser or --cookies for the authentication. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies
[BiliBili] 882566744: Extracting chapters
[BiliBili] Saving request to 882566744_https_-_api.bilibili.com_x_player_wbi_v2aid=882566744_cid=172274931.dump
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec, channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] BV1YK4y1C7CU: Downloading 1 format(s): 100026+30280
[debug] Invoking http downloader on "https://cn-gddg-cm-01-02.bilivideo.com/upgcxcode/31/49/172274931/172274931_da2-1-100026.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1740669734&gen=playurlv2&os=bcache&oi=1865949154&trid=0000bc16f3c2e9414adc9d3d0f614a5ec472u&mid=701918224&platform=pc&og=hw&upsig=bf7ec2343e159c8dc31e139eb01062dc&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&cdnid=2122&bvc=vod&nettype=0&orderid=0,3&buvid=BDABE54B-CDFF-9B1C-B13D-A0BF1F348EEA34522infoc&build=0&f=u_0_0&agrr=0&bw=120904&logo=80000000"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: 【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f100026.mp4
[download] 100% of   54.19MiB in 00:00:05 at 10.69MiB/s
[debug] Invoking http downloader on "https://cn-gddg-cm-01-02.bilivideo.com/upgcxcode/31/49/172274931/172274931_nb2-1-30280.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1740669734&gen=playurlv2&os=bcache&oi=1865949154&trid=0000bc16f3c2e9414adc9d3d0f614a5ec472u&mid=701918224&platform=pc&og=hw&upsig=dd696443647ba26bd11c553296d1484a&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&cdnid=2122&bvc=vod&nettype=0&orderid=0,3&buvid=BDABE54B-CDFF-9B1C-B13D-A0BF1F348EEA34522infoc&build=0&f=u_0_0&agrr=0&bw=15620&logo=80000000"
[download] Destination: 【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f30280.m4a
[download] 100% of    7.00MiB in 00:00:00 at 13.00MiB/s
[Merger] Merging formats into "【何同学】一只鸽子的自白 [BV1YK4y1C7CU].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i "file:【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f100026.mp4" -i "file:【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f30280.m4a" -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart "file:【何同学】一只鸽子的自白 [BV1YK4y1C7CU].temp.mp4"
Deleting original file 【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f30280.m4a (pass -k to keep)
Deleting original file 【何同学】一只鸽子的自白 [BV1YK4y1C7CU].f100026.mp4 (pass -k to keep)

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 21 (2 by maintainers)

Most upvoted comments

maybe we can add an extractor arg for this?

it would be appropriate since there’s a rate-limit in play here

Okay let’s see

please test that with the following steps

Yeah here is it

rsp.txt

also, could you please share what would happen if you switch the quality to auto, extract the cookies and pass them to yt-dlp?

I switched from 4K to Auto and extracted the cookies. CURRENT_QUALITY was set to 0 and behaved the same as switching to 1080P normal bitrate. I didn’t see another wbi/playurl in the devtools meanwhile.

@PumpkinJui Did you try removing CURRENT_QUALITY line from your cookies file? Would be curious to know the result of that.

The same as the above.

I have the same issue