Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube download stops short then fails to get any data blocks #17148

Closed
5 of 9 tasks
sambler opened this issue Aug 4, 2018 · 13 comments
Closed
5 of 9 tasks

Youtube download stops short then fails to get any data blocks #17148

sambler opened this issue Aug 4, 2018 · 13 comments
Labels

Comments

@sambler
Copy link

sambler commented Aug 4, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.08.04. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.08.04

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):


This error is related to settings in my config file which I have not changed for months, this one video fails, all other vids have had no issue. Moving the config allows this video to download with default settings.

My format list ends with best so I expect it to accept whatever format is available if my desired formats are not there.

Error log is two attempts, one start and one to continue after fail

% youtube-dl -v "https://www.youtube.com/watch?v=7aeQ8TT859Q"
[debug] System config: []
[debug] User config: [u'-o', u'%(autonumber)03d_%(playlist_index)s_%(title)s_%(extractor)s_%(id)s.%(ext)s', u'--ignore-errors', u'--restrict-filenames', u'--continue', u'--sub-lang', u'en', u'--embed-subs', u'--ffmpeg-location', u'/usr/local/bin/ffmpeg', u'--format', u'22/136+140/137+140/136+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/bestvideo[height<=?720][ext=mp4]+bestaudio[ext=m4a]/bestvideo[height<=?1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', u'--merge-output-format', u'mp4']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=7aeQ8TT859Q']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.08.04
[debug] Python version 2.7.15 (CPython) - FreeBSD-11.2-PRERELEASE-amd64-64bit-ELF
[debug] exe versions: ffmpeg 4.0, ffprobe 4.0, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 7aeQ8TT859Q: Downloading webpage
[youtube] 7aeQ8TT859Q: Downloading video info webpage
[debug] Invoking downloader on u'https://r4---sn-ppoxu-5qaz.googlevideo.com/videoplayback?mv=m&fvip=2&mt=1533347913&ratebypass=yes&ms=au%2Crdu&signature=6FA5B44D1BC94104C2A70A25F20ADCBF64F56C30.D51258D6B32F551CE8F2AABF0453BEC6360D2C0B&source=youtube&c=WEB&initcwndbps=775000&mn=sn-ppoxu-5qaz%2Csn-ntq7yn7l&mm=31%2C29&requiressl=yes&id=o-ANegjijBqaJ_SmMwmy2CtW5IIj0wZs0oBGbQKga6Wkxt&expire=1533369645&ipbits=0&key=yt6&mime=video%2Fmp4&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&dur=492.332&itag=22&ei=zQhlW4fcHYXq4gLZ3oi4Aw&pl=34&lmt=1533338502510130&ip=2001%3A44b8%3A2ae%3A7800%3A92%3A4c4c%3Ae0d5%3Ae9d9'
[download] Destination: 001_NA_DARK_TOWER_Un-Used_Concept_Designs_ADI_youtube_7aeQ8TT859Q.mp4
[download]   0.4% of 53.30MiB at 793.71KiB/s ETA 01:08[download] Got server HTTP error: Downloaded 242145 bytes, expected 55887033 bytes. Retrying (attempt 1 of 10)...


ERROR: Did not get any data blocks
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 342, in real_download
    return download()
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 320, in download
    retry(err)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 225, in retry
    raise RetryDownload(e)
RetryDownload

% youtube-dl -v "https://www.youtube.com/watch?v=7aeQ8TT859Q"
[debug] System config: []
[debug] User config: [u'-o', u'%(autonumber)03d_%(playlist_index)s_%(title)s_%(extractor)s_%(id)s.%(ext)s', u'--ignore-errors', u'--restrict-filenames', u'--continue', u'--sub-lang', u'en', u'--embed-subs', u'--ffmpeg-location', u'/usr/local/bin/ffmpeg', u'--format', u'22/136+140/137+140/136+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/bestvideo[height<=?720][ext=mp4]+bestaudio[ext=m4a]/bestvideo[height<=?1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', u'--merge-output-format', u'mp4']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=7aeQ8TT859Q']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.08.04
[debug] Python version 2.7.15 (CPython) - FreeBSD-11.2-PRERELEASE-amd64-64bit-ELF
[debug] exe versions: ffmpeg 4.0, ffprobe 4.0, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 7aeQ8TT859Q: Downloading webpage
[youtube] 7aeQ8TT859Q: Downloading video info webpage
[debug] Invoking downloader on u'https://r4---sn-ppoxu-5qaz.googlevideo.com/videoplayback?sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ip=2001%3A44b8%3A2ae%3A7800%3A92%3A4c4c%3Ae0d5%3Ae9d9&itag=22&ei=1QhlW8uFBJzk4ALClJa4BA&requiressl=yes&lmt=1533338502510130&mt=1533347978&expire=1533369653&ratebypass=yes&fvip=2&source=youtube&initcwndbps=775000&ipbits=0&pl=34&mv=m&c=WEB&ms=au%2Crdu&mm=31%2C29&key=yt6&signature=18219264F372B4759F2825CD569A83DDF110F7DF.FD9C989D3FD02E87199F939D261D07FADEAEEC&id=o-AC9hRwiRl5YopesqCWlAly3R3DnhxS2zJX1-NYFgiZn9&dur=492.332&mime=video%2Fmp4&mn=sn-ppoxu-5qaz%2Csn-ntqe7n76'
[download] Resuming download at byte 242145


