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

Download of youtube audios sometimes aborts with "ERROR: unable to download video data: <urlopen error [Errno 0] Error>" #23782

Open
Eucyon opened this issue Jan 19, 2020 · 5 comments

Comments

@Eucyon
Copy link

@Eucyon Eucyon commented Jan 19, 2020

In maybe 10% of the cases, youtube-dl aborts after starting downloading audios from youtube without a really informative error message:

$ sudo youtube-dl -U
[sudo] Passwort für xy: 
Updating to version 2020.01.15 ...
Updated youtube-dl. Restart youtube-dl to use the new version.}
$ youtube-dl -v https://www.youtube.com/watch?v=ecocA1DwLn4
[debug] System config: []
[debug] User config: ['-f', 'bestaudio', '--no-mtime', '-R', 'infinite', '--fragment-retries', 'infinite', '-o', '~/Downloads/%(uploader)s: %(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=ecocA1DwLn4']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.01.15
[debug] Python version 3.8.1 (CPython) - Linux-5.4.12-zen1-1-zen-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] ecocA1DwLn4: Downloading webpage
[youtube] ecocA1DwLn4: Downloading video info webpage
[youtube] ecocA1DwLn4: Downloading MPD manifest
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1579471899/ei/u38kXpWADcaA1gKL35vADg/ip/92.201.46.203/id/79ca1c0350f02e7e/source/youtube/requiressl/yes/playback_host/r1---sn-9nj-q0nl.googlevideo.com/mm/31%2C29/mn/sn-9nj-q0nl%2Csn-4g5ednls/ms/au%2Crdu/mv/m/mvi/0/pl/17/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/1138750/vprv/1/mt/1579450186/fvip/4/fexp/23842630/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/ALgxI2wwRAIgawFcXR_4Wm0B1iHObzJ19z2Iq03u40Y57Y-wk2r6xMQCIFebuHNTapLeEwF4sw1YZI4VBNyDytuupLDAv0CW12bW/lsparams/playback_host%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AHylml4wRAIgN1qgOzuAa3yGBnRdC7yPng3pxTVcIgtFcLxMUth5IwQCICQP0Xv4o6ei_IYugTgzBa-y0dYBED6mkMKoA0PiHcvx'
[dashsegments] Total fragments: 349
[download] Destination: /home/a/Downloads/MEDIENTAGE MÜNCHEN: Audio-Summit - Künstliche Intelligenz, Daten, Algorithmen _ MEDIENTAGE MÜNCHEN.webm
[download]  16.6% of ~47.12MiB at  1.41MiB/s ETA 01:07ERROR: unable to download video data: <urlopen error [Errno 0] Error>
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1319, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1230, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1276, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1225, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1004, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 944, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1399, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1925, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1864, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/dash.py", line 48, in real_download
    success, frag_content = self._download_fragment(ctx, fragment_url, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/fragment.py", line 100, in _download_fragment
    success = ctx['dl'].download(fragment_filename, {
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 2726, in https_open
    return self.do_open(functools.partial(
  File "/usr/lib/python3.8/urllib/request.py", line 1322, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 0] Error>

Thank you!

@Cathy-t
Copy link

@Cathy-t Cathy-t commented Jan 21, 2020

The same problem with you.Do you fix it ?
I find if the video is too long , the problem comes.

@Eucyon
Copy link
Author

@Eucyon Eucyon commented Jan 21, 2020

Dear @Cathy-t ,

I have no workaround.

I simply restart the download by repeating the same command, and the download continues.

@VaslD VaslD mentioned this issue Feb 29, 2020
5 of 6 tasks complete
@gatusokaka
Copy link

@gatusokaka gatusokaka commented Apr 13, 2020

The same problem with you.Do you fix it ?
I find if the video is too long , the problem comes.

the video is short,the problem comes forever,sigh

@Eucyon
Copy link
Author

@Eucyon Eucyon commented Apr 13, 2020

Maybe this information is helpful: This problem seems to occur only for yt-video which have been rarely viewed or downloaded (ca. < 50 times).

@gatusokaka
Copy link

@gatusokaka gatusokaka commented Apr 13, 2020

Maybe this information is helpful: This problem seems to occur only for yt-video which have been rarely viewed or downloaded (ca. < 50 times).

but the problem comes every videos downloaded by youtube-dl .you can check the debug infomation at https://www.reddit.com/r/youtubedl/comments/fx84wp/how_to_fix_the_error/
can you help me,thanks a lot.

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