diff --git a/instascrape/core/_static_scraper.py b/instascrape/core/_static_scraper.py index 911d284..0e27119 100644 --- a/instascrape/core/_static_scraper.py +++ b/instascrape/core/_static_scraper.py @@ -144,11 +144,14 @@ def scrape( return_data = self._get_json_from_source(self.source, headers=headers, session=session) flat_json_dict = flatten_dict(return_data["json_dict"]) - #HACK: patch mapping to fix the profile pic scrape when a sessionid is present + # HACK: patch mapping to fix the profile pic and biography scrape when a sessionid is present + # When a sessionid is present we should map to the corresponding "user_***" key + # Example: "biography" should be mapped to "user_biography" try: if "sessionid" in headers["cookie"]: mapping["profile_pic_url"] = deque(["user_profile_pic_url"]) mapping["profile_pic_url_hd"] = deque(["user_profile_pic_url_hd"]) + mapping["biography"] = deque(["user_biography"]) except KeyError: pass