ERROR: Did not get any data blocks
  File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 467, in main
    _real_main(argv)
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 457, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 803, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 857, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1635, in process_video_result
    self.process_info(new_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1908, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1847, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 364, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 342, in real_download
    return download()
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 312, in download
    self.report_error('Did not get any data blocks')
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 620, in report_error
    self.trouble(error_message, tb)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 582, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())


@mzfr
Copy link

mzfr commented Aug 6, 2018

@sambler Can you reproduce the error because this seems to work for me.

@l29ah
Copy link

l29ah commented Aug 6, 2018

Seems like I started to get the same problem with youtube today:

‰ youtube-dl -v  'https://www.youtube.com/watch?v=FW0jGHS864k'                                
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-n', '-c', '--format', 'best[height<=800]/best', '-v', 'https://www.youtube.com/watch?v=FW0jGHS864k']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.08.04
[debug] Python version 3.5.5 (CPython) - Linux-4.17.11+-x86_64-with-glibc2.4
[debug] exe versions: ffmpeg 4.0.2, ffprobe 4.0.2
[debug] Proxy map: {}
WARNING: parsing .netrc: No authenticators for youtube (None, line None)
[youtube] FW0jGHS864k: Downloading webpage
[youtube] FW0jGHS864k: Downloading video info webpage
[youtube] FW0jGHS864k: Downloading MPD manifest
[debug] Invoking downloader on 'https://r1---sn-jvhnu5g-n8vr.googlevideo.com/videoplayback?ei=Vq1oW4uoL5CigAeiyLmgBQ&lmt=1533309046512669&key=yt6&initcwndbps=1547500&ipbits=0&mv=m&source=youtube&expire=1533608374&ratebypass=yes&mt=1533586625&pl=17&itag=22&ms=au%2Conr&requiressl=yes&mime=video%2Fmp4&fvip=1&id=o-APImNmLa0-6YLq62KGNrouU4I_6-NLH3sDwCLxdQtRPb&dur=270.117&mn=sn-jvhnu5g-n8vr%2Csn-4g5ednsr&mm=31%2C26&ip=94.29.91.115&signature=E3FF340A921E62AD48889C50CF98CABB1DFA465E.3CF67B9308FA2C9F4DE5815D8693F35917E22579&c=WEB&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire'
[download] Destination: Ряженый полисмен и администрация против бабульки.Динская,будни.-FW0jGHS864k.mp4
[download]   0.1% of 77.98MiB at 332.28KiB/s ETA 04:00[download] Got server HTTP error: Downloaded 91753 bytes, expected 81772908 bytes. Retrying (attempt 1 of 10)...


ERROR: Did not get any data blocks
  File "/usr/lib/python-exec/python3.5/youtube-dl", line 11, in <module>
    load_entry_point('youtube-dl==2018.8.4', 'console_scripts', 'youtube-dl')()
  File "/usr/lib64/python3.5/site-packages/youtube_dl/__init__.py", line 472, in main
    _real_main(argv)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/__init__.py", line 462, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 2001, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 803, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 857, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 1635, in process_video_result
    self.process_info(new_info)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 1908, in process_info
    success = dl(filename, info_dict)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 1847, in dl
    return fd.download(name, info)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/downloader/common.py", line 364, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/downloader/http.py", line 342, in real_download
    return download()
  File "/usr/lib64/python3.5/site-packages/youtube_dl/downloader/http.py", line 312, in download
    self.report_error('Did not get any data blocks')
  File "/usr/lib64/python3.5/site-packages/youtube_dl/downloader/common.py", line 165, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 620, in report_error
    self.trouble(error_message, tb)
  File "/usr/lib64/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 582, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

