From 6a429066978a3fd2249068cf7c35a677786ab7f2 Mon Sep 17 00:00:00 2001 From: fireattack Date: Thu, 11 Aug 2022 12:56:52 -0500 Subject: [PATCH] don't try to call iPhone api when comparing profile_pic URL (#1681) --- instaloader/instaloader.py | 2 +- instaloader/structures.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index 8754e4e..e34039e 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -562,7 +562,7 @@ class Instaloader: if latest_stamps is None: self.download_profilepic(profile) return - profile_pic_basename = profile.profile_pic_url.split('/')[-1].split('?')[0] + profile_pic_basename = profile.profile_pic_url_no_iphone.split('/')[-1].split('?')[0] saved_basename = latest_stamps.get_profile_pic(profile.username) if saved_basename == profile_pic_basename: return diff --git a/instaloader/structures.py b/instaloader/structures.py index adaa222..2e604e8 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -958,6 +958,13 @@ class Profile: else: return self._metadata("profile_pic_url_hd") + @property + def profile_pic_url_no_iphone(self) -> str: + """Return URL of lower-quality profile picture. + + .. versionadded:: 4.9.3""" + return self._metadata("profile_pic_url_hd") + def get_profile_pic_url(self) -> str: """.. deprecated:: 4.0.3