Skip to content

Commit

Permalink
🐛 fix for mxrch#482, making Person.profilePhotos dict[str, list(Perso…
Browse files Browse the repository at this point in the history
…nPhoto)]
  • Loading branch information
Shion1305 committed Jan 21, 2024
1 parent 40018b7 commit 6624e3a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
17 changes: 9 additions & 8 deletions ghunt/modules/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ async def hunt(as_client: httpx.AsyncClient, email_address: str, json_file: bool
print(f"Name : {target.names[container].fullname}\n")

if container in target.profilePhotos:
if target.profilePhotos[container].isDefault:
print("[-] Default profile picture")
else:
print("[+] Custom profile picture !")
print(f"=> {target.profilePhotos[container].url}")

await ia.detect_face(vision_api, as_client, target.profilePhotos[container].url)
print()
for photo in target.profilePhotos[container]:
if photo.isDefault:
print("[-] Default profile picture")
print(f"=> {photo.url}")
else:
print("[+] Custom profile picture !")
print(f"=> {photo.url}")
await ia.detect_face(vision_api, as_client, photo.url)
print()

if container in target.coverPhotos:
if target.coverPhotos[container].isDefault:
Expand Down
17 changes: 9 additions & 8 deletions ghunt/modules/gaia.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ async def hunt(as_client: httpx.AsyncClient, gaia_id: str, json_file: bool=None)
print(f"Name : {target.names[container].fullname}\n")

if container in target.profilePhotos:
if target.profilePhotos[container].isDefault:
print("[-] Default profile picture")
else:
print("[+] Custom profile picture !")
print(f"=> {target.profilePhotos[container].url}")

await ia.detect_face(vision_api, as_client, target.profilePhotos[container].url)
print()
for photo in target.profilePhotos[container]:
if photo.isDefault:
print("[-] Default profile picture")
print(f"=> {photo.url}")
else:
print("[+] Custom profile picture !")
print(f"=> {photo.url}")
await ia.detect_face(vision_api, as_client, photo.url)
print()

if container in target.coverPhotos:
if target.coverPhotos[container].isDefault:
Expand Down
6 changes: 4 additions & 2 deletions ghunt/parsers/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(self):
self.emails: Dict[str, PersonEmail] = PersonContainers()
self.names: Dict[str, PersonName] = PersonContainers()
self.profileInfos: Dict[str, PersonProfileInfo] = PersonContainers()
self.profilePhotos: Dict[str, PersonPhoto] = PersonContainers()
self.profilePhotos: Dict[str, list[PersonPhoto]] = PersonContainers()
self.coverPhotos: Dict[str, PersonPhoto] = PersonContainers()
self.inAppReachability: Dict[str, PersonInAppReachability] = PersonContainers()
self.extendedData: PersonExtendedData = PersonExtendedData()
Expand Down Expand Up @@ -148,7 +148,9 @@ async def _scrape(self, as_client: httpx.AsyncClient, person_data: Dict[str, any
for photo_data in person_data["photo"]:
person_photo = PersonPhoto()
await person_photo._scrape(as_client, photo_data, "profile_photo")
self.profilePhotos[profile_data["metadata"]["container"]] = person_photo
if not self.profilePhotos.get(profile_data["metadata"]["container"]):
self.profilePhotos[profile_data["metadata"]["container"]] = []
self.profilePhotos[profile_data["metadata"]["container"]].append(person_photo)

if (source_ids := person_data.get("metadata", {}).get("identityInfo", {}).get("sourceIds")):
for source_ids_data in source_ids:
Expand Down

0 comments on commit 6624e3a

Please sign in to comment.