1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-08-17 20:29:38 +02:00

Spare unnecessary full metadata fetch

This fetch was done for sidecar posts that contain a video when going
through a profile. The fetched information is already present with the
new profile query introduced in the last commit, making this full
metadata fetch query unnecessary. Instaloader now better evaluates if
that fetch must be done or not.

The fetch was also (eventually unnecessarily) made when accessing
get_sidecar_posts() on a Post that has been loaded with
load_structure_from_file().
This commit is contained in:
Alexander Graf 2021-02-17 16:31:00 +01:00
parent 6c4da39372
commit f85e49d521

View File

@ -273,7 +273,7 @@ class Post:
"""
if self.typename == 'GraphSidecar':
edges = self._field('edge_sidecar_to_children', 'edges')
if any(edge['node']['is_video'] for edge in edges):
if any(edge['node']['is_video'] and 'video_url' not in edge['node'] for edge in edges):
# video_url is only present in full metadata, issue #558.
edges = self._full_metadata['edge_sidecar_to_children']['edges']
if end < 0: