From 377e3f8dbd32567a39e72a3ec6ca66cf8b57186d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 5 Sep 2021 09:51:05 +0200 Subject: Fix lhtranslation after website redesign. Requires user to re-add their manga --- plugins/mangaplus.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins/mangaplus.py') 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 ") 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: -- cgit v1.2.3