我在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无法下载网页:(由URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]]证书验证失败:无法获取本地发行者证书(_ssl.c:1108)'))) )
我在网上搜索过,但不确定如何解决此问题?
答案 0 :(得分:9)
将no-check-certificate
参数添加到命令:
youtube-dl --no-check-certificate