From 518c771e2150152cb7ed1446ae820c1e454288cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 12 Jul 2025 17:30:06 +0200 Subject: [PATCH] [instagram] provide 'post_url' for stories and highlights (#7810) fixes regression introduced in 25c63deebf82dd4ce5bb1b7f79bc0d16f97ce2c6 --- gallery_dl/extractor/instagram.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index 2d7dd3b3..40e9758e 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -165,10 +165,15 @@ class InstagramExtractor(Extractor): items = post["items"] reel_id = str(post["id"]).rpartition(":")[2] expires = post.get("expiring_at") + if expires: + post_url = f"{self.root}/stories/{post['user']['username']}/" + else: + post_url = f"{self.root}/stories/highlights/{reel_id}/" data = { "expires": text.parse_timestamp(expires), "post_id": reel_id, "post_shortcode": shortcode_from_id(reel_id), + "post_url": post_url, } if "title" in post: data["highlight_title"] = post["title"]