2024-03-10 18:49:39 +00:00
|
|
|
import json
|
|
|
|
|
from rec.query import detail_query
|
2024-03-11 14:43:53 +00:00
|
|
|
from tqdm import tqdm
|
2024-03-10 18:49:39 +00:00
|
|
|
|
2024-03-11 14:43:53 +00:00
|
|
|
from data_access import Listing
|
2024-03-10 18:49:39 +00:00
|
|
|
|
2024-04-01 20:28:37 +02:00
|
|
|
listings = Listing.get_all_listings()
|
|
|
|
|
filtered_listings = []
|
|
|
|
|
for listing in listings:
|
|
|
|
|
if not listing.path_detail_json().exists():
|
|
|
|
|
filtered_listings.append(listing)
|
2024-04-05 11:38:55 +01:00
|
|
|
|
2024-04-01 20:28:37 +02:00
|
|
|
for listing in tqdm(filtered_listings):
|
2024-03-10 18:49:39 +00:00
|
|
|
try:
|
2024-03-11 14:43:53 +00:00
|
|
|
d = detail_query(listing.identifier)
|
2024-03-25 20:48:48 +00:00
|
|
|
with open(listing.path_detail_json(), "w") as f:
|
2024-03-11 14:43:53 +00:00
|
|
|
json.dump(d, f)
|
2024-05-06 18:54:55 +01:00
|
|
|
except Exception as e:
|
|
|
|
|
print(e)
|