Spaces:
Sleeping
Sleeping
Commit
·
82aae5c
1
Parent(s):
f0c65a3
feat: ignore not found park
Browse files- src/fetch_places.py +1 -1
- src/main.py +2 -0
src/fetch_places.py
CHANGED
@@ -53,7 +53,7 @@ def nearby_search(coordinates: tuple) -> Tuple[str, str, dict]:
|
|
53 |
|
54 |
response = response.json()
|
55 |
if "places" not in response:
|
56 |
-
|
57 |
|
58 |
return (
|
59 |
response["places"][0]["id"],
|
|
|
53 |
|
54 |
response = response.json()
|
55 |
if "places" not in response:
|
56 |
+
return None, None, None
|
57 |
|
58 |
return (
|
59 |
response["places"][0]["id"],
|
src/main.py
CHANGED
@@ -11,6 +11,8 @@ if __name__ == "__main__":
|
|
11 |
for place_name, coordinate in tqdm(coordinates.items()):
|
12 |
try:
|
13 |
place_id, _, photos = nearby_search(coordinate)
|
|
|
|
|
14 |
fetch_place_photos(place_id, place_name, photos)
|
15 |
except Exception as e:
|
16 |
print(f"Error: {e} for {place_name}")
|
|
|
11 |
for place_name, coordinate in tqdm(coordinates.items()):
|
12 |
try:
|
13 |
place_id, _, photos = nearby_search(coordinate)
|
14 |
+
if not place_id:
|
15 |
+
continue
|
16 |
fetch_place_photos(place_id, place_name, photos)
|
17 |
except Exception as e:
|
18 |
print(f"Error: {e} for {place_name}")
|