When using youtube-dl, you may encounter SSL certificate verification errors like the following.
WARNING: Could not send HEAD request to https://www.nicovideo.jp/watch/sm25733270: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
[generic] sm25733270: Downloading webpage
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)'),))
This article explains how to address this error.
Cause of the Error
This error occurs when SSL certificate verification fails. This can happen when the server’s SSL certificate is invalid, uses a self-signed certificate, or the local certificate store is not properly configured.
Solutions
-
Use the —no-check-certificate Option
This method ignores SSL certificate verification. This is an effective temporary solution, but use it carefully as it comes with security risks.
youtube-dl --no-check-certificate <video URL> -
Update the System Certificate Store
If your local certificate store is outdated, updating to the latest certificates may resolve the error. The specific steps vary depending on your OS.
- Windows: Run Windows Update to get the latest certificates.
- macOS: To update the system certificate store, run the
sudo softwareupdate --install-rosettacommand. - Linux: Use your distribution’s package manager to update the ca-certificates package.
-
Manually Install a Specific Certificate
You can avoid the error by manually installing a trusted specific certificate. The specific steps vary depending on the certificate type and installation environment.
Reference Links
For more detailed information and other solutions, also refer to the related GitHub thread.