Pytube中的错误< urlopen错误[SSL:cetide_verify_failed]证书验证失败:无法获得本地发行者证书(_SSL.C:997)>

发布于 2025-01-30 13:31:15 字数 351 浏览 2 评论 0原文

代码:

from pytube import Playlist
playlist = Playlist('https://www.youtube.com/playlist?list=PLWPirh4EWFpEpO6NjjWLbKSCb-wx3hMql')

for video in playlist.videos:
    print("Video: ",video)
    video.streams.get_highest_resolution().download()

错误我得到:

Code:

from pytube import Playlist
playlist = Playlist('https://www.youtube.com/playlist?list=PLWPirh4EWFpEpO6NjjWLbKSCb-wx3hMql')

for video in playlist.videos:
    print("Video: ",video)
    video.streams.get_highest_resolution().download()

Error I am getting:

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

皓月长歌 2025-02-06 13:31:15

(对于OSX用户)
换句话说...

  1. 转到您的应用程序文件夹,然后查找Python文件夹。我的说“ python 3.11”
  2. 打开该目录,有一个名为“ install culterutates.command”的文件。
  3. 打开该文件,它将运行命令。

(for OSX users)
In another words...

  1. Go to your applications folder and look for Python folder. Mine says "Python 3.11"
  2. Open that directory, there is a file called "Install Certificates.command".
  3. Open that file and it will run the command.
祁梦 2025-02-06 13:31:15
# Solved in 
# add
import ssl
ssl._create_default_https_context = ssl._create_stdlib_context
# Solved in 
# add
import ssl
ssl._create_default_https_context = ssl._create_stdlib_context
み格子的夏天 2025-02-06 13:31:15

转到 /applications/python3.x并运行'install cultectates.command'

Go to /Applications/Python3.x and run 'Install Certificates.command'

他不在意 2025-02-06 13:31:15

为我工作,您必须转到目录/applications/python3.x,然后运行sudo sh ./install \ certifates.command

Worked for me, You have to go to directory /Applications/Python3.x and then run sudo sh ./Install\ Certificates.command

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文