yt-dlp: [bilibili] Cannot download videos with 1080p resolution

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I remove or skip any mandatory* field

Checklist

  • I’m reporting a broken site
  • I’ve verified that I’m running yt-dlp version 2022.11.11 (update instructions) or later (specify commit)
  • 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 the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read the guidelines for opening an issue
  • I’ve read about sharing account credentials and I’m willing to share it if required

Region

all

Provide a description that is worded well enough to be understood

Videos with resolution only up to 720p can be downloaded in 720p, but videos with resolution of 1080p or higher cannot be downloaded, not even those below 720p. In other issues, it is assumed that the difference is whether the account is Premier or not, but even regular members who are not Premier can watch 1080p. Only downloading is not possible.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

>yt-dlp -vU https://www.bilibili.com/video/BV1Dx411n7Pg?p=32
[debug] Command-line config: ['-vU', 'https://www.bilibili.com/video/BV1Dx411n7Pg?p=32']
[debug] Encodings: locale cp932, fs utf-8, pref cp932, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.11.11 [8b64402] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg N-109451-geb0455d646-20221225 (setts), ffprobe N-109451-geb0455d646-20221225
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1723 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.11.11, Current version: 2022.11.11
yt-dlp is up to date (2022.11.11)
[debug] [BiliBili] Extracting URL: https://www.bilibili.com/video/BV1Dx411n7Pg?p=32
[BiliBili] 1Dx411n7Pg: Downloading webpage
[BiliBili] BV1Dx411n7Pg: Extracting videos in anthology
[BiliBili] Format(s) 1080P 高清, 360P 流畅, 480P 清晰, 720P 高清 are missing; you have to login or become premium member to download them
[BiliBili] 13255517: Extracting chapters
ERROR: [BiliBili] BV1Dx411n7Pg_p32: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1485, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1582, in __extract_info
  File "yt_dlp\YoutubeDL.py", line 1641, in process_ie_result
  File "yt_dlp\YoutubeDL.py", line 2573, in process_video_result
  File "yt_dlp\YoutubeDL.py", line 1035, in raise_no_formats
yt_dlp.utils.ExtractorError: [BiliBili] BV1Dx411n7Pg_p32: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U

About this issue

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

Most upvoted comments

Interesting. I merged the two extraction tactics in my yt-dl back-port and got this:

$ python -m youtube_dl -v  'https://www.bilibili.com/video/BV1Dx411n7Pg?p=32' -F[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.bilibili.com/video/BV1Dx411n7Pg?p=32', u'-F']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 774b346f9
[debug] Python version 2.7.18 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[BiliBili] 1Dx411n7Pg: Downloading webpage
[BiliBili] BV1Dx411n7Pg: Extracting videos in anthology
[BiliBili] 21733763: Downloading video info page
[BiliBili] 21733763: Downloading video info page
[BiliBili] 21733763: Downloading video info page
[BiliBili] 13255517: Extracting chapters
[info] Available formats for BV1Dx411n7Pg_p32:
format code  extension  resolution note
mp4          mp4        unknown    72.75MiB
flv480       flv        480p       158.90MiB
flv720       flv        unknown    304.17MiB
flv          flv        unknown    60.37MiB (best)
$

The best format gives this mpv output,

 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 (aac 2ch 48000Hz)
File tags:
 Description: Packed by Bilibili XCoder v1.0(fixed_gap:True)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p
AV: 00:00:47 / 00:03:43 (21%) A-V:  0.000 Dropped: 5 Cache: 85s/27MB

whereas the 720p format gives this:

 (+) Video --vid=1 (h264 1280x720 30.000fps)
 (+) Audio --aid=1 (aac 2ch 48000Hz)
File tags:
 Description: Bilibili VXCode Swarm Transcoder v0.2.49(gap_fixed:False)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p
AV: 00:00:07 / 00:23:55 (0%) A-V:  0.000 Cache: 109s/28MB

So the best format, which should be 1080p, is actually 720p and missing the last 20:12 of the video. In fact the “1080p” video has 5 parts @ 720p. Initially, such multi-part formats could be skipped.

The 4 video and 3 audio formats that yt-dlp finds for the video above are indeed the ones in the JSON assigned to window.__playinfo__ when the page is loaded in a non-JS browser. These are sent under the dash key.

Whereas the original video has just the flv480 combined format, under the durl key.

To get the full range of formats the extractor will need to load some API URL(s) to get the link for each of the formats listed under the support_formats key (apart from the 3rd which was already found) as listed above.

FFmpeg-Builds just got HEVC-over-FLV support. It would be interesting to test it on real-world examples, so if someone has premium access to BiliBili, your help would be greatly appreciated.

The yt-dl extractor uses http://interface.bilibili.com/v2/playurl but it’s quite confused about the various formats available. The yt-dlp extractor looks in the JSON sent in the page itself.