auto-sign icon indicating copy to clipboard operation
auto-sign copied to clipboard

www.cpdaily.com 访问不了导致脚本失效了

Open o0oo0ooo0 opened this issue 4 years ago • 6 comments

www.cpdaily.com 访问不了导致脚本失效了

Traceback (most recent call last):

File "/opt/urllib3/util/connection.py", line 61, in create_connection

for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

File "/var/lang/python3/lib/python3.6/socket.py", line 743, in getaddrinfo

for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/urllib3/connectionpool.py", line 672, in urlopen

chunked=chunked,

File "/opt/urllib3/connectionpool.py", line 376, in _make_request

self._validate_conn(conn)

File "/opt/urllib3/connectionpool.py", line 994, in _validate_conn

conn.connect()

File "/opt/urllib3/connection.py", line 300, in connect

conn = self._new_conn()

File "/opt/urllib3/connection.py", line 169, in _new_conn

self, "Failed to establish a new connection: %s" % e

urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f88b19d3518>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/requests/adapters.py", line 449, in send

timeout=timeout

File "/opt/urllib3/connectionpool.py", line 720, in urlopen

method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

File "/opt/urllib3/util/retry.py", line 436, in increment

raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.cpdaily.com', port=443): Max retries exceeded with url: /v6/config/guest/tenant/list (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f88b19d3518>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/var/runtime/python3/bootstrap.py", line 176, in handle

ret = self.real_handler(event, context)

File "/var/user/index.py", line 323, in main_handler

raise e

File "/var/user/index.py", line 321, in main_handler

main()

File "/var/user/index.py", line 309, in main

apis = getCpdailyApis(user)

File "/var/user/index.py", line 50, in getCpdailyApis

schools = requests.get(url='https://www.cpdaily.com/v6/config/guest/tenant/list', verify=not debug).json()['data']

File "/opt/requests/api.py", line 76, in get

return request('get', url, params=params, **kwargs)

File "/opt/requests/api.py", line 61, in request

return session.request(method=method, url=url, **kwargs)

File "/opt/requests/sessions.py", line 530, in request

resp = self.send(prep, **send_kwargs)

File "/opt/requests/sessions.py", line 643, in send

r = adapter.send(request, **kwargs)

File "/opt/requests/adapters.py", line 516, in send

raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.cpdaily.com', port=443): Max retries exceeded with url: /v6/config/guest/tenant/list (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f88b19d3518>: Failed to establish a new connection: [Errno -2] Name or service not known',))

o0oo0ooo0 avatar Dec 09 '20 14:12 o0oo0ooo0

能curl -v 一下吗,主机在国外吗

ghost avatar Dec 09 '20 16:12 ghost

俺国内的机子刚刚也签到失败了,没发给我微信,具体明早在看,蹲一波大神指点迷津

ghost avatar Dec 09 '20 16:12 ghost

https://github.com/ZimoLoveShuang/auto-sign/blob/ef3f3712bb50877a8e8ba8d60bde4600d5429f0a/index.py#L50 把代码中两处的url修改一下即可

ghost avatar Dec 10 '20 00:12 ghost

或者手动添加 Hosts:

223.4.222.250 www.cpdaily.com

UMRnInside avatar Dec 10 '20 02:12 UMRnInside

https://github.com/ZimoLoveShuang/auto-sign/blob/ef3f3712bb50877a8e8ba8d60bde4600d5429f0a/index.py#L50

把代码中两处的url修改一下即可

替换后可以正常使用了,我是放在国内腾讯云函数上面的

o0oo0ooo0 avatar Dec 10 '20 03:12 o0oo0ooo0

或者手动添加 Hosts:

223.4.222.250 www.cpdaily.com

这个方法也有效果

o0oo0ooo0 avatar Dec 10 '20 03:12 o0oo0ooo0