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.36k stars 10.04k forks source link

youtube.com "Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1" #29404

Closed Nukley closed 1 year ago

Nukley commented 3 years ago

Checklist

Verbose log

Y:\networkdrive\videos2>"youtube-dl(1).exe" -v https://www.youtube.com/watch?v=hMx0pENRg9A
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=hMx0pENRg9A']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 4.4-essentials_build-www.gyan.dev
[debug] Proxy map: {}
[youtube] hMx0pENRg9A: Downloading webpage
[youtube] hMx0pENRg9A: Downloading MPD manifest
[debug] Default format spec: bestvideo+bestaudio/best
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1624774032/ei/MMHXYPaZE8TWhwaEnoDACw/ip/173.2.48.206/id/84cc74a4435183d0/source/youtube/requiressl/yes/playback_host/r5---sn-j5caxoxu-pn2z.googlevideo.com/mh/Vb/mm/31%2C26/mn/sn-j5caxoxu-pn2z%2Csn-p5qs7nes/ms/au%2Conr/mv/m/mvi/5/pcm2cms/yes/pl/21/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/1600000/vprv/1/mt/1624752280/fvip/5/keepalive/yes/fexp/24001373%2C24007246/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRQIhAJOfwc1rZZItpclmBXc5Nz-17WYcvGOqAoj8_Td3ssmQAiAlMWZTJlHo9w9krEhZgQSPN30kAaQgI6e2NTpBhq0_ww%3D%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRAIgG-uPZPDCsxbCM8wlutul7GEMyGxXIf99B01s76YGUpICIAzpiSSKKcVWow-F0XYX7qHIzvGM_WWJMw2LBHsfogOn'
[dashsegments] Total fragments: 32
[download] Destination: Is It A Good Idea To Flush This-hMx0pENRg9A.f248.webm
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\__init__.py", line 475, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\__init__.py", line 465, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 2069, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 808, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 847, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 881, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 1692, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 1970, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 1915, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\downloader\common.py", line 366, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\downloader\dash.py", line 75, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\downloader\common.py", line 165, in report_error
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 628, in report_error
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 590, in trouble

Description

For some reason youtube-dl errors when trying to download this particular video: https://www.youtube.com/watch?v=hMx0pENRg9A I'm unsure as to what I could suggest as a potential fix for this program, otherwise I would probably have opened to pull request.

dirkf commented 3 years ago

See #29395.

ghost commented 3 years ago

In Firefox, if I intentionally set media.mediasource.mp4.enabled to false and select 1080p HD (248 webm format), video won't load and I see error 404 in DevTools.

YouTube problem.

october262 commented 3 years ago

for this - https://www.youtube.com/watch?v=hMx0pENRg9A try youtube-dl -f mp4 https://www.youtube.com/watch?v=hMx0pENRg9A it downloads.

dirkf commented 3 years ago

You can get video formats other than 248, but the question is: why is YT advertising (in a DASH manifest) a format whose DASH media URLs are unavailable? Does YT really mean 404? Is there some magic context (location, cookie, etc) that would make this format appear?

svbrunov commented 2 years ago

Dear maintainers,

Currently, I am observing the same problem with the latest version of youtube-dl.

Preconditions

The currently latest version of youtube-dl:

$ youtube-dl --version
2021.12.17

Scenario

Video to download: Introduction to Design Patterns - Kevin Greer - Day 1 - YouTube.

Command line:

youtube-dl --verbose -f bestvideo+bestaudio -- 'https://www.youtube.com/watch?v=uslGu0kezeg'

Expected result

Successful download.

Actual result

Failed to download.

$ youtube-dl --verbose -f bestvideo+bestaudio -- 'https://www.youtube.com/watch?v=uslGu0kezeg'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '-f', 'bestvideo+bestaudio', '--', 'https://www.youtube.com/watch?v=uslGu0kezeg']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.9.9 (CPython) - Linux-5.15.0-2-amd64-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.4.1-2, ffprobe 4.4.1-2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] uslGu0kezeg: Downloading webpage
[youtube] uslGu0kezeg: Downloading MPD manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1640115934/ei/ftrBYauOLJ7k7QTGha3IAQ/ip/109.184.201.109/id/bac946bb491ecde8/source/youtube/requiressl/yes/playback_host/rr2---sn-gvnuxaxjvh-n3ml.googlevideo.com/mh/B9/mm/31%2C29/mn/sn-gvnuxaxjvh-n3ml%2Csn-n8v7znlr/ms/au%2Crdu/mv/m/mvi/2/pl/23/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/1538750/vprv/1/mt/1640094079/fvip/2/keepalive/yes/fexp/24001373%2C24007246/beids/23886209/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRQIgewLFd9DshTuamDKADFfrSY5jObtAgsAgDbhNjAhrT1sCIQC01xaV5BLvUg3lIQSoRSzC49yIJoplJKH1PMTE_x1Wsw%3D%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRgIhAKTLtqso2uJQ8IkYni95rUWLRpO_vSe983ya5s1hz4dgAiEAsI3CeZm8Qxh7sj9SCmW9du3m5M1lNmNATReUte1teCY%3D'
[dashsegments] Total fragments: 549
[download] Destination: Introduction to Design Patterns - Kevin Greer - Day 1-uslGu0kezeg.f247.webm
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
  File "/usr/bin/youtube-dl", line 33, in <module>
    sys.exit(load_entry_point('youtube-dl==2021.12.17', 'console_scripts', 'youtube-dl')())
  File "/usr/lib/python3/dist-packages/youtube_dl/__init__.py", line 479, in main
    _real_main(argv)
  File "/usr/lib/python3/dist-packages/youtube_dl/__init__.py", line 469, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 847, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 881, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1692, in process_video_result
    self.process_info(new_info)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1970, in process_info
    partial_success = dl(fname, new_info)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1915, in dl
    return fd.download(name, info)
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/dash.py", line 75, in real_download
    self.report_error('giving up after %s fragment retries' % fragment_retries)
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 590, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

Notes

When using the best format instead of bestvideo+bestaudio, the download was successful.

Best regards,
Sergey Vyacheslavovich Brunov.

dirkf commented 2 years ago

This is consistent with other observations. If you can show any evidence that the failing format is actually accessible in the browser or via some other downloader, then we could have something to work with.

dirkf commented 1 year ago

OP's video now Private; uslGu0kezeg works; stale.

estatistics commented 10 months ago

here an example by me: yt-dlp -o "Hannibal series OST: Futamono - Brian Reitzell_[qUHEmp-4zQA].webm" qUHEmp-4zQA

dirkf commented 10 months ago

30839: If you were actually running yt=-dlp ...

However the behaviour is the same with yt-dl: but the video doesn't play on Invidious or YT as far as I can see. As we all know, Alphabet is too short on cash to run a reliable service.