LifeActor / ykdl

a video downloader focus on China mainland video sites.(一款专注于中国大陆视频网站的视频下载器。)
https://github.com/LifeActor/ykdl
Other
1.45k stars 285 forks source link

WARNING:YKDL:Please install or update Certifi, and try again: #605

Closed Ilikeyou3000 closed 2 years ago

Ilikeyou3000 commented 2 years ago
WARNING:YKDL:Please install or update Certifi, and try again:
pip3 install certifi --upgrade

在服务器的docker里面,运行会报certifi的问题,按照命令安装后更新后还是有同样的问题。萌新不太清楚问题在什么地方

Ilikeyou3000 commented 2 years ago
DEBUG:ykdl.util.http:Add <urllib.request.HTTPSHandler object at 0x7fec442defd0> to default handlers
DEBUG:ykdl.util.http:Add <urllib.request.ProxyHandler object at 0x7fec442e4080> to default handlers
DEBUG:ykdl.common:host> www.bilibili.com
DEBUG:ykdl.common:short_name> bilibili
DEBUG:ykdl.util.http:Add <urllib.request.HTTPCookieProcessor object at 0x7fec442e4438> to default handlers
DEBUG:ykdl.util.http:get_response> URL: https://api.bilibili.com/x/web-interface/view?bvid=BV11441157z8
DEBUG:ykdl.util.http:get_response> URL: https://www.bilibili.com/video/BV11441157z8
DEBUG:YKDL:<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)>
Traceback (most recent call last):
  File "/conda/envs/faiss-gpu/lib/python3.7/site-packages/ykdl/util/http.py", line 123, in _do_open
    **req_args)
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/conda/envs/faiss-gpu/lib/python3.7/http/client.py", line 1392, in connect
    server_hostname=server_hostname)
  File "/conda/envs/faiss-gpu/lib/python3.7/ssl.py", line 412, in wrap_socket
    session=session
  File "/conda/envs/faiss-gpu/lib/python3.7/ssl.py", line 850, in _create
    self.do_handshake()
  File "/conda/envs/faiss-gpu/lib/python3.7/ssl.py", line 1108, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)

debug模式下是这样报的。

SeaHOH commented 2 years ago

不清楚 docker 的工作方式,但 YKDL 加载证书前会先验证文件或目录是否存在。 你运行以下 Python 脚本,看看是什么结果:

import os, certifi
print(os.stat(certifi.where()))