KeyError "village" in metadata stage of looking through Google Photos #488

Closed
opened 2025-10-14 17:33:28 -06:00 by navan · 0 comments
Owner

Originally created by @akari-dogman on 10/4/2020

During the search of metadata in Google Photos, the program will throw up a KeyError saying it can't find "village."

Traceback (most recent call last):
  File "hunt.py", line 114, in <module>
    gpics(gaiaID, client, cookies, cfg)
  File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\photos.py", line 134, in gpics
    exifeater.feed(img)
  File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\metadata.py", line 55, in feed
    location = self.get_GPS(img)
  File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\metadata.py", line 49, in get_GPS
    return f'{location["village"]}, {location["country"]}'
KeyError: 'village'

Poking through the code, I had it print out what the location was for the photos:

debug: {'amenity': '', 'road': '', 'city': 'Las Vegas', 'county': 'Clark County', 'state': 'Nevada', 'postcode': '<5 digit post code>', 'country': 'United States of America', 'country_code': 'us'}

debug: {'amenity': '', 'road': '', 'suburb': '', 'town': 'Paradise', 'county': 'Clark County', 'state': 'Nevada', 'postcode': '<5 digit post code>', 'country': 'United States of America', 'country_code': 'us'}

The classification of whether it's a city, village, town, or others depends on where the photo is taken. The code looks for the hardcoded "village" tag, can't find one cause the photo isnt taken in a village, and throws up a TypeError.

*Originally created by @akari-dogman on 10/4/2020* During the search of metadata in Google Photos, the program will throw up a KeyError saying it can't find "village." ``` Traceback (most recent call last): File "hunt.py", line 114, in <module> gpics(gaiaID, client, cookies, cfg) File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\photos.py", line 134, in gpics exifeater.feed(img) File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\metadata.py", line 55, in feed location = self.get_GPS(img) File "C:\Users\<snip>\Downloads\GHunt-master\GHunt-master\lib\metadata.py", line 49, in get_GPS return f'{location["village"]}, {location["country"]}' KeyError: 'village' ``` Poking through the code, I had it print out what the location was for the photos: debug: {'amenity': '<place name>', 'road': '<road name>', 'city': 'Las Vegas', 'county': 'Clark County', 'state': 'Nevada', 'postcode': '<5 digit post code>', 'country': 'United States of America', 'country_code': 'us'} debug: {'amenity': '<place name>', 'road': '<road name>', 'suburb': '<suburb name>', 'town': 'Paradise', 'county': 'Clark County', 'state': 'Nevada', 'postcode': '<5 digit post code>', 'country': 'United States of America', 'country_code': 'us'} The classification of whether it's a city, village, town, or others depends on where the photo is taken. The code looks for the hardcoded "village" tag, can't find one cause the photo isnt taken in a village, and throws up a TypeError.
Sign in to join this conversation.
No labels
backdoor-try
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
can't read
can't read
can't read
can't read
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
good first issue
google-patch
google-patch
hacktoberfest-accepted
hacktoberfest-accepted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
knowledge-enrichment
known bug
question
question
question
question
question
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
spam
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
stale
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
third party bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/GHunt#488
No description provided.