download_profiles: Check errors only if required

Fixes #178, where with `--profile-pic-only` an error message is printed
(without any further implications) when downloading profile pictures of private
profiles without being logged in.
This commit is contained in:
Alexander Graf 2018-09-23 10:09:08 +02:00
parent 325e89c4b2
commit b7ea0d5953

View File

@ -823,7 +823,7 @@ class Instaloader:
self.download_profilepic(profile)
# Catch some errors
if profile.is_private:
if profile.is_private and (tagged or highlights or posts):
if not self.context.is_logged_in:
raise LoginRequiredException("--login=USERNAME required.")
if not profile.followed_by_viewer and self.context.username != profile.username: