Youtubedl证书\u验证\u失败

2024-04-28 11:25:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我用Python运行了以下代码:

from __future__ import unicode_literals
import youtube_dl


ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['YOUTUBE URL'])

我希望它能将Youtube视频转换成URL文件

我犯了一个很长的错误,基本上重复了这一点:

[0;31mERROR:[0m Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

我在网上搜索过,但不确定如何解决这个问题


Tags: to代码fromimportformaturlyoutubedownload