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)