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

DailyMotion : <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)> #10574

Closed
RingoTheDog opened this issue Sep 6, 2016 · 6 comments

Comments

@RingoTheDog
Copy link

@RingoTheDog RingoTheDog commented Sep 6, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.09.04.1. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.09.04.1

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

URL: http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle



C:\>youtube-dl.py -v "http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.09.04.1
[debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] xnipke: Downloading webpage
[dailymotion] xnipke: Downloading m3u8 information
[debug] Invoking downloader on 'https://www.dailymotion.com/cdn/H264-512x384/video/xnipke.mp4?auth=1473351352-2562-nadhmusx-e79beba40c902ef19d75bb097f615d2
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>
Traceback (most recent call last):
  File "C:\Program Files\Python35\lib\urllib\request.py", line 1240, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "C:\Program Files\Python35\lib\http\client.py", line 1083, in request
    self._send_request(method, url, body, headers)
  File "C:\Program Files\Python35\lib\http\client.py", line 1128, in _send_request
    self.endheaders(body)
  File "C:\Program Files\Python35\lib\http\client.py", line 1079, in endheaders
    self._send_output(message_body)
  File "C:\Program Files\Python35\lib\http\client.py", line 911, in _send_output
    self.send(msg)
  File "C:\Program Files\Python35\lib\http\client.py", line 854, in send
    self.connect()
  File "C:\Program Files\Python35\lib\http\client.py", line 1237, in connect
    server_hostname=server_hostname)
  File "C:\Program Files\Python35\lib\ssl.py", line 376, in wrap_socket
    _context=self)
  File "C:\Program Files\Python35\lib\ssl.py", line 747, in __init__
    self.do_handshake()
  File "C:\Program Files\Python35\lib\ssl.py", line 983, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Program Files\Python35\lib\ssl.py", line 628, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1696, in process_info
    success = dl(filename, info_dict)
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1638, in dl
    return fd.download(name, info)
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\common.py", line 354, in download
    return self.real_download(filename, info_dict)
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\http.py", line 58, in real_download
    data = self.ydl.urlopen(request)
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1998, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 471, in open
    response = meth(req, response)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 581, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 503, in error
    result = self._call_chain(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
    result = func(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 686, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 465, in open
    response = self._open(req, data)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 483, in _open
    '_open', req)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
    result = func(*args)
  File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\utils.py", line 1004, in https_open
    req, **kwargs)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 1242, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>



---

Thanks
Ringo....
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 7, 2016

Could you visit https://www.dailymotion.com/ in Internet Explorer and try again?

@RingoTheDog
Copy link
Author

@RingoTheDog RingoTheDog commented Sep 7, 2016

Same Result after opening in IE (with python 3.5.1)...BUT I discovered it does work correctly with Python 2.7.5

**
C:>youtube-dl.py -v "http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.09.04.1
[debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] xnipke: Downloading webpage
[dailymotion] xnipke: Downloading m3u8 information
[debug] Invoking downloader on 'https://www.dailymotion.com/cdn/H264-512x384/video/xnipke.mp4?auth=1473441348-2562-v23gq8r0-0e3a3fb7679e783d3a0ffc8bd9b48e64
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\urllib\request.py", line 1240, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "C:\Program Files\Python35\lib\http\client.py", line 1083, in request
self._send_request(method, url, body, headers)
File "C:\Program Files\Python35\lib\http\client.py", line 1128, in _send_request
self.endheaders(body)
File "C:\Program Files\Python35\lib\http\client.py", line 1079, in endheaders
self._send_output(message_body)
File "C:\Program Files\Python35\lib\http\client.py", line 911, in _send_output
self.send(msg)
File "C:\Program Files\Python35\lib\http\client.py", line 854, in send
self.connect()
File "C:\Program Files\Python35\lib\http\client.py", line 1237, in connect
server_hostname=server_hostname)
File "C:\Program Files\Python35\lib\ssl.py", line 376, in wrap_socket
_context=self)
File "C:\Program Files\Python35\lib\ssl.py", line 747, in init
self.do_handshake()
File "C:\Program Files\Python35\lib\ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "C:\Program Files\Python35\lib\ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1696, in process_info
success = dl(filename, info_dict)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1638, in dl
return fd.download(name, info)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\common.py", line 354, in download
return self.real_download(filename, info_dict)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\http.py", line 58, in real_download
data = self.ydl.urlopen(request)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1998, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "C:\Program Files\Python35\lib\urllib\request.py", line 471, in open
response = meth(req, response)
File "C:\Program Files\Python35\lib\urllib\request.py", line 581, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python35\lib\urllib\request.py", line 503, in error
result = self._call_chain(_args)
File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
result = func(_args)
File "C:\Program Files\Python35\lib\urllib\request.py", line 686, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Program Files\Python35\lib\urllib\request.py", line 465, in open
response = self._open(req, data)
File "C:\Program Files\Python35\lib\urllib\request.py", line 483, in _open
'_open', req)
File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
result = func(_args)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\utils.py", line 1004, in https_open
req, *_kwargs)
File "C:\Program Files\Python35\lib\urllib\request.py", line 1242, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>

C:>"C:\Program Files\Internet Explorer\iexplore.exe" "http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle"

