ERROR: unable to download video data: <urlopen error EOF occurred in violation of protocol (_ssl.c:777)> #12002

Closed
opened 2026-02-21 05:10:42 -05:00 by deekerman · 8 comments
Owner

Originally created by @yuhaiqun on GitHub (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)'),))",)

Originally created by @yuhaiqun on GitHub (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)'),))",)
deekerman 2026-02-21 05:10:42 -05:00
Author
Owner

@yan12125 commented on GitHub (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.

@yan12125 commented on GitHub (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```.
Author
Owner

@lookis commented on GitHub (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

@lookis commented on GitHub (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
Author
Owner

@yan12125 commented on GitHub (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: https://github.com/rg3/youtube-dl/issues/4578#issuecomment-233425685

@yan12125 commented on GitHub (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: https://github.com/rg3/youtube-dl/issues/4578#issuecomment-233425685
Author
Owner

@Tankamin commented on GitHub (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.

@Tankamin commented on GitHub (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.
Author
Owner

@NightMachinery commented on GitHub (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.

@NightMachinery commented on GitHub (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.
Author
Owner

@NightMachinery commented on GitHub (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)
@NightMachinery commented on GitHub (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) ```
Author
Owner

@NightMachinery commented on GitHub (May 20, 2019):

This SO question suggests using pycurl as a workaround to this issue:

https://stackoverflow.com/questions/48112400/requests-ssl-ssleoferror-eof-occurred-in-violation-of-protocol-ssl-c777

@NightMachinery commented on GitHub (May 20, 2019): This SO question suggests using pycurl as a workaround to this issue: https://stackoverflow.com/questions/48112400/requests-ssl-ssleoferror-eof-occurred-in-violation-of-protocol-ssl-c777
Author
Owner

@zzapper commented on GitHub (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

@zzapper commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#12002
No description provided.