From b1e55a41a48d2f342dd7ee2f8b4a8125b5c179a5 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 1 May 2018 20:22:52 +0200 Subject: [PATCH] Do not log Post's username in download_saved_posts This improves speed, as get_saved_posts() returns Posts that do not have owner_profile info. So, printing the owner_username often required an additional request. --- instaloader/instaloader.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index ca097cd..0e14bf0 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -529,11 +529,10 @@ class Instaloader: for post in Profile.from_username(self.context, self.context.username).get_saved_posts(): if max_count is not None and count > max_count: break - name = post.owner_username if post_filter is not None and not post_filter(post): - self.context.log("".format(post), flush=True) continue - self.context.log("[{:>3}] {} ".format(count, name), end=str(), flush=True) + self.context.log("[{:>3}] ".format(count), end=str(), flush=True) count += 1 with self.context.error_catcher('Download saved posts'): downloaded = self.download_post(post, target=':saved')