yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
89.57k stars 6.94k forks source link

[youtube] Got error: HTTP Error 403: Forbidden when downloading ANDR formats #7811

Closed danny83x1 closed 1 year ago

danny83x1 commented 1 year ago

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

Checklist

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

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())
bashonly commented 1 year ago

Available version: stable@2023.07.06, Current version: stable@2023.03.04 ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update

immibis commented 1 year ago

same problem, same solution

bashonly commented 1 year ago

Solution:

Update yt-dlp! or if already on version 2023.07.06, then show verbose log

U1s2e3r4n5a6m7e commented 1 year ago

Available version: stable@2023.07.06, Current version: stable@2023.03.04 ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update

@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:

for i in {1..100}
do
   url=$(yt-dlp --get-url izQsgE0L450 --format 18)
   curl -Is $url | head -n 1
done

Here are the results from the previous outdated version ("latest" in my package manager):

HTTP/1.1 302 Found
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
^C

After removing the outdated "latest" version using the package manager and installing the latest binary from the releases, here is the new output:

HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
^C

Thank you again for making my day <3

bashonly commented 1 year ago

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

immibis commented 1 year ago

@immibis

Update yt-dlp! or if already on version 2023.07.06, then show verbose log

I said, same solution. Updating fixed it.

danny83x1 commented 1 year ago

Solution:

Update yt-dlp! or if already on version 2023.07.06, then show verbose log

Thanks, I installed the new version without PIP and the problem was solved.

acewins727 commented 1 year ago

I also have this problem but when i try to update it says I installed with pip even though i used the release binaries ??? image

acewins727 commented 1 year ago

nvm I found it

mrtejas99 commented 1 year ago

How did you fix it?

jwilber commented 1 year ago

You need to update using pip: pip install --upgrade yt-dlp

Alexhha commented 1 year ago

I'm using 2023.10.13 but sill got the same error

$ yt-dlp -v -f 137 'https://www.youtube.com/watch?v=4NRXx6U8ABQ'
[debug] Command-line config: ['-v', '-f', '137', 'https://www.youtube.com/watch?v=4NRXx6U8ABQ']
[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@2023.10.13 [b634ba742] (pip)
[debug] Python 3.8.3 (CPython x86_64 64bit) - macOS-10.16-x86_64-i386-64bit (OpenSSL 1.1.1g  21 Apr 2020)
[debug] exe versions: ffmpeg 5.1.2 (setts), ffprobe 5.1.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-3.31.1, websockets-10.4, xattr-0.9.9
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=4NRXx6U8ABQ
[youtube] 4NRXx6U8ABQ: Downloading webpage
[youtube] 4NRXx6U8ABQ: Downloading ios player API JSON
[youtube] 4NRXx6U8ABQ: Downloading android player API JSON
[youtube] 4NRXx6U8ABQ: 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] 4NRXx6U8ABQ: Downloading 1 format(s): 137
[debug] Invoking http downloader on "https://rr2---sn-xaxjugvonx8a0ni-0qwe.googlevideo.com/videoplayback?expire=1697999749&ei=JRc1ZfPRLpK-0u8PtIGx6Ao&ip=31.43.231.233&id=o-ABLi_XEk6JIVf1Fvg1kaU4avKPAdx4tVbYBIYVjYOduU&itag=137&source=youtube&requiressl=yes&mh=j6&mm=31%2C29&mn=sn-xaxjugvonx8a0ni-0qwe%2Csn-3c27sn7e&ms=au%2Crdu&mv=m&mvi=2&pl=23&gcr=ua&initcwndbps=1037500&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=90125888&dur=262.512&lmt=1653320570339130&mt=1697977742&fvip=5&keepalive=yes&fexp=24007246&beids=24350018&c=IOS&txp=4535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AGM4YrMwRAIgXncHhynEOuKwaRvvX5A_Hk-xfXtqLFfEFWlTPFCmChoCIDIx9Az1BHIqYwoaLNfDnixWsVeyXpWTkhvTkLVEijVK&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AK1ks_kwRAIgYWlhHm7hFKfZtizRf3p1uAIKWo4DFwxFv-GntikCMzQCIAfy4dsbgK4T9zONOK0M3JsrEjtd7L-8mPn8witywpil"
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/networking/_urllib.py", line 410, in _send
    res = opener.open(urllib_req, timeout=float(request.extensions.get('timeout') or self.timeout))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 649, 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 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 4051, in urlopen
    return self._request_director.send(req)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/networking/_helper.py", line 204, in wrapper
    return func(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/networking/_urllib.py", line 415, 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

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3387, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3108, in dl
    return fd.download(name, new_info, subtitle)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/downloader/common.py", line 455, in download
    ret = self.real_download(filename, info_dict)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/downloader/http.py", line 364, in real_download
    establish_connection()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/downloader/http.py", line 120, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 4070, in urlopen
    raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 403: Forbidden

Did I miss something ?

bashonly commented 1 year ago

@Alexhha if you are on a data center IP or have been downloading an unusually large volume of videos, it is likely #7860 (your IP has been blocked by youtube)

Alexhha commented 1 year ago

@bashonly

It seems you were right, I tried the same command on ec2 and it worked

tuxick commented 9 months ago

upgrade

You might need/want to run pip install --upgrade yt-dlp in a venv.

ShXtXp commented 9 months ago

i also got this error using debian 12 without having downloaded >5 videos, i proved using the latest stable and the latest non-stable and neither worked.