@sambler
Copy link
Author

sambler commented Aug 7, 2018

@mzfr yes it still happens, just checked with a62460a

It is using the option --format best or ending format options with best, that causes the fail. I have it in my rcfile.

@dstftw
Copy link
Collaborator

dstftw commented Aug 7, 2018

Youtube server side fault for format 22. Nothing to do with youtube-dl.

@dstftw dstftw closed this as completed Aug 7, 2018
@dstftw dstftw added the invalid label Aug 7, 2018
@sambler
Copy link
Author

sambler commented Aug 7, 2018

@dstftw how is youtube-dl requesting a non-existent format not a youtube-dl issue?

best should be the default format but specifying best causes the download to fail, while not specifying a format works.

@VitaliiLazebnyi
Copy link

Same issue:

./youtube-dl -f best Vg45zf2b_YI
[youtube] Vg45zf2b_YI: Downloading webpage
[youtube] Vg45zf2b_YI: Downloading video info webpage
[download] Destination: Учим английский язык 5 класс. Уроки английского языка для начинающих. Урок 1 Глагол can-Vg45zf2b_YI.mp4
[download] 1.4% of 35.91MiB at 865.61KiB/s ETA 00:41[download] Got server HTTP error: Downloaded 542350 bytes, expected 37654897 bytes. Retrying (attempt 1 of 10)...

ERROR: Did not get any data blocks

Expected: To get best available format.
Actual: i have some strange error.

@Ngo-The-Trung
Copy link

Just noting that this is likely Youtube's fault - their CDN doesn't have the entire video of the default choice (likely in mp4). Videos loaded on modern browsers are webm by default.

I've tested this against the url in @VitaliyLazebny 's post above and the one URL from the first post.

Just switch to -f webm

./youtube-dl -f webm Vg45zf2b_YI

An alternative is to add some code to retry on missing content, but I think it's more trouble than it's worth, given that we can't easily anticipate whether Youtube's CDN lost their data or not.

@sambler
Copy link
Author

sambler commented Jan 1, 2019

Just noting that this is likely Youtube's fault - their CDN doesn't have the entire video of the default choice (likely in mp4). Videos loaded on modern browsers are webm by default.

@Ngo-The-Trung Your missing the point. If I just say get this video, it works. But if I give the option of wanting 720-mp4 or best available if no 720-mp4 is found - it fails. When the user specifies best available format as an option is when it fails to find the available format, but as a default option it is able to find the best available.

I have a list of formats in my rcfile, with best at the end. If I remove the rcfile I can get these videos.

@Ngo-The-Trung
Copy link

@sambler I'm saying that in some cases, it's the other way around - directly getting the video may not work, but enforcing a format does. In your case removed "best" served, but in my case adding "webm" served.

This is because the CDN doesn't have the complete file even though the video page advertised otherwise. The challenge here is that the CDN could fail to send the last byte.

The first likely solution is to retry broken downloads with a different format. I personally don't think it's an elegant solution - you could theoretically go on a retry loops for very large videos which wastes time and bandwidth.

The other solution is to put webm over mp4 as the preferred format. If it serves in a modern browser, Youtube probably sent it as webm.

@VitaliiLazebnyi
Copy link

VitaliiLazebnyi commented Jan 1, 2019

@Ngo-The-Trung
Is not "best" mean" best available"?
So if, for example, mp4 is not available then some other format becomes the best?

@Ngo-The-Trung
Copy link

@VitaliyLazebny "best" means "best advertised". If the page advertises that it has a format, the CDN can still have a broken download. i.e. the page "lies" about the format. Which is why the download starts (you can see the download progress bar) but it fails halfway through.

The only way to know is to start downloading the file, but as I said in theory the download could take you an hour only to fail at the last second. Retrying with another format isn't the most elegant solution.

@millivanilla
Copy link

I would like to suggest instead of

"ERROR: Did not get any data blocks"
the message should be

"ERROR: Did not get any data blocks (Server side youtube failure. Select another format.)"

This is a known issue and youtube-dl should mention it (otherwise people like me will keep opening Issues for it)

@dstftw
Copy link
Collaborator

dstftw commented Apr 29, 2019

This does not necessarily mean that. As for opening new issues you must use search before posting duplicates.

@ytdl-org ytdl-org locked and limited conversation to collaborators Apr 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants