So I was trying to download a video from Bilibili using annie. I oroginally chose youtube-dl but unfortunately it doesn't seem to support Bilibili website, so I chose annie instead, following the advice from a reddit user But despite it seems I have no luck using Annie either. I wonder if this is because Bilibili has updated their mechanism or if I made a mistake somewhere. This is the code.
apple@apples-MacBook-Pro ~ % annie "" Downloading error: this page has no playlist apple@apples-MacBook-Pro ~ % Also, youtube-dl claims it supports Bilibili and I definitely remember downlowding video from Bilibili using youtube-dl not so long ago. So what happened. Did Bilibili update their code or something?
apple@apples-MacBook-Pro ~ % youtube-dl "" [BiliBili] 90163846: Downloading webpage [BiliBili] 90163846: Downloading video info page WARNING: Unable to download JSON metadata: HTTP Error 412: Precondition Failed [BiliBili] 90163846: Downloading video info page ERROR: Unable to download JSON metadata: HTTP Error 412: Precondition Failed (caused by HTTPError()); please report this issue on . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the -- verbose flag and include its complete output. apple@apples-MacBook-Pro ~ % edit: Here is the debug log if it is of any help.
apple@192 ~ % youtube-dl -v "" [debug] System config: [u'--format', u'mp4', u'-o', u'~/Desktop/%(title)s.%(ext)s', u'--write-sub', u'--embed-subs'] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-v', u' [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2021.03.14 [debug] Python version 2.7.16 (CPython) - Darwin-20.3.0-x86_64-i386-64bit [debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4 [debug] Proxy map: {} [BiliBili] 1TD4y1R7k2: Downloading webpage [BiliBili] 1TD4y1R7k2: Downloading video info page ERROR: requested format not available Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper return func(self, *args, **kwargs) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 838, in __extract_info return self.process_ie_result(ie_result, download, extra_info) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 872, in process_ie_result return self.process_video_result(ie_result, download=download) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1675, in process_video_result expected=True) ExtractorError: requested format not available apple@192 ~ % 12 Answers
2 things you need to do to fix this:
- Upgrade to the current version of youtube-dl. The Bilibili extractor was last changed on 8/March/2021 and when I tested with an older version, it didn't work
- Use Bilibili URLs that look like
as the input for youtube-dl. Don't use Bilibili URLs like the first example that has a /s/ in it. So instead of, you should use
add the following in the command
--add-header Accept:'/'
1