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 webpage: <urlopen _FAILED] certificate verify failed (_ssl.c:547)> #883

Closed
mevsme opened this issue Jun 11, 2013 · 16 comments
Labels
bug

Comments

@mevsme
Copy link

@mevsme mevsme commented Jun 11, 2013

What it could be? Never met this before.
picture

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jun 11, 2013

Could you paste (as text) the output when running youtube-dl -v -i {the_url}, please?

@mevsme
Copy link
Author

@mevsme mevsme commented Jun 11, 2013

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

D:\Download\VKMusic>py youtube-dl -v -i "http://www.youtube.com/watch?v=46p0_WGxJlQ"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-i', 'http://www.youtube.com/watch?v=46p0_WGxJlQ']
[debug] youtube-dl version 2013.05.23
[debug] Python version 3.3.2 - Windows-7-6.1.7600
[debug] Proxy map: {}
[youtube] Setting language
WARNING: unable to set language: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:547)>
[youtube] 46p0_WGxJlQ: Downloading video webpage
ERROR: Unable to download video webpage: <urlopen error [SSL: CERTIFICATE_VERIFY
_FAILED] certificate verify failed (_ssl.c:547)>
Traceback (most recent call last):
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1248, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1061, in request
self._send_request(method, url, body, headers)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1099, in _send_request
self.endheaders(body)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1057, in endheaders
self._send_output(message_body)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 902, in _send_output
self.send(msg)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 840, in send
self.connect()
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1202, in connect
server_hostname=server_hostname)
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 210, in wrap_socket
_context=self)
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 310, in init raise x
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 306, in init self.do_handshake()
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 513, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "youtube-dl\youtube_dl\InfoExtractors.py", line 538, in _real_extract
video_webpage_bytes = compat_urllib_request.urlopen(request).read()
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 469, in open
response = self._open(req, data)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 487, in _open
'_open', req)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 447, in _call_chain
result = func(*args)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1283, in https_open
context=self._context, check_hostname=self._check_hostname)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1251, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certifica
te verify failed (_ssl.c:547)>
Traceback (most recent call last):
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1248, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1061, in request
self._send_request(method, url, body, headers)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1099, in _send_request
self.endheaders(body)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1057, in endheaders
self._send_output(message_body)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 902, in _send_output
self.send(msg)
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 840, in send self.connect()
File "D:\Program Files (x86)\Python33\lib\http\client.py", line 1202, in connect
server_hostname=server_hostname)
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 210, in wrap_socket
_context=self)
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 310, in init raise x
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 306, in init self.do_handshake()
File "D:\Program Files (x86)\Python33\lib\ssl.py", line 513, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "youtube-dl\youtube_dl\InfoExtractors.py", line 538, in _real_extract
video_webpage_bytes = compat_urllib_request.urlopen(request).read()
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 469, in open
response = self._open(req, data)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 487, in _open
'_open', req)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 447, in _call_chain
result = func(*args)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1283, in https_open
context=self._context, check_hostname=self._check_hostname)
File "D:\Program Files (x86)\Python33\lib\urllib\request.py", line 1251, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "youtube-dl\youtube_dl\FileDownloader.py", line 462, in extract_info ie_result = ie.extract(url)
File "youtube-dl\youtube_dl\InfoExtractors.py", line 99, in extract return self._real_extract(url)
File "youtube-dl\youtube_dl\InfoExtractors.py", line 540, in _real_extract raise ExtractorError(u'Unable to download video webpage: %s' % compat_str(err))
youtube_dl.utils.ExtractorError: Unable to download video webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)>

D:\Download\VKMusic>

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jun 11, 2013

Ok, thank you, I can reproduce it in Ubuntu, but not in OSX
System:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=6R4Tb7TakRE']
[debug] youtube-dl version 2013.05.23
[debug] Git HEAD: f380401
[debug] Python version 2.7.3 - Linux-3.5.0-17-generic-x86_64-with-Ubuntu-12.10-quantal
[debug] Proxy map: {}
{the same error as above}

The test video in tests.json raise the same error, but during the test it pass, maybe because we don't build the opener during the tests : https://github.com/rg3/youtube-dl/blob/master/youtube_dl/__init__.py#L407

@mevsme To avoid getting this error you can use python 2 or pass the --no-check-certificate option to youtube-dl (you can add it to your configuration file to activate it all the times you call youtube-dl).

@mevsme
Copy link
Author

@mevsme mevsme commented Jun 14, 2013

@jaimeMF thanks, that works.

@agrberg
Copy link

@agrberg agrberg commented May 8, 2015

I'm getting this same error on OS X 10.10.3

This is the output of youtube-dl -v -i https://www.youtube.com/watch?v=6AMyFCO0K60

[debug] System config: []
[debug] User config: [u'-o', u'/Users/aaron/Downloads/%(title)s.%(ext)s']
[debug] Command-line args: [u'-v', u'-i', u'https://www.youtube.com/watch?v=6AMyFCO0K60']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.04
[debug] Python version 2.7.9 - Darwin-14.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.6.2, ffprobe 2.6.2
[debug] Proxy map: {}
[youtube] 6AMyFCO0K60: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 312, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1708, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/local/Cellar/python/2.7.9/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 720, in https_open
    req, **kwargs)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 8, 2015

@agrberg that's not an issue with youtube-dl, it's caused by the openssl installed with Homebrew. Try with the solutions listed in these comments: #5317 (comment) and #5317 (comment).

@agrberg
Copy link

@agrberg agrberg commented May 8, 2015

@jaimeMF thank you! That fixed it 👍

@kud
Copy link

@kud kud commented Jul 8, 2016

I've got this problem too but on Windows. As we don't have homebrew, how to fix it? Is it a problem with cmder?

@kud
Copy link

@kud kud commented Jul 8, 2016

Okay, --no-check-certificat makes it work. Thanks for the workaround.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 8, 2016

In general --no-check-certificate is not necessary. See #7309 for Windows users. A possible solution is at #7309 (comment)

Closing as others in this thread have solved the problem.

@yan12125 yan12125 closed this Jul 8, 2016
@alma4rebi
Copy link

@alma4rebi alma4rebi commented Mar 25, 2017

ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

@Hrxn
Copy link

@Hrxn Hrxn commented Mar 25, 2017

@alma4rebi
Copy link

@alma4rebi alma4rebi commented Mar 25, 2017

#LinuxMint + #Ubuntu

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 25, 2017

@alma4rebi First, please paste the full output of youtube-dl -v "your URL"

@alma4rebi
Copy link

@alma4rebi alma4rebi commented Mar 25, 2017

[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.03.24
[debug] Python version 2.7.12 - Linux-4.4.0-59-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 3.2.4-2, ffprobe 3.2.4-2
[debug] Proxy map: {}

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 25, 2017

This is incomplete. Need at least command line arguments, the URL and error messages.

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