52beijixing / smartedu-download

国家中小学智慧教育平台
653 stars 82 forks source link

请求下载错误 #7

Open xzdbadboy opened 4 months ago

xzdbadboy commented 4 months ago

请求过程中发生错误: HTTPSConnectionPool(host='s-file-1.ykt.cbern.com.cn', port=443): Max retries exceeded with url: /zxx/ndrv2/resources/tch_material/details/5cd7e623-5c38-4602-871a-3fba8a551db2.json (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))) 获取数据出错!

52beijixing commented 3 months ago

请求过程中发生错误: HTTPSConnectionPool(host='s-file-1.ykt.cbern.com.cn', port=443): Max retries exceeded with url: /zxx/ndrv2/resources/tch_material/details/5cd7e623-5c38-4602-871a-3fba8a551db2.json (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))) 获取数据出错!

该问题是因为SSL 证书报错,可能是由于您使用代理功能导致的,请查看您下载时是否使用了代理软件或抓包软件!

如您需要代码层面解决问题,您可以在所有request请求中增加verify=False

搜索requests.getrequests.post,在其中增加verify=False

例如: requests.get(json_url, timeout=10)修改为requests.get(json_url, timeout=10, verify=False)