Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #482, Compatibility for multiple profile picture #488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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