Revert "Replaced usages of shortcode with mediaid"
This reverts commit 715582138b
.
It broke downloading sidecars and did not introduce any advantageous
behavior.
This commit is contained in:
parent
c0eecd1bd2
commit
1e10ab8669
@ -528,8 +528,7 @@ class Instaloader:
|
|||||||
date = node["date"] if "date" in node else node["taken_at_timestamp"]
|
date = node["date"] if "date" in node else node["taken_at_timestamp"]
|
||||||
if '__typename' in node:
|
if '__typename' in node:
|
||||||
if node['__typename'] == 'GraphSidecar':
|
if node['__typename'] == 'GraphSidecar':
|
||||||
sidecar_data = self.session.get('https://www.instagram.com/p/' +
|
sidecar_data = self.session.get('https://www.instagram.com/p/' + node['code'] + '/',
|
||||||
mediaid_to_shortcode(int(node['id'])) + '/',
|
|
||||||
params={'__a': 1}).json()
|
params={'__a': 1}).json()
|
||||||
edge_number = 1
|
edge_number = 1
|
||||||
downloaded = True
|
downloaded = True
|
||||||
@ -563,8 +562,7 @@ class Instaloader:
|
|||||||
self.save_caption(name, date, node["caption"])
|
self.save_caption(name, date, node["caption"])
|
||||||
else:
|
else:
|
||||||
self._log("<no caption>", end=' ', flush=True)
|
self._log("<no caption>", end=' ', flush=True)
|
||||||
node_id = node['id'] if 'id' in node else node['media_id']
|
node_code = node['shortcode'] if 'shortcode' in node else node['code']
|
||||||
node_code = mediaid_to_shortcode(int(node_id))
|
|
||||||
if node["is_video"] and download_videos:
|
if node["is_video"] and download_videos:
|
||||||
video_data = self.get_json('p/' + node_code)
|
video_data = self.get_json('p/' + node_code)
|
||||||
self.download_pic(name,
|
self.download_pic(name,
|
||||||
@ -657,8 +655,7 @@ class Instaloader:
|
|||||||
if max_count is not None and count > max_count:
|
if max_count is not None and count > max_count:
|
||||||
return
|
return
|
||||||
if lookup_username:
|
if lookup_username:
|
||||||
node_id = node['id'] if 'id' in node else node['media_id']
|
metadata = self.get_node_metadata(node['shortcode'] if 'shortcode' in node else node['code'])
|
||||||
metadata = self.get_node_metadata(mediaid_to_shortcode(int(node_id)))
|
|
||||||
pathname = metadata['owner']['username']
|
pathname = metadata['owner']['username']
|
||||||
else:
|
else:
|
||||||
pathname = '#{0}'.format(hashtag)
|
pathname = '#{0}'.format(hashtag)
|
||||||
|
Loading…
Reference in New Issue
Block a user