ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.31k stars 10.03k forks source link

403 error when downloading BiliBili videos #32879

Closed nijinekoyo closed 3 months ago

nijinekoyo commented 3 months ago

Checklist

Version

> youtube-dl -U
Latest version: 2024.07.25, Current version: 2024.07.25
youtube-dl is up to date (2024.07.25)

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.bilibili.com/video/BV11y411e7Lj/?p=4', '--cookie', '.\\cookie.txt', '--referer', 'https://www.bilibili.com/video/BV11y411e7Lj', '--verbose']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2024.07.25 [e1b3fa242] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.4.4 (CPython AMD64 32bit) - Windows-10-10.0.22621 - OpenSSL 1.0.2d 9 Jul 2015
[debug] exe versions: ffmpeg N-112922-gebfd3912e9-20231206, ffprobe N-112922-gebfd3912e9-20231206
[debug] Proxy map: {}
[BiliBili] 11y411e7Lj: Downloading webpage
[BiliBili] 11y411e7Lj: Downloading video info page
WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden
[BiliBili] 11y411e7Lj: Downloading video info page
ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
  File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\extractor\common.py", line 679, in _request_webpage
  File "D:\a\ytdl-nightly\ytdl-nightly\youtube_dl\YoutubeDL.py", line 2500, in urlopen
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 470, in open
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 580, in http_response
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 502, in error
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 442, in _call_chain
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 685, in http_error_302
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 470, in open
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 580, in http_response
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 508, in error
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 442, in _call_chain
  File "C:\hostedtoolcache\windows\Python\3.4.4\x86\lib\urllib\request.py", line 588, in http_error_default

Description

When downloading BiliBili videos, 403 errors keep appearing. Passing in cookies and setting referer still doesn't solve the problem.

dirkf commented 3 months ago

Yes, this is the current manifestation of an old bug:

The WIP extractor should be re-tested now.