Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to download videos from the website Bilibili #28341

Closed
pengguodong12 opened this issue Mar 4, 2021 · 6 comments
Closed

Unable to download videos from the website Bilibili #28341

pengguodong12 opened this issue Mar 4, 2021 · 6 comments

Comments

@pengguodong12
Copy link

youtube-dl.exe -F https://www.bilibili.com/video/av86917375 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-F', 'https://www.bilibili.com/video/av86917375', '--verbose']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2021.03.03
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 4.2.3
[debug] Proxy map: {}
[BiliBili] 86917375: Downloading webpage
[BiliBili] 86917375: Downloading video info page
WARNING: Unable to download JSON metadata: HTTP Error 412: Precondition Failed
[BiliBili] 86917375: Downloading video info page
ERROR: Unable to download JSON metadata: HTTP Error 412: Precondition Failed (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . 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.
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpvjygsik_\build\youtube_dl\extractor\common.py", line 632, in request_webpage
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpvjygsik
\build\youtube_dl\YoutubeDL.py", line 2275, in urlopen
File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

@Jane42070
Copy link

I get the same issue on Artix Linux while tryring to download Bilibili videos

@Dioxaz
Copy link

Dioxaz commented Mar 5, 2021

For info, logging in (with -u username) doesn't make any difference. My last successful download was on March 1st.

@xinyazhang
Copy link

xinyazhang commented Mar 6, 2021

It seems the standard header 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' (at utils.py:1673) prevents the server from replying something useful.

Temporary workaround: add --add-header 'Accept:*/*' to the command line.
Fix: add the missing single quote

@Dioxaz
Copy link

Dioxaz commented Mar 7, 2021

It seems the standard header 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' (at utils.py:1673) prevents the server from replying something useful.

Temporary workaround: add --add-header 'Accept:*/* to the command line.

Thank you very much for this workaround. But for some reason, it doesn't seem to work in my case. I still have the exact same 412 error, logged in or not. I might be doing something wrong. Also, there seems to be a typo in your text (is the single single-quote normal?).

Edit: What worked in my case is --add-header Accept:'*/*', written exactly as I've just quoted it.

pukkandan added a commit to yt-dlp/yt-dlp that referenced this issue Mar 7, 2021
This is a temporary fix. Ideally we should find a more reasonable accept string that just "*/*"

Fixes: ytdl-org/youtube-dl#28363 ytdl-org/youtube-dl#28341

Thanks to animelover1984 for identifying the problem
github-actions bot added a commit to hellopony/youtube-dl that referenced this issue Mar 8, 2021
This was referenced Mar 15, 2021
@TeachCourse
Copy link

resolved add :

--add-header Accept:'/'

nixxo pushed a commit to nixxo/yt-dlp that referenced this issue Nov 22, 2021
This is a temporary fix. Ideally we should find a more reasonable accept string that just "*/*"

Fixes: ytdl-org/youtube-dl#28363 ytdl-org/youtube-dl#28341

Thanks to animelover1984 for identifying the problem
@WhoR3born
Copy link

WhoR3born commented Jan 29, 2022

https://www.bilibili.com/video/BV1XY4114753 ?from=search&seid=9349536755186620436&spm_id_from=333.337.0.0

use bold part of link and add --add-header 'Accept:*/*'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants