diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index 31f8c90..950e6ce 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -1334,6 +1334,10 @@ class Instaloader: profile_id)) profile_from_id = Profile.from_id(self.context, profile_id) newname = profile_from_id.username + if profile_name == newname: + self.context.error( + f"Warning: Profile {profile_name} could not be retrieved by its name, but by its ID.") + return profile_from_id self.context.error("Profile {0} has changed its name to {1}.".format(profile_name, newname)) if latest_stamps is None: if ((format_string_contains_key(self.dirname_pattern, 'profile') or diff --git a/instaloader/structures.py b/instaloader/structures.py index 52b56fd..3957368 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -771,6 +771,9 @@ class Profile: top_search_results = TopSearchResults(self._context, self.username) similar_profiles = [profile.username for profile in top_search_results.get_profiles()] if similar_profiles: + if self.username in similar_profiles: + raise ProfileNotExistsException( + f"Profile {self.username} seems to exist, but could not be loaded.") from err raise ProfileNotExistsException('Profile {} does not exist.\nThe most similar profile{}: {}.' .format(self.username, 's are' if len(similar_profiles) > 1 else ' is',