mirror of
https://github.com/instaloader/instaloader.git
synced 2024-08-18 20:59:38 +02:00
List all Exceptions in doc, fix name inconsistcies
This commit is contained in:
parent
b2f31e7782
commit
279de0a641
@ -100,6 +100,8 @@ Exceptions
|
|||||||
|
|
||||||
.. autoexception:: QueryReturnedNotFoundException
|
.. autoexception:: QueryReturnedNotFoundException
|
||||||
|
|
||||||
|
.. autoexception:: QueryReturnedForbiddenException
|
||||||
|
|
||||||
.. autoexception:: ProfileNotExistsException
|
.. autoexception:: ProfileNotExistsException
|
||||||
|
|
||||||
.. autoexception:: ProfileHasNoPicsException
|
.. autoexception:: ProfileHasNoPicsException
|
||||||
@ -115,3 +117,5 @@ Exceptions
|
|||||||
.. autoexception:: BadCredentialsException
|
.. autoexception:: BadCredentialsException
|
||||||
|
|
||||||
.. autoexception:: ConnectionException
|
.. autoexception:: ConnectionException
|
||||||
|
|
||||||
|
.. autoexception:: TooManyRequestsException
|
||||||
|
@ -89,7 +89,7 @@ class ConnectionException(InstaloaderException):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TooManyRequests(ConnectionException):
|
class TooManyRequestsException(ConnectionException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -613,7 +613,7 @@ class Instaloader:
|
|||||||
if resp.status_code == 404:
|
if resp.status_code == 404:
|
||||||
raise QueryReturnedNotFoundException("404")
|
raise QueryReturnedNotFoundException("404")
|
||||||
if resp.status_code == 429:
|
if resp.status_code == 429:
|
||||||
raise TooManyRequests("429 - Too Many Requests")
|
raise TooManyRequestsException("429 - Too Many Requests")
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
|
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
|
||||||
resp_json = resp.json()
|
resp_json = resp.json()
|
||||||
@ -633,7 +633,7 @@ class Instaloader:
|
|||||||
"Please do not use Instagram in your browser or run multiple instances of Instaloader "
|
"Please do not use Instagram in your browser or run multiple instances of Instaloader "
|
||||||
"in parallel.")
|
"in parallel.")
|
||||||
try:
|
try:
|
||||||
if isinstance(err, TooManyRequests):
|
if isinstance(err, TooManyRequestsException):
|
||||||
print(textwrap.fill(text_for_429), file=sys.stderr)
|
print(textwrap.fill(text_for_429), file=sys.stderr)
|
||||||
if is_graphql_query:
|
if is_graphql_query:
|
||||||
waittime = graphql_query_waittime(query_id=params['query_id'], untracked_queries=True)
|
waittime = graphql_query_waittime(query_id=params['query_id'], untracked_queries=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user