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: unable to download video data: <urlopen error EOF occurred in violation of protocol (_ssl.c:777)> #14521

Closed
yuhaiqun opened this issue Oct 17, 2017 · 8 comments

Comments

@yuhaiqun
Copy link

@yuhaiqun yuhaiqun commented Oct 17, 2017

python 3.6.3
youtube-dl 2017.10.12
[youtube] VKMWqOfbGME: Skipping DASH manifest: ExtractorError("Failed to download MPD manifest: <urlopen error EOF occurred in violation of protocol (_ssl.c:777)> (caused by URLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),))",)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 18, 2017

This is most likely caused by unstable networks. The problem should go away if you try again. If not, please paste full output of youtube-dl -v 1280x720.

@lookis
Copy link

@lookis lookis commented Jan 30, 2018

I have got same problem
version: 2018.01.27
logs:

ERROR: Unable to download webpage: <urlopen error EOF occurred in violation of protocol (_ssl.c:590)> (caused by URLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 517, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2198, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1089, in https_open
    req, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)

and

ERROR: unable to download video data: <urlopen error EOF occurred in violation of protocol (_ssl.c:590)>
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1895, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1834, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 361, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 286, in real_download
    establish_connection()
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 74, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2198, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1089, in https_open
    req, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:590)>

I think when i use -i to ignore error, youtube-dl should continue download rest file rather than exit

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 30, 2018

@lookis: The error indicates youtube-dl can't access the URL you provided at all, so -i won't help. Most likely this is due to unstable network.

A possible workaround is forcing a specific TLS version: #4578 (comment)

@yan12125 yan12125 closed this Jan 30, 2018
@Tankamin
Copy link

@Tankamin Tankamin commented Oct 1, 2018

After 32 videos, i get this also: ERROR: unable to download video data: <urlopen error EOF occurred in violation of protocol (_ssl.c:600)>

Using windows... another download gave the same error after 101 videos.. :( What does this mean?

Can i resume or skip over the downloaded videos already if i didn't use the filename option? if so, how? Thanks.

@NightMachinary
Copy link

@NightMachinary NightMachinary commented May 20, 2019

My network connection has severely deteriorated this week (under 1mbps download bandwidth), and I have started to get this error. I think this is a bug? It should work with "bad" connections, too, as youtube-dl is indeed most useful in exactly these kinds of networks (that don't let you stream at all). I'm going to try TLS patch, but if that actually helps, then it needs to become a commandline option.

@NightMachinary
Copy link

@NightMachinary NightMachinary commented May 20, 2019

I tried changing this in utils.py:



def make_HTTPS_handler(params, **kwargs):
    opts_no_check_certificate = params.get('nocheckcertificate', False)
    if hasattr(ssl, 'create_default_context'):  # Python >= 3.4 or 2.7.9
        # context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)

        context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
        context.verify_mode = (ssl.CERT_NONE
                               if opts_no_check_certificate
                               else ssl.CERT_REQUIRED)
        context.set_default_verify_paths()
        # if opts_no_check_certificate:
        #     context.check_hostname = False
        #     context.verify_mode = ssl.CERT_NONE
        try:
            print('hi :()')
            return YoutubeDLHTTPSHandler(params, context=context, **kwargs)
        except TypeError:
            # Python 2.7.8
            # (create_default_context present but HTTPSHandler has no context=)
            pass

    if sys.version_info < (3, 2):
        return YoutubeDLHTTPSHandler(params, **kwargs)
    else:  # Python < 3.4
        context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
        context.verify_mode = (ssl.CERT_NONE
                               if opts_no_check_certificate
                               else ssl.CERT_REQUIRED)
        context.set_default_verify_paths()
        return YoutubeDLHTTPSHandler(params, context=context, **kwargs)


But no luck. Still:

youtube-dl --ignore-config -v https://www.youtube.com/watch\?v\=qI_g07C_Q5I
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', '-v', 'https://www.youtube.com/watch?v=qI_g07C_Q5I']
hi :()
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.05.11
[debug] Python version 3.6.4 (CPython) - Darwin-18.2.0-x86_64-i386-64bit
[debug] exe versions: avconv present, avprobe present, ffmpeg 4.1, ffprobe 4.1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] qI_g07C_Q5I: Downloading webpage
ERROR: Unable to download webpage: <urlopen error EOF occurred in violation of protocol (_ssl.c:777)> (caused by URLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),))
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 626, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2227, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/Users/evar/anaconda/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/Users/evar/anaconda/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/Users/evar/anaconda/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/utils.py", line 1147, in https_open
    req, **kwargs)
  File "/Users/evar/anaconda/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
@zzapper
Copy link

@zzapper zzapper commented Mar 10, 2020

I had this problem
ERROR: unable to download video data: <urlopen error [Errno 101] Network is unreachable>
When I eventually tried downloading a different video it was ok

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