问题标签 [pafy]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 询问此错误:类型错误:无法在路径组件中混合字符串和字节
在此处输入图像描述我使用 PyQt5 制作从 youtube 下载视频的下载 GUI 程序,我在代码中使用 pafy 模块,问题是当我将脚本转换为 exe 文件时出现 gui,但当我按下按钮时程序没有响应开始下载,程序没有响应并关闭,并且这个错误出现在 cmd “类型错误:不能在路径组件中混合字符串和字节”,这是我使用的代码,
我使用win10和python3.6。
错误:
python - 无法使用 Pafy/youtube_dl 初始化新 URL,我收到“错误:此视频不可用”
我正在尝试使用 pafy (0.5.4) 和 youtube_dl 从 youtube 流式传输选择视频,但无论我使用什么 url,现在都会出现不可用错误。
我的代码几周前还在工作,但是当我今天尝试它时,我收到了一个不支持 HTTP 的错误。结果,我将 youtube_dl 升级到了 20190901,尽管能够在我的浏览器中播放 youtube 链接,但现在我收到了一个源不可用错误。
这应该初始化 pafy 对象,但会返回以下错误:
“错误:此视频不可用。”
python - OpenCV HLS youtube 流在几帧后停止
我正在尝试让 Youtube 直播流与 openCV 一起使用,但在 10 帧后它只是停止并在 2 分钟后重新启动。
错误信息:
使用的代码:
python - 如何使用opencv从youtube的实时流中调整输出帧的大小
这是我开始编码和这个网站。我正在做一个项目,我想在其中使用 openCV,但我遇到了一个问题。我需要调整输出帧的大小,以识别对象。我已经读过,那个框架的尺寸应该是 416x416,但是当我试图释放框架时,它仍然是常规尺寸。这是代码:
print(img.shape)
返回正确的大小,但我认为我发布了错误的窗口。如何将此代码更改为以正确大小释放窗口?
audio - 有没有办法在 python 3.7 中使用 youtube-dl 或 pafy 库直接从 youtube 视频流式传输音频?
我不想一次又一次地从 youtube 视频下载音频,而是想流式传输音频并直接从缓冲区访问原始音频字节。换句话说,我想将原始音频字节存储在 RAM 中并在我的 python 脚本中使用它们,而不需要在系统上完全下载和保存音频文件以减少内存写入周期。youtube-dl 库或 pafy 库中是否有任何解决方法可以做同样的事情?
python - YouTube 视频下载器 python
我做了一个 youtube 视频下载管理器。它下载了一个视频,但是当我下载相同的视频时我遇到了一个问题,它不会再次下载它。我怎样才能再次下载具有相同标题的 pic.png 并发送 pic1.png。我怎样才能做到这一点?
python - YouTube-dl 已更新到最新版本。当我运行此代码时,会出现这个长长的奇怪错误
错误:无法下载网页:(由 URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)')) 追溯(最近一次通话最后一次) :文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 1317 行,在 do_open h.request(req.get_method(), req.selector, req.数据,标题,文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1230 行,在请求中 self._send_request(方法,url,正文,标题,encode_chunked ) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1276 行,_send_request self.endheaders(body, encode_chunked=encode_chunked) 文件“/Library/Frameworks /Python。framework/Versions/3.8/lib/python3.8/http/client.py”,第 1225 行,在 endheaders self._send_output(message_body, encode_chunked=encode_chunked) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib /python3.8/http/client.py”,第 1004 行,在 _send_output self.send(msg) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py” ,第 944 行,在发送 self.connect() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1399 行,在 connect self.sock = self. _context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library /Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py",第 1040 行,在 _create self.do_handshake() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py”中,第 1309 行,在 do_handshake self._sslobj.do_handshake() ssl 中。 SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):_request_webpage 中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 627 行,返回 self。 _downloader.urlopen(url_or_request) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 2238 行,在 urlopen 返回 self._opener.open( req, timeout=self._socket_timeout) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 525 行,打开响应 = self._open(req, data ) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 542 行,在 _open 结果 = self._call_chain(self.handle_open, 协议, 协议 + 文件" /库/框架/Python。framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 502 行,在 _call_chain 结果 = func(*args) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/youtube_dl/utils.py”,第 2726 行,在 https_open 返回 self.do_open(functools.partial( 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/ request.py”,第 1320 行,在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:
在处理上述异常的过程中,又出现了一个异常:
Traceback(最近一次调用最后):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 797 行,在 extract_info ie_result = ie.extract (url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 530 行,提取 ie_result = self._real_extract(url) _real_extract video_webpage = self._download_webpage(url, video_id) 文件中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 1681 行“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 791 行,在_download_webpage res = self._download_webpage_handle(文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 271 行,在 _download_webpage_handle 返回 super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/ Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 660 行,在 _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote,致命,数据=数据,标头=标头,查询=查询,预期状态=预期状态)文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py ",第 645 行,在 _request_webpage 中引发 ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError:无法下载网页:(由 URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)')) 引起
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 40 行,在 _fetch_basic self._ydl_info = ydl .extract_info(self.videoid, download=False) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 820 行,在 extract_info self. report_error(compat_str(e), e.format_traceback()) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 625 行,在 report_error self.trouble(error_message, tb) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 595 行,遇到问题引发 DownloadError(message, exc_info) youtube_dl.utils。下载错误:错误:无法下载网页:(由 URLError(SSLCertVerificationError(1,'[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书(_ssl.c:1108)')))
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“YtDow.py”,第 3 行,在 v=pafy.new(url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/pafy/pafy.py”,第 124 行,在新返回 Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/pafy/backend_youtube_dl.py”,第 31 行,在init
super(YtdlPafy, self) 中。init (*args, **kwargs) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py”,第 97 行,在init
self._fetch_basic() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 43 行,在 _fetch_basic 中引发 IOError(str(e).替换('YouTube说','Youtube说'))OSError:错误:无法下载网页:(由URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地颁发者证书(_ssl. c:1108)'))) venkatrimmalapudi@Venkats-MacBook-Air python % vi YtDow.py
venkatrimmalapudi@Venkats-MacBook-Air python % python3 YtDow.py 错误:无法下载网页:(由 URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书(_ssl.c: 1108)'))) 回溯(最近一次调用最后):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 1317 行,在 do_open h.request (req.get_method(),req.selector,req.data,标题,文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第1230行,在请求中self._send_request(method, url, body, headers, encode_chunked) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1276 行,在 _send_request self.endheaders (身体,encode_chunked=encode_chunked) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1225 行,在 endheaders self._send_output(message_body, encode_chunked=encode_chunked) 文件中“/ Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1004 行,在 _send_output self.send(msg) 文件中“/Library/Frameworks/Python.framework/Versions/3.8 /lib/python3.8/http/client.py”,第 944 行,在发送 self.connect() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py ",第 1399 行,在连接 self.sock = self._context.wrap_socket(self.sock,文件 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py",第 500 行,在 wrap_socket 返回 self.sslsocket_class._create( 文件 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py”,第 1040 行,在 _create self.do_handshake() 文件中“/Library/Frameworks/Python.framework/Versions/3.8/lib /python3.8/ssl.py",第 1309 行,在 do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):_request_webpage 中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 627 行,返回 self。 _downloader.urlopen(url_or_request) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 2238 行,在 urlopen 返回 self._opener.open( req, timeout=self._socket_timeout) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 525 行,打开响应 = self._open(req, data ) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 542 行,在 _open 结果 = self._call_chain(self.handle_open, 协议, 协议 + 文件" /库/框架/Python。framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 502 行,在 _call_chain 结果 = func(*args) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/youtube_dl/utils.py”,第 2726 行,在 https_open 返回 self.do_open(functools.partial( 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/ request.py”,第 1320 行,在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:
在处理上述异常的过程中,又出现了一个异常:
Traceback(最近一次调用最后):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 797 行,在 extract_info ie_result = ie.extract (url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 530 行,提取 ie_result = self._real_extract(url) _real_extract video_webpage = self._download_webpage(url, video_id) 文件中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 1681 行“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 791 行,在_download_webpage res = self._download_webpage_handle(文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 271 行,在 _download_webpage_handle 返回 super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/ Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 660 行,在 _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote,致命,数据=数据,标头=标头,查询=查询,预期状态=预期状态)文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py ",第 645 行,在 _request_webpage 中引发 ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError:无法下载网页:(由 URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)')) 引起
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 40 行,在 _fetch_basic self._ydl_info = ydl .extract_info(self.videoid, download=False) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 820 行,在 extract_info self. report_error(compat_str(e), e.format_traceback()) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 625 行,在 report_error self.trouble(error_message, tb) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 595 行,遇到问题引发 DownloadError(message, exc_info) youtube_dl.utils。下载错误:错误:无法下载网页:(由 URLError(SSLCertVerificationError(1,'[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书(_ssl.c:1108)')))
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“YtDow.py”,第 3 行,在 v=pafy.new(url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/pafy/pafy.py”,第 124 行,在新返回 Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/pafy/backend_youtube_dl.py”,第 31 行,在init
super(YtdlPafy, self) 中。init (*args, **kwargs) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py”,第 97 行,在init
self._fetch_basic() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 43 行,在 _fetch_basic 中引发 IOError(str(e).替换('YouTube说','Youtube说'))OSError:错误:无法下载网页:(由URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地颁发者证书(_ssl. c:1108)'))) venkatrimmalapudi@Venkats-MacBook-Air python % vi YtDow.py
venkatrimmalapudi@Venkats-MacBook-Air python % python3 YtDow.py 错误:无法下载网页:(由 URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书(_ssl.c: 1108)'))) 回溯(最近一次调用最后):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 1317 行,在 do_open h.request (req.get_method(),req.selector,req.data,标题,文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第1230行,在请求中self._send_request(method, url, body, headers, encode_chunked) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1276 行,在 _send_request self.endheaders (身体,encode_chunked=encode_chunked) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1225 行,在 endheaders self._send_output(message_body, encode_chunked=encode_chunked) 文件中“/ Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”,第 1004 行,在 _send_output self.send(msg) 文件中“/Library/Frameworks/Python.framework/Versions/3.8 /lib/python3.8/http/client.py”,第 944 行,在发送 self.connect() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py ",第 1399 行,在连接 self.sock = self._context.wrap_socket(self.sock,文件 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py",第 500 行,在 wrap_socket 返回 self.sslsocket_class._create( 文件 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py”,第 1040 行,在 _create self.do_handshake() 文件中“/Library/Frameworks/Python.framework/Versions/3.8/lib /python3.8/ssl.py",第 1309 行,在 do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):_request_webpage 中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 627 行,返回 self。 _downloader.urlopen(url_or_request) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 2238 行,在 urlopen 返回 self._opener.open( req, timeout=self._socket_timeout) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 525 行,打开响应 = self._open(req, data ) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 542 行,在 _open 结果 = self._call_chain(self.handle_open, 协议, 协议 + 文件" /库/框架/Python。framework/Versions/3.8/lib/python3.8/urllib/request.py”,第 502 行,在 _call_chain 结果 = func(*args) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/youtube_dl/utils.py”,第 2726 行,在 https_open 返回 self.do_open(functools.partial( 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/ request.py”,第 1320 行,在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:在 do_open 中引发 URLError(err) urllib.error.URLError:
在处理上述异常的过程中,又出现了一个异常:
Traceback(最近一次调用最后):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 797 行,在 extract_info ie_result = ie.extract (url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 530 行,提取 ie_result = self._real_extract(url) _real_extract video_webpage = self._download_webpage(url, video_id) 文件中的文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 1681 行“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 791 行,在_download_webpage res = self._download_webpage_handle(文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py”,第 271 行,在 _download_webpage_handle 返回 super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/ Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py”,第 660 行,在 _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote,致命,数据=数据,标头=标头,查询=查询,预期状态=预期状态)文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py ",第 645 行,在 _request_webpage 中引发 ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError:无法下载网页:(由 URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)')) 引起
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 40 行,在 _fetch_basic self._ydl_info = ydl .extract_info(self.videoid, download=False) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 820 行,在 extract_info self. report_error(compat_str(e), e.format_traceback()) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 625 行,在 report_error self.trouble(error_message, tb) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py”,第 595 行,遇到问题引发 DownloadError(message, exc_info) youtube_dl.utils。下载错误:错误:无法下载网页:(由 URLError(SSLCertVerificationError(1,'[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书(_ssl.c:1108)')))
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“YtDow.py”,第 3 行,在 v=pafy.new(url) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/pafy/pafy.py”,第 124 行,在新返回 Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3. 8/site-packages/pafy/backend_youtube_dl.py”,第 31 行,在init super(YtdlPafy, self) 中。init (*args, **kwargs) 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py”,第 97 行,在init self._fetch_basic() 文件“/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py”,第 43 行,在 _fetch_basic 中引发 IOError(str(e).替换('YouTube说','Youtube说'))OSError:错误:无法下载网页:(由URLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地颁发者证书(_ssl. c:1108)')))
python - How to use threading in a function to preventing gui from freezing?
I'm making a simple audio downloader from video,but whenever i click download button gui stops until downloading has finished. I thought i can use threading for kind of these things but almost there are hundreds of method to achieve that,but i don't know which one i should choose and that's why I'm so confused then wanted to ask you.
My code here:
Have changed the code a little and it works,thanks for everyone.