C:>youtube-dl.py -v "http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.09.04.1
[debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] xnipke: Downloading webpage
[dailymotion] xnipke: Downloading m3u8 information
[debug] Invoking downloader on 'https://www.dailymotion.com/cdn/H264-512x384/video/xnipke.mp4?auth=1473441391-2562-3tx2l62p-b8b78508d85c682a56624b2e162540ea
ERROR: unable to download video data: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\urllib\request.py", line 1240, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "C:\Program Files\Python35\lib\http\client.py", line 1083, in request
self._send_request(method, url, body, headers)
File "C:\Program Files\Python35\lib\http\client.py", line 1128, in _send_request
self.endheaders(body)
File "C:\Program Files\Python35\lib\http\client.py", line 1079, in endheaders
self._send_output(message_body)
File "C:\Program Files\Python35\lib\http\client.py", line 911, in _send_output
self.send(msg)
File "C:\Program Files\Python35\lib\http\client.py", line 854, in send
self.connect()
File "C:\Program Files\Python35\lib\http\client.py", line 1237, in connect
server_hostname=server_hostname)
File "C:\Program Files\Python35\lib\ssl.py", line 376, in wrap_socket
_context=self)
File "C:\Program Files\Python35\lib\ssl.py", line 747, in init
self.do_handshake()
File "C:\Program Files\Python35\lib\ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "C:\Program Files\Python35\lib\ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1696, in process_info
success = dl(filename, info_dict)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1638, in dl
return fd.download(name, info)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\common.py", line 354, in download
return self.real_download(filename, info_dict)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\downloader\http.py", line 58, in real_download
data = self.ydl.urlopen(request)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1998, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "C:\Program Files\Python35\lib\urllib\request.py", line 471, in open
response = meth(req, response)
File "C:\Program Files\Python35\lib\urllib\request.py", line 581, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python35\lib\urllib\request.py", line 503, in error
result = self._call_chain(_args)
File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
result = func(_args)
File "C:\Program Files\Python35\lib\urllib\request.py", line 686, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Program Files\Python35\lib\urllib\request.py", line 465, in open
response = self._open(req, data)
File "C:\Program Files\Python35\lib\urllib\request.py", line 483, in _open
'_open', req)
File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
result = func(_args)
File "C:\TRANSMOGRIFIER\youtube-dl.py\youtube_dl\utils.py", line 1004, in https_open
req, *_kwargs)
File "C:\Program Files\Python35\lib\urllib\request.py", line 1242, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>

**

This time with Python 2.7.5 it does work (I did not have to first open in IE)

youtube-dl.py -v "http://www.dailymotion.com/video/xnipke_hidd
en-victims-of-mental-illness_lifestyle"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.dailymotion.com/video/xnipke_hid
den-victims-of-mental-illness_lifestyle']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.09.04.1
[debug] Python version 2.7.5 - Windows-2008ServerR2-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] xnipke: Downloading webpage
[dailymotion] xnipke: Downloading m3u8 information
[debug] Invoking downloader on u'https://www.dailymotion.com/cdn/H264-512x384/vi
deo/xnipke.mp4?auth=1473441574-2562-ghbj9ota-2e82344d0312645254969ea2d64fd433'
[download] Destination: Hidden Victims of Mental Illness-xnipke.mp4
[download] 100% of 45.35MiB in 11:06

Thanks
Ringo

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 7, 2016

Python < 2.7.9 does not verify SSL certificates, so it's just OK.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 7, 2016

Possibly a duplicate of #7309. Could you check whether there are expired certificates in Windows Certificate Store? See #7309 (comment) for detailed steps. DailyMotion uses certificates from DigiCert company:

 0 s:/C=FR/ST=Ile-de-France/L=Paris/O=Dailymotion SA/CN=*.dailymotion.com
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
 1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
@RingoTheDog
Copy link
Author

@RingoTheDog RingoTheDog commented Sep 7, 2016

You are on the right track....
I can't find any expired certificates:
digicert

...but #7309 mentioned the --no-check-certificate flag...that DOES work (with 3.5.1):
C:>youtube-dl.py --no-check-certificate -v "http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--no-check-certificate', '-v', 'http://www.dailymotion.com/video/xnipke_hidden-victims-of-mental-illness_lifestyle']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.09.04.1
[debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] xnipke: Downloading webpage
[dailymotion] xnipke: Downloading m3u8 information
[debug] Invoking downloader on 'https://www.dailymotion.com/cdn/H264-512x384/video/xnipke.mp4?auth=1473445291-2562-vbagh945-0ed51a00184bd09a8f30198692d17033'
[download] Destination: Hidden Victims of Mental Illness-xnipke.mp4
[download] 100% of 45.35MiB in 19:28

@wernight
Copy link

@wernight wernight commented Sep 24, 2016

Having the same issue here running on Linux with ca-certificates installed.

Workaround include changing config, see https://access.redhat.com/articles/2039753.

The real fix for me was setting environment variable: SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

I'd suggest to use "requests" instead if possible, see https://github.com/lepture/flask-oauthlib/issues/200

You may also use my Dockerized youtube-dl: wernight/youtube-dl.

@ytdl-org ytdl-org deleted a comment from th0rgall Mar 2, 2019
@ytdl-org ytdl-org locked and limited conversation to collaborators Mar 2, 2019
@dstftw dstftw closed this Mar 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.