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

Error: ContentTooShortError #1292

Closed
AndreiArba opened this issue Aug 22, 2013 · 3 comments
Closed

Error: ContentTooShortError #1292

AndreiArba opened this issue Aug 22, 2013 · 3 comments

Comments

@AndreiArba
Copy link
Contributor

@AndreiArba AndreiArba commented Aug 22, 2013

Command:
youtube-dl -o video.mp4 -v http://www.youtube.com/watch?v=jxMHWP7I8os

Output:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-o', 'video.mp4', '-v', 'http://www.youtube.com/watch?v=qF1yaH6u5hA']
[debug] youtube-dl version 2013.08.21
[debug] Python version 2.7.3 - Linux-3.2.0-24-virtual-i686-with-Ubuntu-12.04-precise
[debug] Proxy map: {}
[youtube] Setting language
[youtube] qF1yaH6u5hA: Downloading video webpage
[youtube] qF1yaH6u5hA: Downloading video info webpage
[youtube] qF1yaH6u5hA: Extracting video information
[download] Destination: video.mp4

[download]   0.0% of 6.28MiB at 16.16KiB/s ETA 06:37
[download]   0.0% of 6.28MiB at 48.32KiB/s ETA 02:13
[download]   0.1% of 6.28MiB at 112.37KiB/s ETA 00:57
[download]   0.2% of 6.28MiB at 234.99KiB/s ETA 00:27
[download]   0.5% of 6.28MiB at 254.98KiB/s ETA 00:25
[download]   1.0% of 6.28MiB at 346.20KiB/s ETA 00:18
[download]   2.0% of 6.28MiB at 523.65KiB/s ETA 00:12
[download]   4.0% of 6.28MiB at 838.89KiB/s ETA 00:07
[download]   7.9% of 6.28MiB at  1.17MiB/s ETA 00:04
[download]  15.9% of 6.28MiB at  1.82MiB/s ETA 00:02
[download]  31.8% of 6.28MiB at  2.91MiB/s ETA 00:01
[download]  63.7% of 6.28MiB at  4.67MiB/s ETA 00:00
[download]  63.7% of 6.28MiB at  4.67MiB/s ETA 00:00
ERROR: content too short (expected 6583261 bytes and served 4195219)
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 548, in process_info
    success = self.fd._do_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/FileDownloader.py", line 547, in _do_download
    raise ContentTooShortError(byte_counter, int(data_len))
ContentTooShortError
@goodevilgenius
Copy link

@goodevilgenius goodevilgenius commented Aug 22, 2013

Likewise: youtube-dl -v --cookies=/tmp/cookies-1377198722.txt -f 18 --restrict-filenames --write-info-json -o '/home/drj/MyFiles/Videos/WebShows/YouTube/%(uploader)s/%(title)s-%(id)s.%(ext)s' http://www.youtube.com/watch?v=JK4X5aLT518

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--cookies=/tmp/cookies-1377198722.txt', '-f', '18', '--restrict-filenames', '--write-info-json', '-o', '/home/drj/MyFiles/Videos/WebShows/YouTube/%(uploader)s/%(title)s-%(id)s.%(ext)s', 'http://www.youtube.com/watch?v=JK4X5aLT518']
[debug] youtube-dl version 2013.08.17
[debug] Python version 2.7.3 - Linux-3.5.0-37-generic-x86_64-with-Ubuntu-12.10-quantal
[debug] Proxy map: {}
[youtube] Setting language
[youtube] JK4X5aLT518: Downloading video webpage
[youtube] JK4X5aLT518: Downloading video info webpage
[youtube] JK4X5aLT518: Extracting video information
[info] Video description metadata as JSON to: /home/drj/MyFiles/Videos/WebShows/YouTube/ExplosmEntertainment/Cyanide_Happiness_-_Dogs-JK4X5aLT518.mp4.info.json
[download] Destination: /home/drj/MyFiles/Videos/WebShows/YouTube/ExplosmEntertainment/Cyanide_Happiness_-_Dogs-JK4X5aLT518.mp4
[download]   0.1% of 2.53MiB at     ---b/s ETA --:--
ERROR: content too short (expected 2648708 bytes and served 1439)
Traceback (most recent call last):
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 548, in process_info
    success = self.fd._do_download(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/FileDownloader.py", line 543, in _do_download
    raise ContentTooShortError(byte_counter, int(data_len))
ContentTooShortError

And on a subsequent run:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--cookies=/tmp/cookies-1377198722.txt', '-f', '18', '--restrict-filenames', '--write-info-json', '-o', '/home/drj/MyFiles/Videos/WebShows/YouTube/%(uploader)s/%(title)s-%(id)s.%(ext)s', 'http://www.youtube.com/watch?v=JK4X5aLT518']
[debug] youtube-dl version 2013.08.17
[debug] Python version 2.7.3 - Linux-3.5.0-37-generic-x86_64-with-Ubuntu-12.10-quantal
[debug] Proxy map: {}
[youtube] Setting language
[youtube] JK4X5aLT518: Downloading video webpage
[youtube] JK4X5aLT518: Downloading video info webpage
[youtube] JK4X5aLT518: Extracting video information
[info] Video description metadata as JSON to: /home/drj/MyFiles/Videos/WebShows/YouTube/ExplosmEntertainment/Cyanide_Happiness_-_Dogs-JK4X5aLT518.mp4.info.json
[download] Resuming download at byte 1439


ERROR: Did not get any data blocks
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/bin/youtube-dl/__main__.py", line 18, in <module>
    youtube_dl.main()
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 639, in main
    _real_main(argv)
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 623, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 573, in download
    videos = self.extract_info(url)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 327, in extract_info
    return self.process_ie_result(ie_result, download=download)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 410, in process_ie_result
    for r in ie_result['entries']
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 357, in process_ie_result
    self.process_info(ie_result)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 548, in process_info
    success = self.fd._do_download(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/FileDownloader.py", line 538, in _do_download
    self.report_error(u'Did not get any data blocks')
  File "/usr/bin/youtube-dl/youtube_dl/FileDownloader.py", line 140, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 203, in report_error
    self.trouble(error_message, tb)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 170, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
@deiucanta
Copy link

@deiucanta deiucanta commented Aug 22, 2013

As I see in the Network tab from the Web Inspector, YouTube is using multiple requests to download a video. Each request has a range of bytes. Maybe YouTube is forcibly closing the connection if you don't download the video in small chunks as their player does.

@ocisly
Copy link
Contributor

@ocisly ocisly commented May 26, 2014

This seems to be a known intermittent server-side problem with YouTube which they usually resolve after a period of time, as discussed here.

@phihag flagging to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.