Update mkbsd.py

Add count of images before starting download
This commit is contained in:
Jamal Chahir 2024-09-28 11:43:42 +01:00 committed by GitHub
parent 82e50c64f0
commit 8837253d9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,6 +29,9 @@ async def main():
raise Exception(f"⛔ Failed to fetch JSON file: {response.status}") raise Exception(f"⛔ Failed to fetch JSON file: {response.status}")
json_data = await response.json() json_data = await response.json()
data = json_data.get('data') data = json_data.get('data')
count = len(data) if data else 0
print(f"Found {count} images..")
if not data: if not data:
raise Exception('⛔ JSON does not have a "data" property at its root.') raise Exception('⛔ JSON does not have a "data" property at its root.')