diff --git a/ghunt/parsers/people.py b/ghunt/parsers/people.py index 43554121..55e10d2f 100644 --- a/ghunt/parsers/people.py +++ b/ghunt/parsers/people.py @@ -160,14 +160,26 @@ async def _scrape(self, as_client: httpx.AsyncClient, person_data: Dict[str, any if person_data.get("coverPhoto"): for cover_photo_data in person_data["coverPhoto"]: person_cover_photo = PersonPhoto() - await person_cover_photo._scrape(as_client, cover_photo_data, "cover_photo") - container = cover_photo_data.get("metadata", {}).get("container", "unknown") - self.coverPhotos[container] = person_cover_photo + await person_cover_photo._scrape( + as_client, + cover_photo_data, + "cover_photo" + ) + + metadata = cover_photo_data.get("metadata", {}) + container = metadata.get("container") + + if container: + self.coverPhotos[container] = person_cover_photo if (apps_data := person_data.get("inAppReachability")): containers_names = set() + for app_data in person_data["inAppReachability"]: - containers_names.add(app_data["metadata"]["container"]) + container = app_data.get("metadata", {}).get("container") + + if container: + containers_names.add(container) for container_name in containers_names: person_app_reachability = PersonInAppReachability() @@ -175,4 +187,4 @@ async def _scrape(self, as_client: httpx.AsyncClient, person_data: Dict[str, any self.inAppReachability[container_name] = person_app_reachability if (extended_data := person_data.get("extendedData")): - self.extendedData._scrape(extended_data) \ No newline at end of file + self.extendedData._scrape(extended_data)