From 28d991f7655b184f472ef8658237b20c1173f888 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 23 Oct 2026 20:23:10 +0000 Subject: [PATCH] Fix Profile.mediacount from the logged-out profile page --- instaloader/structures.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/instaloader/structures.py b/instaloader/structures.py index e15c114..e0ff17f 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -1147,6 +1147,9 @@ class Profile: normalized['id'] = normalized['pk'] if 'edge_owner_to_timeline_media' not in normalized and 'media_count' in normalized: normalized['edge_owner_to_timeline_media'] = {'count': normalized['media_count']} + # The logged-out profile page has all_media_count instead. + if 'edge_owner_to_timeline_media' not in normalized and 'all_media_count' in normalized: + normalized['edge_owner_to_timeline_media'] = {'count': normalized['all_media_count']} if 'edge_felix_video_timeline' not in normalized: normalized['edge_felix_video_timeline'] = {'count': 0} if 'edge_followed_by' not in normalized and 'follower_count' in normalized: