mirror of
https://github.com/instaloader/instaloader.git
synced 2024-09-11 16:22:24 +02:00
parent
6e3c13b5d3
commit
02509d3c40
@ -63,8 +63,10 @@ def _log(*msg, sep='', end='\n', flush=False, quiet=False):
|
||||
|
||||
def get_json(name: str, session: requests.Session, max_id: int = 0, sleep: bool = True) -> Optional[Dict[str, Any]]:
|
||||
"""Return JSON of a profile"""
|
||||
resp = session.get('http://www.instagram.com/'+name,
|
||||
params={'max_id': max_id})
|
||||
if max_id == 0:
|
||||
resp = session.get('https://www.instagram.com/'+name)
|
||||
else:
|
||||
resp = session.get('https://www.instagram.com/'+name, params={'max_id': max_id})
|
||||
if sleep:
|
||||
time.sleep(4 * random.random() + 1)
|
||||
match = re.search('window\\._sharedData = .*<', resp.text)
|
||||
|
Loading…
Reference in New Issue
Block a user