diff options
Diffstat (limited to 'plugins/mangaplus.py')
-rwxr-xr-x | plugins/mangaplus.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/mangaplus.py b/plugins/mangaplus.py index 9409989..05567fc 100755 --- a/plugins/mangaplus.py +++ b/plugins/mangaplus.py @@ -158,7 +158,7 @@ def usage_list(): def usage_download(): print("mangaplus.py download <url> <download_dir>") print("examples:") - print(" mangaplus.py download \"https://mangaplus.shueisha.co.jp/viewer/1006611\" /home/adam/Manga/MangaName") + print(" mangaplus.py download \"https://mangaplus.shueisha.co.jp/viewer/1006611\" /home/user/Manga/MangaName") print("") print("Note: The manga directory has to exist.") exit(1) @@ -206,9 +206,7 @@ def list_chapters(url, chapter_list_input): url = api_manga_url.format(manga_id) response = requests.get(url) - if response.status_code != 200: - print("Failed to list chapters, server responded with status code %d" % response.status_code) - exit(2) + response.raise_for_status() resp = MangaplusResponse.loads(response.content) if resp.error: @@ -257,9 +255,7 @@ def download_chapter(url, download_dir): url = api_chapter_url.format(manga_id) response = requests.get(url) - if response.status_code != 200: - print("Failed to list chapter images, server responded with status code %d" % response.status_code) - exit(2) + response.raise_for_status() in_progress_filepath = os.path.join(download_dir, ".in_progress") with open(in_progress_filepath, "w") as file: |