aboutsummaryrefslogtreecommitdiff
path: root/plugins/mangatown.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mangatown.py')
-rwxr-xr-xplugins/mangatown.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mangatown.py b/plugins/mangatown.py
index 0740925..29a58ab 100755
--- a/plugins/mangatown.py
+++ b/plugins/mangatown.py
@@ -36,7 +36,7 @@ if len(sys.argv) < 2:
def download_file(url, save_path):
file_size = 0
- with requests.get(url, headers=headers, stream=True) as response:
+ with requests.get(url, headers=headers, stream=True, timeout=30) as response:
if not response.ok:
return 0
with open(save_path, "wb") as file:
@@ -47,7 +47,7 @@ def download_file(url, save_path):
return file_size
def list_chapters(url, chapter_list_input):
- response = requests.get(url, headers=headers)
+ response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
seen_titles = set()
@@ -86,7 +86,7 @@ def download_chapter(url, download_dir):
if not url[-1] == '/':
url += '/'
- response = requests.get(url, headers=headers)
+ response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
in_progress_filepath = os.path.join(download_dir, ".in_progress")
@@ -135,7 +135,7 @@ def download_chapter(url, download_dir):
next_page_url = url + next_page_urls[0]
page_url = next_page_url
- response = requests.get(page_url, headers=headers)
+ response = requests.get(page_url, headers=headers, timeout=30)
if not response.ok:
print("Failed to get next page for chapter")
os.remove(in_progress_filepath)