Compare commits

..
6 Commits
Author SHA1 Message Date
Alexander Graf eecaca7c7b Release of version 3.3.9 2018-04-18 16:25:53 +02:00
Alexander Graf 729aa31d86 Reverse story download order to enable fast-update
Fixes #100.
2018-04-18 16:24:47 +02:00
Alexander Graf 94df60292e Fix bug about 429 handling
It caused Instaloader to fail with a TypeError on 429 Too Many Requests.
2018-04-18 16:24:20 +02:00
Alexander Graf 09f2eb3601 Set GRAPHQL_PAGE_LENGTH to 12
This is the length the browser requests. Might alleviate #94.
2018-04-18 11:41:00 +02:00
Alexander Graf 3e904e8a14 Release of version 3.3.8 2018-04-17 13:30:45 +02:00
Alexander Graf f16b99bec0 Fix GraphQL Queries (again)
Fixes #96.
2018-04-17 13:17:50 +02:00
+6 -5
View File
@@ -31,7 +31,7 @@ import requests.utils
import urllib3
__version__ = '3.3.7'
__version__ = '3.3.9'
# NOTE: duplicated in README.rst and docs/index.rst
USAGE_STRING = """
@@ -460,7 +460,7 @@ class _PathPattern(str):
class Instaloader:
GRAPHQL_PAGE_LENGTH = 200
GRAPHQL_PAGE_LENGTH = 12
def __init__(self,
sleep: bool = True, quiet: bool = False,
@@ -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)
@@ -725,7 +726,7 @@ class Instaloader:
variables_json = json.dumps(variables, separators=(',', ':'))
if rhx_gis:
values = "{}:{}:{}".format(rhx_gis, tmpsession.cookies['csrftoken'], variables_json)
values = "{}:{}".format(rhx_gis, variables_json)
x_instagram_gis = hashlib.md5(values.encode()).hexdigest()
tmpsession.cookies.set('ig_pr', '2')
tmpsession.headers['x-instagram-gis'] = x_instagram_gis
@@ -1161,7 +1162,7 @@ class Instaloader:
self._log("Retrieving stories from profile {}.".format(name))
totalcount = len(user_stories["items"])
count = 1
for item in user_stories["items"]:
for item in reversed(user_stories["items"]):
self._log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
count += 1
with self._error_catcher('Download story from user {}'.format(name)):