作者大大,这个问题怎么解决啊
`
Run python main.py
2021-10-03 02:43:11,385 - INFO - 开始签到第0个用户***
2021-10-03 02:43:11,385 - INFO - 获取tbs开始
Traceback (most recent call last):
File "main.py", line 54, in get_tbs
tbs = s.get(url=TBS_URL, headers=headers, timeout=5).json()[TBS]
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
chunked=chunked,
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, httplib_request_kw)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1291, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1332, in _send_request
self.putheader(hdr, value)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connection.py", line 224, in putheader
_HTTPConnection.putheader(self, header, values)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1269, in putheader
raise ValueError('Invalid header value %r' % (values[i],))
ValueError: Invalid header value b'BDUSS=\n'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 188, in
main()
File "main.py", line 178, in main
tbs = get_tbs(i)
File "main.py", line 56, in get_tbs
logger.error("获取tbs出错" + e)
TypeError: must be str, not ValueError
Error: Process completed with exit code 1.
`
作者大大,这个问题怎么解决啊
`
Run python main.py
2021-10-03 02:43:11,385 - INFO - 开始签到第0个用户***
2021-10-03 02:43:11,385 - INFO - 获取tbs开始
Traceback (most recent call last):
File "main.py", line 54, in get_tbs
tbs = s.get(url=TBS_URL, headers=headers, timeout=5).json()[TBS]
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
chunked=chunked,
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, httplib_request_kw)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1291, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1332, in _send_request
self.putheader(hdr, value)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/urllib3/connection.py", line 224, in putheader
_HTTPConnection.putheader(self, header, values)
File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/http/client.py", line 1269, in putheader
raise ValueError('Invalid header value %r' % (values[i],))
ValueError: Invalid header value b'BDUSS=\n'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 188, in
main()
File "main.py", line 178, in main
tbs = get_tbs(i)
File "main.py", line 56, in get_tbs
logger.error("获取tbs出错" + e)
TypeError: must be str, not ValueError
Error: Process completed with exit code 1.
`