youtube-dl: SSL certificate verify failed
#4807 was diagnosed on FreeBSD. As suggested, I’m reporting the same issue on ArchLinux.
However, I’ve installed youtube-dl through nix, you may want to investigate as if I were running NixOS.
Cc @jaimeMF .
Here is the verbose output:
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--no-check-certificate', 'https://www.youtube.com/watch?v=pKzhNZGG1AM']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.01.25
[debug] Python version 2.7.9 - Linux-3.18.2-2-ARCH-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 2.5.3, ffprobe 2.5.3, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] pKzhNZGG1AM: 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 "/home/koral/.nix-profile/bin/youtube-dl/youtube_dl/extractor/common.py", line 299, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/home/koral/.nix-profile/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1571, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/nix/store/g4zbmgjdg7nd0z1cf3ixas6rxp874zlh-python-2.7.9/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/nix/store/g4zbmgjdg7nd0z1cf3ixas6rxp874zlh-python-2.7.9/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/nix/store/g4zbmgjdg7nd0z1cf3ixas6rxp874zlh-python-2.7.9/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/home/koral/.nix-profile/bin/youtube-dl/youtube_dl/utils.py", line 659, in https_open
req)
File "/nix/store/g4zbmgjdg7nd0z1cf3ixas6rxp874zlh-python-2.7.9/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (1 by maintainers)
Did you try using ‘–no-check-certificate’ as a temporary workaround?
FYI - to fix this please see https://stackoverflow.com/a/42334357/1896134
This seems to be a problem for 3.6 & 3.7 details listed in the SO answer.
In short, try this
pip3 install certifiThen/Applications/Python\ 3.7/Install\ Certificates.commandYour
terminalshould look something like this:After installing python3 and python 2 with nix (on OSX), with the latest version of youtube-dl
--no-check-certificateseems to be fixed. If you set and export the variableSSL_CERT_FILEto the path of your CA bundle (if you installed the cacert package, you can use~/.nix-profile/etc/ca-bundle.crt), the CA certificates are properly loaded and--no-check-certificateis not needed.I’ve encountered the same problem. Installed youtube-dl with
pip3 install youtube-dlThen got the error when I did : sudo youtube-dl [URL]
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)> (caused by URLError(SSLError [3] Exit 1 sudo youtube-dl https://www.youtube.com/watch?v=19ecwVEvI-0Fixing the command to
sudo youtube-dl --no-check-certificate https://www.youtube.com/watch?v=19ecwVEvI-0&feature=youtu.be&app=desktopsolved my problem. I was running the code on Mac OStysm this helped me