feature: download fotos added
This commit is contained in:
@@ -167,3 +167,4 @@ test/acceptanceTest.html
|
|||||||
config/config.json
|
config/config.json
|
||||||
data/metadata.json
|
data/metadata.json
|
||||||
data/book_N.json
|
data/book_N.json
|
||||||
|
data/photo/*
|
||||||
|
|||||||
@@ -79,3 +79,16 @@ class Download:
|
|||||||
json.dump(result, f, indent=4)
|
json.dump(result, f, indent=4)
|
||||||
f.close()
|
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()
|
||||||
Reference in New Issue
Block a user