feature: download fotos added

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-05-16 16:18:49 +02:00
parent 7cc82e34e8
commit b25170296e
3 changed files with 15 additions and 0 deletions
+1
View File
@@ -167,3 +167,4 @@ test/acceptanceTest.html
config/config.json
data/metadata.json
data/book_N.json
data/photo/*
+13
View File
@@ -79,3 +79,16 @@ class Download:
json.dump(result, f, indent=4)
f.close()
def download_photos(cls) :
print("Downloading photos")
photos = cls.api.get(
"items/Fotos",
params=None
)
for photo in tqdm(photos):
data = cls.api.get_file("assets/" + photo["photo"])
file = open("./data/photo/" + str(photo["id"]) + ".jpg", "wb")
file.write(data)
file.close()
+1
View File
@@ -9,3 +9,4 @@ dl = download.Download(api)
dl.download_edition("N")
dl.download_question_metadata()
dl.download_photos()