mirror of
https://github.com/instaloader/instaloader.git
synced 2024-11-04 09:22:29 +01: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]]:
|
def get_json(name: str, session: requests.Session, max_id: int = 0, sleep: bool = True) -> Optional[Dict[str, Any]]:
|
||||||
"""Return JSON of a profile"""
|
"""Return JSON of a profile"""
|
||||||
resp = session.get('http://www.instagram.com/'+name,
|
if max_id == 0:
|
||||||
params={'max_id': max_id})
|
resp = session.get('https://www.instagram.com/'+name)
|
||||||
|
else:
|
||||||
|
resp = session.get('https://www.instagram.com/'+name, params={'max_id': max_id})
|
||||||
if sleep:
|
if sleep:
|
||||||
time.sleep(4 * random.random() + 1)
|
time.sleep(4 * random.random() + 1)
|
||||||
match = re.search('window\\._sharedData = .*<', resp.text)
|
match = re.search('window\\._sharedData = .*<', resp.text)
|
||||||
|
Loading…
Reference in New Issue
Block a user