hect0x7 / JMComic-Crawler-Python

Python API for JMComic | 提供Python API访问禁漫天堂,同时支持网页端和移动端 | 禁漫天堂GitHub Actions下载器🚀
https://jmcomic.readthedocs.io/zh-cn/latest/option_file_syntax/#
MIT License
852 stars 2.02k forks source link

小白想问一下,我这里显示“请求重试全部失败”是咋回事 #138

Closed zursoe closed 11 months ago

zursoe commented 1 year ago

以下是powershell返回的失败信息: `PS C:\Windows\system32> python Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import jmcomic jmcomic.download_album('285085') 2023-09-21 11:11:10:【获取禁漫URL】[https://jm365.work/3YeBdF] → [https://18-comic.work] 2023-09-21 11:11:10:【html】https://18-comic.work/album/285085 2023-09-21 11:11:10:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:10:【req.retry】次数: [1/5], 域名: [0 of ['18-comic.work']], 路径: [https://18-comic.work/album/285085], 参数: [{}] 2023-09-21 11:11:10:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:10:【req.retry】次数: [2/5], 域名: [0 of ['18-comic.work']], 路径: [https://18-comic.work/album/285085], 参数: [{}] 2023-09-21 11:11:11:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:11:【req.retry】次数: [3/5], 域名: [0 of ['18-comic.work']], 路径: [https://18-comic.work/album/285085], 参数: [{}] 2023-09-21 11:11:11:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:11:【req.retry】次数: [4/5], 域名: [0 of ['18-comic.work']], 路径: [https://18-comic.work/album/285085], 参数: [{}] 2023-09-21 11:11:11:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:11:【req.retry】次数: [5/5], 域名: [0 of ['18-comic.work']], 路径: [https://18-comic.work/album/285085], 参数: [{}] 2023-09-21 11:11:12:【req.error】Failed to perform, ErrCode: 35, Reason: 'BoringSSL SSL_connect: Connection was reset in connection to 18-comic.work:443 ' 2023-09-21 11:11:12:【req.fallback】请求重试全部失败: [https://18-comic.work/album/285085], ['18-comic.work'] 2023-09-21 11:11:12:【dler.exception】JmDownloader Exit with exception: (<class 'jmcomic.jm_config.JmcomicException'>, JmcomicException("请求重试全部失败: [https://18-comic.work/album/285085], ['18-comic.work']")) Traceback (most recent call last): File "", line 1, in File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\api.py", line 45, in download_album dler.download_album(jm_album_id) File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_downloader.py", line 73, in download_album album = client.get_album_detail(album_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\common\util\decorator_util.py", line 67, in call value = self.invoke(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\common\util\decorator_util.py", line 55, in invoke return self.func(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 181, in get_album_detail resp = self.get_jm_html(f"/album/{album_id}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 265, in get_jm_html resp = self.get(url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 28, in get return self.request_with_retry(self.postman.get, url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 81, in request_with_retry return self.request_with_retry(request, url, domain_index, retry_count + 1, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 81, in request_with_retry return self.request_with_retry(request, url, domain_index, retry_count + 1, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 81, in request_with_retry return self.request_with_retry(request, url, domain_index, retry_count + 1, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Previous line repeated 2 more times] File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 83, in request_with_retry return self.request_with_retry(request, url, domain_index + 1, 0, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 52, in request_with_retry self.fallback(request, url, domain_index, retry_count, kwargs) File "C:\Users\curdea\AppData\Local\Programs\Python\Python311\Lib\site-packages\jmcomic\jm_client_impl.py", line 152, in fallback raise JmModuleConfig.exception(msg) jmcomic.jm_config.JmcomicException: 请求重试全部失败: [https://18-comic.work/album/285085], ['18-comic.work']`

chatgpt说我可能是网络问题,但是我的网络应该没问题: PS C:\Windows\system32> Invoke-RestMethod -Uri https://ipinfo.io ip : 隐私 city : Hong Kong region : Central and Western country : HK loc : 22.2783,114.1747 org : AS41378 Kirino LLC timezone : Asia/Hong_Kong readme : https://ipinfo.io/missingauth

其它:

chrome直接打开 https://18-comic.work/album/285085 会有人机验证,验证后可以正常打开网页。

hect0x7 commented 1 year ago

可能是这个域名被墙了,你使用chrome的时候是用代理访问 18-comic.work 吧,你试试直连访问,直连访问不行就说明是被墙了。 解决方案是配置代理,或者使用直连能访问的域名

zursoe commented 1 year ago

可能是这个域名被墙了,你使用chrome的时候是用代理访问 18-comic.work 吧,你试试直连访问,直连访问不行就说明是被墙了。 解决方案是配置代理,或者使用直连能访问的域名

可是你看: PS C:\Windows\system32> Invoke-RestMethod -Uri https://ipinfo.io

ip : 193.142.147.191 city : Köln region : North Rhine-Westphalia country : DE loc : 50.9333,6.9500 org : AS208046 ColocationX Ltd. postal : 50667 timezone : Europe/Berlin readme : https://ipinfo.io/missingauth

powershell显示网络没问题

zursoe commented 1 year ago

还有一个问题就是,当我尝试使用GitHub action下载时,通过修改文件的方法修改后,action里没反应。 我是fork以后修改usage/workflow_download.py 修改后对应部分是: jm_albums = ''' 285085 ''' 修改后actions没反应

不过通过actions里面的dispatch填写id下载成功了。

hect0x7 commented 1 year ago

还有一个问题就是,当我尝试使用GitHub action下载时,通过修改文件的方法修改后,action里没反应。 我是fork以后修改usage/workflow_download.py 修改后对应部分是: jm_albums = ''' 285085 ''' 修改后actions没反应

不过通过actions里面的dispatch填写id下载成功了。

因为你改的是master,该分支不支持GitHub Actions

zursoe commented 1 year ago

搞定了,感谢,希望大佬保持更新。