mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
[instagram] data not none even when missing cookies
This commit is contained in:
parent
92ac149d54
commit
980ba1bc2e
@ -22,14 +22,15 @@ def instagram_download(url, output_dir='.', merge=True, info_only=False, **kwarg
|
||||
download_urls([stream], title, ext, size, output_dir, merge=merge)
|
||||
else:
|
||||
data = re.search(r'window\._sharedData\s*=\s*(.*);</script>', html)
|
||||
if data is not None:
|
||||
try:
|
||||
info = json.loads(data.group(1))
|
||||
post = info['entry_data']['PostPage'][0]
|
||||
else:
|
||||
assert post
|
||||
except:
|
||||
# with logged-in cookies
|
||||
data = re.search(r'window\.__additionalDataLoaded\(\'[^\']+\',(.*)\);</script>', html)
|
||||
if data is not None:
|
||||
log.e('[Error] Cookies needed.')
|
||||
log.e('[Warning] Cookies needed.')
|
||||
post = json.loads(data.group(1))
|
||||
|
||||
if 'edge_sidecar_to_children' in post['graphql']['shortcode_media']:
|
||||
|
Loading…
Reference in New Issue
Block a user