From 36afb519b3b871aa52863822a4b569eebb99f733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 5 Oct 2022 20:02:20 +0200 Subject: [PATCH] [instagram] prevent crash on empty user profile --- gallery_dl/extractor/instagram.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index 2ad408b8..8d1c4e79 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -702,6 +702,9 @@ class InstagramRestAPI(): if screen_name.startswith("id:"): return screen_name[3:] user = self.user(screen_name) + if user is None: + raise exception.AuthorizationError( + "Login required to access this profile") if user["is_private"] and not user["followed_by_viewer"]: name = user["username"] s = "" if name.endswith("s") else "s"