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

Downloading audio from youtube video fails with timeout, no retries #25183

Closed
salty-horse opened this issue May 7, 2020 · 1 comment
Closed

Downloading audio from youtube video fails with timeout, no retries #25183

salty-horse opened this issue May 7, 2020 · 1 comment
Labels

Comments

@salty-horse
Copy link
Contributor

@salty-horse salty-horse commented May 7, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.05.03
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-x', u'https://www.youtube.com/watch?v=i4-Wiokzhik']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.05.03
[debug] Git HEAD: 00a41ca4c
[debug] Python version 2.7.18rc1 (CPython) - Linux-5.4.0-29-generic-x86_64-with-Ubuntu-20.04-focal
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] i4-Wiokzhik: Downloading webpage
[youtube] i4-Wiokzhik: Downloading MPD manifest
[debug] Invoking downloader on u'https://manifest.googlevideo.com/api/manifest/dash/expire/1588906400/ei/QHW0XsrVDuKFmLAPmZKu2AI/ip/79.176.45.56/id/8b8f968a89338629/source/youtube/requiressl/yes/playback_host/r6---sn-cx1x9-ua8d.googlevideo.com/mh/Wp/mm/31%2C29/mn/sn-cx1x9-ua8d%2Csn-hgn7yn7z/ms/au%2Crdu/mv/m/mvi/5/pl/24/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/942500/vprv/1/mt/1588884698/fvip/5/keepalive/yes/beids/9466585/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/AJpPlLswRQIhAP1jQ8gvWUySBFu3uIndQ-64Y_w6KO0-hgHZquke2Yg1AiBIWTra-q_Vs20MsVGvS7Lf4IcRVrc85vjsdvi8nw1FDg%3D%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/ALrAebAwRAIgThEacIy1KFGnamCqsfO9euu5JUR11yrtQRVE7YNhSpECIGtcQSbCSwjSjDG_iNC3jaNFveVBtsE6lbVlXoUsG71U'
[dashsegments] Total fragments: 414
[download] Destination: Game Center Live, May 7 2020 - student streams + game industry news roundup with Naomi Clark and Fran-i4-Wiokzhik.webm
[download]  10.1% of ~67.99MiB at  4.91MiB/s ETA 00:40ERROR: unable to download video data: <urlopen error [Errno 110] Connection timed out>
Traceback (most recent call last):
  File "/path/to/youtube-dl/youtube_dl/YoutubeDL.py", line 1926, in process_info
    success = dl(filename, info_dict)
  File "/path/to/youtube-dl/youtube_dl/YoutubeDL.py", line 1865, in dl
    return fd.download(name, info)
  File "/path/to/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/path/to/youtube-dl/youtube_dl/downloader/dash.py", line 48, in real_download
    success, frag_content = self._download_fragment(ctx, fragment_url, info_dict)
  File "/path/to/youtube-dl/youtube_dl/downloader/fragment.py", line 102, in _download_fragment
    'http_headers': headers or info_dict.get('http_headers'),
  File "/path/to/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/path/to/youtube-dl/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/path/to/youtube-dl/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/path/to/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/path/to/youtube-dl/youtube_dl/utils.py", line 2728, in https_open
    req, **kwargs)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 110] Connection timed out>

Description

When downloading the audio (with flag -x) of youtube videos, sometimes the download freezes after advancing by a few percentages, until it times out, ignoring any settings in --retries and --fragment-retries (it ignored my requests for infinite). Instead of waiting for the timeout to occur (in the above log it froze for several minutes at 10.1%), I resort to Ctrl-C-ing and rerunning the command, letting it advance until it freeze, and running it again.

In a recent attempt to download, youtube-dl tries to download the mp4 file when it froze.
However, in one of my attempts to rerun the command, youtube-dl suddenly decided to download a webm file, which went without a hitch. Is this because youtube suddenly made available a different audio format? I didn't run --list-formats before and after to verify.

There are several issues as I see it:

  1. youtube-dl doesn't seem to retry the download, and I have to resort to doing manually.
  2. Is it possible to detect this "problematic" state and fall back to download a different format?
@dstftw dstftw closed this May 7, 2020
@dstftw dstftw added the duplicate label May 7, 2020
@salty-horse
Copy link
Contributor Author

@salty-horse salty-horse commented May 8, 2020

Sorry, of which bug is this a duplicate? I didn't find anything suitable.

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
2 participants
You can’t perform that action at this time.