From f168ec957259ff317ec587d51147345f1c027908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 26 Oct 2022 14:11:29 +0200 Subject: [PATCH] [instagram] extract 'coauthors' metadata (#3107) --- gallery_dl/extractor/instagram.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index 28ad6a3a..b5bc4998 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -172,6 +172,15 @@ class InstagramExtractor(Extractor): data["location_url"] = "{}/explore/locations/{}/{}/".format( self.root, location["pk"], slug) + coauthors = post.get("coauthor_producers") + if coauthors: + data["coauthors"] = [ + {"id" : user["pk"], + "username" : user["username"], + "full_name": user["full_name"]} + for user in coauthors + ] + if "carousel_media" in post: items = post["carousel_media"] data["sidecar_media_id"] = data["post_id"] @@ -266,6 +275,14 @@ class InstagramExtractor(Extractor): data["location_url"] = "{}/explore/locations/{}/{}/".format( self.root, location["id"], location["slug"]) + coauthors = post.get("coauthor_producers") + if coauthors: + data["coauthors"] = [ + {"id" : user["id"], + "username": user["username"]} + for user in coauthors + ] + data["_files"] = files = [] if "edge_sidecar_to_children" in post: for num, edge in enumerate(