From 2b5287e2e19d958ee3c7d8da41b3697a62e43bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 18 Aug 2025 11:23:00 +0200 Subject: [PATCH] [instagram] remove 'candidates' number check (#7921) Too many false positives (e.g. #7989 #8071) and only checking image dimensions should catch these "errors" as well. --- gallery_dl/extractor/instagram.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index b5450d54..cf717aec 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -223,8 +223,7 @@ class InstagramExtractor(Extractor): for num, item in enumerate(items, 1): try: - candidates = item["image_versions2"]["candidates"] - image = candidates[0] + image = item["image_versions2"]["candidates"][0] except Exception: self.log.warning("Missing media in post %s", data["post_shortcode"]) @@ -240,12 +239,7 @@ class InstagramExtractor(Extractor): video = None media = image - if len(candidates) <= 3 and not post.get("__gdl_gen"): - self.log.warning( - "%s: Image candidate list possibly incomplete " - "(%s items). Consider refreshing your cookies.", - data["post_shortcode"], len(candidates)) - elif image["width"] < item.get("original_width", 0) or \ + if image["width"] < item.get("original_width", 0) or \ image["height"] < item.get("original_height", 0): self.log.warning( "%s: Available image resolutions lower than the " @@ -711,7 +705,6 @@ class InstagramAvatarExtractor(InstagramExtractor): "caption" : None, "like_count": 0, "image_versions2": {"candidates": (avatar,)}, - "__gdl_gen" : True, },)