true counter

This commit is contained in:
Alexander Popov 2022-09-19 22:16:09 +03:00
parent c0c013c31b
commit 9f3d47ce6d
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C
1 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,7 @@ from bs4 import BeautifulSoup
import click
__author__ = "Alexander Popov"
__version__ = "1.0.3"
__version__ = "1.0.4"
__license__ = "Unlicense"
# Путь к директории для загрузки изображений
@ -102,6 +102,9 @@ def image_download(image):
out_image,
)
return True
else:
return False
def main(download_directory, download_pages):
"""Главный цикл программы"""
@ -128,8 +131,8 @@ def main(download_directory, download_pages):
# По очереди скачиваем изображения
for image in images:
image_download(image)
downloaded_counter += 1
if image_download(image):
downloaded_counter += 1
print(
"\r{spinner} Загружено {total_files} файлов.".format(