yt-dlp: [youtube] HTTP Error 403 shortly after download begins
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I intentionally remove or skip any mandatory* field
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 and 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
No response
Provide a description that is worded well enough to be understood
The error is quite annoying since it’s random and occurs even when I don’t pass any parameters to yt-dlp (no proxy, no deno). The same command executed immediately afterwards works without a hitch. This started several weeks ago.
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': TruetoYoutubeDLparams instead - Copy the WHOLE output (starting with
[debug] Command-line config) and insert it below
Complete Verbose Output
[4] remote 198.144.145.10
[debug] Command-line config: ['https://youtu.be/OluGXpld5G8', '-f', 'bestaudio', '--proxy', 'http://user:password@localhost:3004/', '--extractor-args', 'youtube:bypass_native_jsi;deno_no_jitless', '-vU']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.07.09 from yt-dlp/yt-dlp [7ead7332a] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: bbf84bf55
[debug] Python 3.9.7 (CPython x86_64 64bit) - Linux-5.10.0-30-amd64-x86_64-with-glibc2.31 (OpenSSL 1.1.1w 11 Sep 2023, glibc 2.31)
[debug] exe versions: ffmpeg N-116058-g2902ed25b5-20240630 (setts), ffprobe N-116058-g2902ed25b5-20240630, phantomjs 2.1.1
[debug] Optional libraries: sqlite3-3.34.1
[debug] Proxy map: {'all': 'http://user:password@localhost:3004/'}
[debug] Request Handlers: urllib
[debug] Extractor Plugins: NSigDeno (YoutubeIE)
[debug] Plugin directories: ['/opt/yt-dlp/yt_dlp_plugins']
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.07.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.07.09 from yt-dlp/yt-dlp)
[youtube+NSigDeno] Extracting URL: https://youtu.be/OluGXpld5G8
[youtube+NSigDeno] OluGXpld5G8: Downloading webpage
[youtube+NSigDeno] OluGXpld5G8: Downloading ios player API JSON
[debug] Loading youtube-nsig.5352eb4f from cache
[debug] [youtube+NSigDeno] Deno command line: deno run /tmp/tmp79f7ef2i
[debug] [youtube+NSigDeno] Decrypted nsig H5qSJ2RwVlHrlGLGJ2z => 4C3MhREB9mnCsw
[debug] Loading youtube-nsig.5352eb4f from cache
[debug] [youtube+NSigDeno] Deno command line: deno run /tmp/tmpx05xouym
[debug] [youtube+NSigDeno] Decrypted nsig uqnMPjZENh2xyLlVg4d => 2ypEw_FFTYvTyQ
[youtube+NSigDeno] OluGXpld5G8: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] OluGXpld5G8: Downloading 1 format(s): 251
[debug] Invoking http downloader on "https://rr3---sn-p5qlsn7l.googlevideo.com/videoplayback?expire=1720553291&ei=6zqNZuqdDJ-KkucP2fiKsAM&ip=XXX&id=o-AGbl0D--wlZxRXpNc49VX7y8hWCpLQ2THMXhKZKagZDC&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=xO&mm=31%2C26&mn=sn-p5qlsn7l%2Csn-vgqsknzz&ms=au%2Conr&mv=m&mvi=3&pl=25&initcwndbps=3832500&bui=AXc671J3gWSUVG8Pof9v8Ri_JDRhAEu0l1nJArMSJvIJbj_1lmpl9bkEZ55g2wtOPUEAjTiraXM202KI&spc=NO7bAZlQP6E4HmV6K4GA5w7210XBdCBpbN-X3ZxxaTPkPdnhqjobto1sR9Id&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=gjdwfvBsWLM2znfDYU-hyvcQ&rqh=1&gir=yes&clen=1262589&dur=79.381&lmt=1668700885878292&mt=1720531287&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=5318224&n=2ypEw_FFTYvTyQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAIIBKJ-fELLrLyrau48f1NUjjr2ubqD32TD-w2JX1fCjAiBnB8WFn7CZ6x-xMeRjC6QeluiBdzm3nluTTwgI43hiSw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIhAOJG70YrPST2VuscIS2Lc6zDFvIBeLDSGDpoT8TvBwGiAiBt12wyiUh6ejtRDhnLOCjHiiyXLUTmKjVesW6kM5Y8Sw%3D%3D"
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/opt/yt-dlp/yt_dlp/networking/_urllib.py", line 396, in _send
res = opener.open(urllib_req, timeout=self._calculate_timeout(request))
File "/opt/python/versions/3.9.7/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/opt/python/versions/3.9.7/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/opt/python/versions/3.9.7/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/opt/python/versions/3.9.7/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/opt/python/versions/3.9.7/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/yt-dlp/yt_dlp/YoutubeDL.py", line 3478, in process_info
success, real_download = self.dl(temp_filename, info_dict)
File "/opt/yt-dlp/yt_dlp/YoutubeDL.py", line 3198, in dl
return fd.download(name, new_info, subtitle)
File "/opt/yt-dlp/yt_dlp/downloader/common.py", line 466, in download
ret = self.real_download(filename, info_dict)
File "/opt/yt-dlp/yt_dlp/downloader/http.py", line 369, in real_download
establish_connection()
File "/opt/yt-dlp/yt_dlp/downloader/http.py", line 120, in establish_connection
ctx.data = self.ydl.urlopen(request)
File "/opt/yt-dlp/yt_dlp/YoutubeDL.py", line 4160, in urlopen
return self._request_director.send(req)
File "/opt/yt-dlp/yt_dlp/networking/common.py", line 117, in send
response = handler.send(request)
File "/opt/yt-dlp/yt_dlp/networking/_helper.py", line 208, in wrapper
return func(self, *args, **kwargs)
File "/opt/yt-dlp/yt_dlp/networking/common.py", line 337, in send
return self._send(request)
File "/opt/yt-dlp/yt_dlp/networking/_urllib.py", line 401, in _send
raise HTTPError(UrllibResponseAdapter(e.fp), redirect_loop='redirect error' in str(e)) from e
yt_dlp.networking.exceptions.HTTPError: HTTP Error 403: Forbidden
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 30 (7 by maintainers)
Commits related to this issue
- [ie/youtube] Retry on PO token experiment Closes #10397 Authored by: seproDev — committed to seproDev/yt-dlp by seproDev 2 years ago
- [ie/youtube] Ignore initial player response on PO token experiment Closes #10397 Authored by: seproDev — committed to seproDev/yt-dlp by seproDev 2 years ago
- [ie/youtube] Avoid poToken experiment player responses (#10456) Closes #10397 Authored by: seproDev — committed to coletdjnz/yt-dlp-dev by seproDev 2 years ago
I downgraded to yt-dlp==2023.7.6 and it’s working fine for me now 😃
Still getting this same issue on SmartTube which uses yt-dlp. NewPipe also seems to be affected…
If you get any nsig warning or error, it means you need to update to the latest nightly.
If you are not using the latest nightly, your experience is irrelevant and do NOT reply to this issue. Update to the latest nightly before commenting.
Only discuss 403 errors with yt-dlp (not any other app) in this thread.
--extractor-args "youtube:player_client=ios"works around this issue, at the cost of sacrificing some WEB-only formats. (And it will not be effective for age-restricted videos where the TV embedded client bypass is needed/used.)@bashonly Can this be the solution - https://github.com/LuanRT/YouTube.js/issues/683#issuecomment-2219793515
Do you have the latest 2024.07 version? yt-dlp --version
If not upgrade with: yt-dlp -U
@UnconsciousBlaringHuman update yt-dlp
This issue is not tracking 403 errors on EVERY video. If you are experiencing that, then your issue is either #10046 (you are passing cookies and your account has been blocked) or #7860 (your IP has been blocked by Youtube).