1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-11-23 02:32:46 +01:00

Fix bug about 429 handling

It caused Instaloader to fail with a TypeError on 429 Too Many Requests.
This commit is contained in:
Alexander Graf 2018-04-18 16:24:20 +02:00
parent 09f2eb3601
commit 94df60292e

View File

@ -663,7 +663,8 @@ class Instaloader:
if isinstance(err, TooManyRequests):
print(textwrap.fill(text_for_429), file=sys.stderr)
if is_graphql_query:
waittime = graphql_query_waittime(query_id=params['query_id'], untracked_queries=True)
query_id = params['query_id'] if 'query_id' in params else params['query_hash']
waittime = graphql_query_waittime(query_id, untracked_queries=True)
if waittime > 0:
self._log('The request will be retried in {} seconds.'.format(waittime))
time.sleep(waittime)