mirror of
https://github.com/instaloader/instaloader.git
synced 2024-11-04 09:22:29 +01:00
parent
0ad50c1526
commit
c3a5557140
@ -21,6 +21,7 @@ from typing import Any, Callable, Dict, List, Optional, Tuple
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
import requests.utils
|
import requests.utils
|
||||||
|
import urllib3
|
||||||
|
|
||||||
|
|
||||||
# To get version from setup.py for instaloader --version
|
# To get version from setup.py for instaloader --version
|
||||||
@ -164,7 +165,7 @@ class Instaloader:
|
|||||||
shutil.copyfileobj(resp.raw, file)
|
shutil.copyfileobj(resp.raw, file)
|
||||||
else:
|
else:
|
||||||
raise ConnectionException("Request returned HTTP error code {}.".format(resp.status_code))
|
raise ConnectionException("Request returned HTTP error code {}.".format(resp.status_code))
|
||||||
except (ConnectionResetError, ConnectionException) as err:
|
except (urllib3.exceptions.HTTPError, requests.exceptions.RequestException, ConnectionException) as err:
|
||||||
print("URL: " + url + "\n" + err, file=sys.stderr)
|
print("URL: " + url + "\n" + err, file=sys.stderr)
|
||||||
if tries <= 1:
|
if tries <= 1:
|
||||||
raise err
|
raise err
|
||||||
|
Loading…
Reference in New Issue
Block a user