yt-dlp: [youtube] Got error: HTTP Error 403: Forbidden when downloading ANDR formats
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 asking a question and not reporting a bug or requesting a feature
- I’ve looked through the README
- I’ve verified that I’m running yt-dlp version 2023.07.06 (update instructions) or later (specify commit)
- I’ve searched known issues and the bugtracker for similar questions including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
Please make sure the question is worded well enough to be understood
I’m trying to download this video and I always get this error, this happened a couple of days ago,
https://www.youtube.com/watch?v=AsDxw522Nec
my command:
yt-dlp --force-overwrites -f ‘bestvideo[height=360][ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio’ --merge-output-format mp4 “https://www.youtube.com/watch?v=AsDxw522Nec” --output //*/file.mp4"
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': True
toYoutubeDL
params instead - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
[debug] Encodings: locale ISO-8859-1, fs iso8859-1, pref ISO-8859-1, out iso8859-1, error iso8859-1, screen iso8859-1
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (pip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.4.0-122-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f 31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.07.06, Current version: stable@2023.03.04
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/latest/download/_update_spec
ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
[youtube] Extracting URL: https://www.youtube.com/watch?v=AsDxw522Nec
[youtube] AsDxw522Nec: Downloading webpage
[youtube] AsDxw522Nec: Downloading android player API JSON
[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, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] AsDxw522Nec: Downloading 1 format(s): 134+140
[debug] Invoking dashsegments downloader on "https://rr4---sn-2imern76.googlevideo.com/videoplayback?expire=1691780915&ei=0zLWZKj1NtuvsfIPqseQ6A0&ip=136.175.8.193&id=o-AHCUTZDLApFhOaiaFE2N8TrFY652aibBGz9OMnVXpxLM&itag=134&source=youtube&requiressl=yes&mh=Sr&mm=31%2C26&mn=sn-2imern76%2Csn-najern7k&ms=au%2Conr&mv=m&mvi=4&pl=22&initcwndbps=193750&spc=UWF9f8YvE6LaExJB-x7bdjDWp-BV5C7znE9ak7CrSg&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=13805368&dur=2213.433&lmt=1691462708266868&mt=1691759132&fvip=5&keepalive=yes&fexp=24007246%2C51000011%2C51000023&beids=24350018&c=ANDROID&txp=4432434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhANSVPaGP40mC_mJiSiQafdTWs7M8B2THsZHv0-1KL4VHAiAN6zVNtntMQ7-R6zbI9bhBiM8g8W8nLLx6YuuPAHSSDw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgEZzW2_eHBT_qn5SeYiRzEqPhJDgqKO_ZFHVaANLzSIMCIEURNZ_Uk7Sdz2oPcX_tlV0mO7fLnyrJBrcYLU-476iN"
[dashsegments] Total fragments: 2
[download] Destination: *****/videos/AsDxw522Nec.f134.mp4
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (1/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (2/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (3/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (4/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (5/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (6/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (7/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (8/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (9/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (10/10)...
[download] Got error: HTTP Error 403: Forbidden. Giving up after 10 retries
File "/usr/local/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 967, in main
_exit(*variadic(_real_main(argv)))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 957, in _real_main
return ydl.download(all_urls)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3369, in download
self.__download_wrapper(self.extract_info)(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3344, in wrapper
res = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1507, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1518, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1615, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1674, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3229, in process_info
partial_success, real_download = self.dl(fname, new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2970, in dl
return fd.download(name, new_info, subtitle)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 444, in download
ret = self.real_download(filename, info_dict)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/dash.py", line 60, in real_download
return self.download_and_append_fragments_multiple(*args, is_fatal=lambda idx: idx == 0)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 382, in download_and_append_fragments_multiple
return self.download_and_append_fragments(*args[0], **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 521, in download_and_append_fragments
download_fragment(fragment, ctx)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 466, in download_fragment
for retry in RetryManager(self.params.get('fragment_retries'), error_callback):
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/utils.py", line 6141, in __iter__
self.error_callback(self.error, self.attempt, self.retries)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 463, in error_callback
self.report_retry(err, count, retries, frag_index, fatal)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 389, in report_retry
RetryManager.report_retry(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/utils.py", line 6148, in report_retry
return error(f'{e}. Giving up after {count - 1} retries') if count > 1 else error(str(e))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 392, in <lambda>
error=IDENTITY if not fatal else lambda e: self.report_error(f'\r[download] Got error: {e}'),
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1015, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 944, in trouble
tb_data = traceback.format_list(traceback.extract_stack())
ERROR: fragment 1 not found, unable to continue
File "/usr/local/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 967, in main
_exit(*variadic(_real_main(argv)))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 957, in _real_main
return ydl.download(all_urls)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3369, in download
self.__download_wrapper(self.extract_info)(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3344, in wrapper
res = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1507, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1518, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1615, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1674, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3229, in process_info
partial_success, real_download = self.dl(fname, new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2970, in dl
return fd.download(name, new_info, subtitle)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 444, in download
ret = self.real_download(filename, info_dict)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/dash.py", line 60, in real_download
return self.download_and_append_fragments_multiple(*args, is_fatal=lambda idx: idx == 0)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 382, in download_and_append_fragments_multiple
return self.download_and_append_fragments(*args[0], **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 522, in download_and_append_fragments
result = append_fragment(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 486, in append_fragment
self.report_error(f'fragment {frag_index} not found, unable to continue')
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1015, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 944, in trouble
tb_data = traceback.format_list(traceback.extract_stack())
[debug] Invoking dashsegments downloader on "https://rr4---sn-2imern76.googlevideo.com/videoplayback?expire=1691780915&ei=0zLWZKj1NtuvsfIPqseQ6A0&ip=136.175.8.193&id=o-AHCUTZDLApFhOaiaFE2N8TrFY652aibBGz9OMnVXpxLM&itag=140&source=youtube&requiressl=yes&mh=Sr&mm=31%2C26&mn=sn-2imern76%2Csn-najern7k&ms=au%2Conr&mv=m&mvi=4&pl=22&initcwndbps=193750&spc=UWF9f8YvE6LaExJB-x7bdjDWp-BV5C7znE9ak7CrSg&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=35823541&dur=2213.488&lmt=1691462408874955&mt=1691759132&fvip=5&keepalive=yes&fexp=24007246%2C51000011%2C51000023&beids=24350018&c=ANDROID&txp=4432434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAPrT9Rb8A2aAcIrdFNeyIBHOyYyfNoQJpVLJa90CgkVfAiEAnCl8NcVSHLDL0wd37D2qMNM0Er0SkC7lCdS9LrSb2eU%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgEZzW2_eHBT_qn5SeYiRzEqPhJDgqKO_ZFHVaANLzSIMCIEURNZ_Uk7Sdz2oPcX_tlV0mO7fLnyrJBrcYLU-476iN"
[dashsegments] Total fragments: 4
[download] Destination: *****/videos/AsDxw522Nec.f140.m4a
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (1/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (2/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (3/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (4/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (5/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (6/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (7/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (8/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (9/10)...
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (10/10)...
[download] Got error: HTTP Error 403: Forbidden. Giving up after 10 retries
File "/usr/local/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 967, in main
_exit(*variadic(_real_main(argv)))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 957, in _real_main
return ydl.download(all_urls)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3369, in download
self.__download_wrapper(self.extract_info)(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3344, in wrapper
res = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1507, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1518, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1615, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1674, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3229, in process_info
partial_success, real_download = self.dl(fname, new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2970, in dl
return fd.download(name, new_info, subtitle)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 444, in download
ret = self.real_download(filename, info_dict)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/dash.py", line 60, in real_download
return self.download_and_append_fragments_multiple(*args, is_fatal=lambda idx: idx == 0)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 382, in download_and_append_fragments_multiple
return self.download_and_append_fragments(*args[0], **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 521, in download_and_append_fragments
download_fragment(fragment, ctx)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 466, in download_fragment
for retry in RetryManager(self.params.get('fragment_retries'), error_callback):
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/utils.py", line 6141, in __iter__
self.error_callback(self.error, self.attempt, self.retries)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 463, in error_callback
self.report_retry(err, count, retries, frag_index, fatal)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 389, in report_retry
RetryManager.report_retry(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/utils.py", line 6148, in report_retry
return error(f'{e}. Giving up after {count - 1} retries') if count > 1 else error(str(e))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 392, in <lambda>
error=IDENTITY if not fatal else lambda e: self.report_error(f'\r[download] Got error: {e}'),
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1015, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 944, in trouble
tb_data = traceback.format_list(traceback.extract_stack())
ERROR: fragment 1 not found, unable to continue
File "/usr/local/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 967, in main
_exit(*variadic(_real_main(argv)))
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/__init__.py", line 957, in _real_main
return ydl.download(all_urls)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3369, in download
self.__download_wrapper(self.extract_info)(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3344, in wrapper
res = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1507, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1518, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1615, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1674, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 3229, in process_info
partial_success, real_download = self.dl(fname, new_info)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 2970, in dl
return fd.download(name, new_info, subtitle)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/common.py", line 444, in download
ret = self.real_download(filename, info_dict)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/dash.py", line 60, in real_download
return self.download_and_append_fragments_multiple(*args, is_fatal=lambda idx: idx == 0)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 382, in download_and_append_fragments_multiple
return self.download_and_append_fragments(*args[0], **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 522, in download_and_append_fragments
result = append_fragment(
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/downloader/fragment.py", line 486, in append_fragment
self.report_error(f'fragment {frag_index} not found, unable to continue')
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 1015, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/yt_dlp/YoutubeDL.py", line 944, in trouble
tb_data = traceback.format_list(traceback.extract_stack())
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 16 (4 by maintainers)
Solution:
Update yt-dlp! or if already on version
2023.07.06
, then show verbose logThanks, I installed the new version without PIP and the problem was solved.
Gonna make this a
site-bug
issue so that it is documented somewhere.These Youtube 403 errors are caused by fetching Android client formats using the old player params. This was fixed by 81ca451480051d7ce1a31c017e005358345a9149
@bashonly, Thank you for reminding me. I had been trying to determine for the past few weeks whether the issue was occurring because of me, the ISP, or not. I had almost lost hope, but thanks to you, it’s working now.
Shell code to visualize the issue:
Here are the results from the previous outdated version (“latest” in my package manager):
After removing the outdated “latest” version using the package manager and installing the latest binary from the releases, here is the new output:
Thank you again for making my day ❤️