download_profile: Request story only if has_highlight_reel
This is a simple modification to save GraphQL queries, hence to more likely stay within rate limits without having to wait between profiles. Fixes #112.
This commit is contained in:
parent
b3df5a5f07
commit
211b2269ff
@ -699,9 +699,12 @@ class Instaloader:
|
|||||||
|
|
||||||
# Download stories, if requested
|
# Download stories, if requested
|
||||||
if download_stories or download_stories_only:
|
if download_stories or download_stories_only:
|
||||||
|
if profile.has_highlight_reel:
|
||||||
with self.context.error_catcher("Download stories of {}".format(profile_name)):
|
with self.context.error_catcher("Download stories of {}".format(profile_name)):
|
||||||
self.download_stories(userids=[profile.userid], filename_target=profile_name, fast_update=fast_update,
|
self.download_stories(userids=[profile.userid], filename_target=profile_name,
|
||||||
storyitem_filter=storyitem_filter)
|
fast_update=fast_update, storyitem_filter=storyitem_filter)
|
||||||
|
else:
|
||||||
|
self.context.log("{} does not have any stories.".format(profile_name))
|
||||||
if download_stories_only:
|
if download_stories_only:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -481,6 +481,10 @@ class Profile:
|
|||||||
def has_blocked_viewer(self) -> bool:
|
def has_blocked_viewer(self) -> bool:
|
||||||
return self._metadata('has_blocked_viewer')
|
return self._metadata('has_blocked_viewer')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_highlight_reel(self) -> bool:
|
||||||
|
return self._metadata('has_highlight_reel')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def has_requested_viewer(self) -> bool:
|
def has_requested_viewer(self) -> bool:
|
||||||
return self._metadata('has_requested_viewer')
|
return self._metadata('has_requested_viewer')
|
||||||
|
Loading…
Reference in New Issue
Block a user