Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取tbs出错 #4

Open
HuangYurong123 opened this issue Oct 3, 2021 · 0 comments
Open

获取tbs出错 #4

HuangYurong123 opened this issue Oct 3, 2021 · 0 comments

Comments

@HuangYurong123
Copy link

作者大大,这个问题怎么解决啊
`
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.

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant