Fix efficiency bug in download_profiles()
Fixes efficiency of the download_profiles() function when called with --no-posts --no-profile-pic by reordering an if statement. This inefficiency has been reported in #724. Co-authored-by: André Koch-Kramer <koch-kramer@web.de>
This commit is contained in:
parent
dcc7ab89c1
commit
ed55ce140d
@ -1129,10 +1129,13 @@ class Instaloader:
|
||||
self.save_metadata_json(json_filename, profile)
|
||||
|
||||
# Catch some errors
|
||||
if profile.is_private and (tagged or igtv or highlights or posts):
|
||||
if not self.context.is_logged_in:
|
||||
if tagged or igtv or highlights or posts:
|
||||
if (not self.context.is_logged_in and
|
||||
profile.is_private):
|
||||
raise LoginRequiredException("--login=USERNAME required.")
|
||||
if not profile.followed_by_viewer and self.context.username != profile.username:
|
||||
if (self.context.username != profile.username and
|
||||
profile.is_private and
|
||||
not profile.followed_by_viewer):
|
||||
raise PrivateProfileNotFollowedException("Private but not followed.")
|
||||
|
||||
# Download tagged, if requested
|
||||
|
Loading…
Reference in New Issue
Block a user