OhmSpectator / streetviews-grabber

A script that grabs Google Street View for a city.
Other
7 stars 1 forks source link

Failed to establish a new connection Google Static Street View API #15

Closed OhmSpectator closed 1 year ago

OhmSpectator commented 1 year ago

If we use the parallelized version, we get an error about failed connection to Google Static Street View Service.

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='maps.googleapis.com', port=443): Max retries exceeded with url: /maps/api/streetview/metadata?location=52.510284%2C13.438625&key={KEY}&radius=5 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x13710c7c0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

The URL:

maps.googleapis.com/maps/api/streetview/metadata?location=52.510284%2C13.438625&key={KEY}&radius=5

Maybe it's related to the increased number of connections (non-parallelized makes ~5 requests/sec, parallelized: ~50 requests/sec)

Relates to: #3

OhmSpectator commented 1 year ago

https://linuxpip.org/fix-max-retries-exceeded-with-url-error-python/

OhmSpectator commented 1 year ago

Cannot reproduce on a machine with 4 CPUs only

OhmSpectator commented 1 year ago

After starting using sessions - the bug is gone.