1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-10-05 23:07:09 +02:00

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:
Alexander Graf 2020-12-12 16:49:38 +01:00
parent dcc7ab89c1
commit ed55ce140d

View File

@ -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