diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-04-20 00:42:47 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:12:34 +0200 |
commit | 1294ab9559a872f5c66211190f7e4ef3f6709df1 (patch) | |
tree | 9837fd8e894b2c11af693482e144bdfb56b0ae16 | |
parent | bdbf6b363c67992a82ea54fdd54474eaad39a3d8 (diff) |
Fail manga download if no images are found for chapter
-rwxr-xr-x | plugins/lhtranslation.py | 4 | ||||
-rwxr-xr-x | plugins/mangadex.py | 4 | ||||
-rwxr-xr-x | plugins/manganelo.py | 4 | ||||
-rwxr-xr-x | plugins/mangaplus.py | 4 | ||||
-rwxr-xr-x | plugins/mangawindow.py | 4 |
5 files changed, 20 insertions, 0 deletions
diff --git a/plugins/lhtranslation.py b/plugins/lhtranslation.py index c86401e..e27faa9 100755 --- a/plugins/lhtranslation.py +++ b/plugins/lhtranslation.py @@ -87,6 +87,10 @@ def download_chapter(url, download_dir): download_file(image_source, image_path) img_number += 1 + if img_number == 1: + print("Failed to find images for chapter") + exit(2) + with open(os.path.join(download_dir, ".finished"), "w") as file: file.write("1") diff --git a/plugins/mangadex.py b/plugins/mangadex.py index a1e004b..292db35 100755 --- a/plugins/mangadex.py +++ b/plugins/mangadex.py @@ -128,6 +128,10 @@ def download_chapter(url, download_dir): download_file(image_url, image_path) img_number += 1 + if img_number == 1: + print("Failed to find images for chapter") + exit(2) + with open(os.path.join(download_dir, ".finished"), "w") as file: file.write("1") diff --git a/plugins/manganelo.py b/plugins/manganelo.py index 352bb23..d8b5c9a 100755 --- a/plugins/manganelo.py +++ b/plugins/manganelo.py @@ -91,6 +91,10 @@ def download_chapter(url, download_dir): print("resource temporary unavailable: %s" % image_source) exit(2) img_number += 1 + + if img_number == 1: + print("Failed to find images for chapter") + exit(2) with open(os.path.join(download_dir, ".finished"), "w") as file: file.write("1") diff --git a/plugins/mangaplus.py b/plugins/mangaplus.py index 3658770..01940ff 100755 --- a/plugins/mangaplus.py +++ b/plugins/mangaplus.py @@ -287,6 +287,10 @@ def download_chapter(url, download_dir): download_file(page.page.image_url, page, image_path) img_number += 1 + if img_number == 1: + print("Failed to find images for chapter") + exit(2) + with open(os.path.join(download_dir, ".finished"), "w") as file: file.write("1") diff --git a/plugins/mangawindow.py b/plugins/mangawindow.py index 10f0f88..0b63c2d 100755 --- a/plugins/mangawindow.py +++ b/plugins/mangawindow.py @@ -92,6 +92,10 @@ def download_chapter(url, download_dir): download_file(image_url, image_path) img_number += 1 + if img_number == 1: + print("Failed to find images for chapter") + exit(2) + with open(os.path.join(download_dir, ".finished"), "w") as file: file.write("1") |