From 9f3d47ce6d82edc5cc4e05c4da12f35ee2fafb2e Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 19 Sep 2022 22:16:09 +0300 Subject: [PATCH] true counter --- stanis-tits.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stanis-tits.py b/stanis-tits.py index 80ebb8c..f503e38 100755 --- a/stanis-tits.py +++ b/stanis-tits.py @@ -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(