I'm getting the same trouble. Yesterday the script was working fine, but today it is no longer working whereas my code did not change. My python code is similar to the Connors' one but I have the same error message. I can confirm you that using HTTPS rather than HTTP is not the solution.
Traceback (most recent call last):
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 700, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b'\x89\xba\xcf\xac\x15\x00\x00\x00'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 441, in _error_catcher
yield
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 767, in read_chunked
self._update_chunk_length()
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 704, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'\x89\xba\xcf\xac\x15\x00\x00\x00', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 760, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 575, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 755, in read_chunked
with self._error_catcher():
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\response.py", line 458, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'\\x89\\xba\\xcf\\xac\\x15\\x00\\x00\\x00', 0 bytes read)", InvalidChunkLength(got length b'\x89\xba\xcf\xac\x15\x00\x00\x00', 0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Yanis Gougeat\Documents\Astrometry.net API\test.py", line 41, in <module>
R =
requests.post('
https://nova.astrometry.net/api/jobs/' + str(6497390), data={'request-json': json.dumps({"session": session_key})})
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 687, in send
r.content
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 838, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "C:\Users\Yanis Gougeat\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 763, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'\\x89\\xba\\xcf\\xac\\x15\\x00\\x00\\x00', 0 bytes read)", InvalidChunkLength(got length b'\x89\xba\xcf\xac\x15\x00\x00\x00', 0 bytes read))