aboutsummaryrefslogtreecommitdiff
path: root/plugins/readm.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/readm.py')
-rwxr-xr-xplugins/readm.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/readm.py b/plugins/readm.py
index 8b8d024..59b8125 100755
--- a/plugins/readm.py
+++ b/plugins/readm.py
@@ -26,7 +26,7 @@ def usage_list():
def usage_download():
print("readm.py download <url> <download_dir>")
print("examples:")
- print(" readm.py download \"https://readm.org/manga/16609/307/all-pages\" /home/adam/Manga/MangaName")
+ print(" readm.py download \"https://readm.org/manga/16609/307/all-pages\" /home/user/Manga/MangaName")
print("")
print("Note: The manga directory has to exist.")
exit(1)
@@ -48,9 +48,7 @@ def download_file(url, save_path):
def list_chapters(url, chapter_list_input):
response = requests.get(url, headers=headers)
- 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()
seen_titles = set()
for item in chapter_list_input:
@@ -78,9 +76,7 @@ def list_chapters(url, chapter_list_input):
def download_chapter(url, download_dir):
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: