mirror of
https://github.com/instaloader/instaloader.git
synced 2026-10-19 23:22:16 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eecaca7c7b | ||
|
|
729aa31d86 | ||
|
|
94df60292e | ||
|
|
09f2eb3601 | ||
|
|
3e904e8a14 | ||
|
|
f16b99bec0 | ||
|
|
d316ddf02a | ||
|
|
efa0b93fda |
+6
-5
@@ -31,7 +31,7 @@ import requests.utils
|
|||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
|
|
||||||
__version__ = '3.3.6'
|
__version__ = '3.3.9'
|
||||||
|
|
||||||
# NOTE: duplicated in README.rst and docs/index.rst
|
# NOTE: duplicated in README.rst and docs/index.rst
|
||||||
USAGE_STRING = """
|
USAGE_STRING = """
|
||||||
@@ -460,7 +460,7 @@ class _PathPattern(str):
|
|||||||
|
|
||||||
|
|
||||||
class Instaloader:
|
class Instaloader:
|
||||||
GRAPHQL_PAGE_LENGTH = 200
|
GRAPHQL_PAGE_LENGTH = 12
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
sleep: bool = True, quiet: bool = False,
|
sleep: bool = True, quiet: bool = False,
|
||||||
@@ -663,7 +663,8 @@ class Instaloader:
|
|||||||
if isinstance(err, TooManyRequests):
|
if isinstance(err, TooManyRequests):
|
||||||
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)
|
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:
|
if waittime > 0:
|
||||||
self._log('The request will be retried in {} seconds.'.format(waittime))
|
self._log('The request will be retried in {} seconds.'.format(waittime))
|
||||||
time.sleep(waittime)
|
time.sleep(waittime)
|
||||||
@@ -725,7 +726,7 @@ class Instaloader:
|
|||||||
variables_json = json.dumps(variables, separators=(',', ':'))
|
variables_json = json.dumps(variables, separators=(',', ':'))
|
||||||
|
|
||||||
if rhx_gis:
|
if rhx_gis:
|
||||||
values = "{}:{}:{}:{}".format(rhx_gis, tmpsession.cookies['csrftoken'], self.user_agent, variables_json)
|
values = "{}:{}".format(rhx_gis, variables_json)
|
||||||
x_instagram_gis = hashlib.md5(values.encode()).hexdigest()
|
x_instagram_gis = hashlib.md5(values.encode()).hexdigest()
|
||||||
tmpsession.cookies.set('ig_pr', '2')
|
tmpsession.cookies.set('ig_pr', '2')
|
||||||
tmpsession.headers['x-instagram-gis'] = x_instagram_gis
|
tmpsession.headers['x-instagram-gis'] = x_instagram_gis
|
||||||
@@ -1161,7 +1162,7 @@ class Instaloader:
|
|||||||
self._log("Retrieving stories from profile {}.".format(name))
|
self._log("Retrieving stories from profile {}.".format(name))
|
||||||
totalcount = len(user_stories["items"])
|
totalcount = len(user_stories["items"])
|
||||||
count = 1
|
count = 1
|
||||||
for item in user_stories["items"]:
|
for item in reversed(user_stories["items"]):
|
||||||
self._log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
|
self._log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
|
||||||
count += 1
|
count += 1
|
||||||
with self._error_catcher('Download story from user {}'.format(name)):
|
with self._error_catcher('Download story from user {}'.format(name)):
|
||||||
|
|||||||
Reference in New Issue
Block a user