2

I have been frustrated by an issue for quite a few days. After having tried all suggested solutions that I could find on the web, I have no choice but to ask for help here. I really need your suggestions. Thanks in advance!

Some information about versions of my laptop, softwares, and packages:

  • Mac OS 10.14.6 (Mojave)
  • Python 3.7.7
  • OpenSSL 1.1.1
  • Tcl/Tk 8.6
  • TLS 1.2
  • certifi 2019.11.28

I have been having difficulty downloading videos with youtube-dl package. For instance, after I execute youtube-dl https://www.youtube.com/watch?v=N1SLd93oF5w, I get the following error message:

MacBook-Pro:~ hui$ youtube-dl https://www.youtube.com/watch?v=N1SLd93oF5w
[youtube] N1SLd93oF5w: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)> (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))

It suggests that the failure has to do with certificate verification, a very common issue with Python 3. Some people have suggested running two script files: (1) Install Certificates.command; (2) Update Shell Profile.command, and many said it worked well (see Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org and https://bugs.python.org/issue29065#msg283984). In my case, however, it does not work.

Below is the error message that I got after running the Install Certificates.command file.

Last login: Tue Mar 24 17:31:27 on ttys000
/Applications/Python\ 3.7/Install\ Certificates.command ; exit;
MacBook-Pro:~ hui$ /Applications/Python\ 3.7/Install\ Certificates.command ; exit;
 -- pip install --upgrade certifi
Looking in indexes: https://pypi.python.org/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/certifi/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/certifi/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/certifi/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/certifi/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/certifi/
Could not fetch URL https://pypi.python.org/simple/certifi/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/certifi/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) - skipping
Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (2019.11.28)
 -- removing any existing file or link
 -- creating symlink to certifi certificate bundle
 -- setting permissions
 -- update complete
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Anyone can give me any suggestions to solve this problem? Thanks a lot for your attention and help!

Hui
  • 21
  • 1

0 Answers0