From ad29cb44470007db9dae3a930c4fd1423312acd1 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:48:10 +0100 Subject: [PATCH] adds post_data to metadata for instagram --- .../instagram_api_extractor/instagram_api_extractor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auto_archiver/modules/instagram_api_extractor/instagram_api_extractor.py b/src/auto_archiver/modules/instagram_api_extractor/instagram_api_extractor.py index e21b089..44562f4 100644 --- a/src/auto_archiver/modules/instagram_api_extractor/instagram_api_extractor.py +++ b/src/auto_archiver/modules/instagram_api_extractor/instagram_api_extractor.py @@ -170,13 +170,15 @@ class InstagramAPIExtractor(Extractor): result.set("#highlights", count_highlights) return count_highlights - def download_post(self, result: Metadata, code: str = None, id: str = None, context: str = None) -> Metadata: + def download_post(self, result: Metadata, code: str = None, id: str = None, context: str = "") -> Metadata: if id: post = self.call_api("v1/media/by/id", {"id": id}) else: post = self.call_api("v1/media/by/code", {"code": code}) assert post, f"Post {id or code} not found" + result.set(f"{context}_data", post) + if caption_text := post.get("caption_text"): result.set_title(caption_text)