From 8ac4fbf94cb0fd83368178f194ecc037327afab7 Mon Sep 17 00:00:00 2001 From: Debakar Roy Date: Thu, 21 Dec 2023 07:00:09 +0000 Subject: [PATCH] Add timeout to requests --- src/kisskh_downloader/downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kisskh_downloader/downloader.py b/src/kisskh_downloader/downloader.py index 3e0c0ff..655096f 100644 --- a/src/kisskh_downloader/downloader.py +++ b/src/kisskh_downloader/downloader.py @@ -47,7 +47,7 @@ def download_subtitles( for subtitle in subtitles: logger.info(f"Downloading {subtitle.label} sub...") extension = os.path.splitext(urlparse(subtitle.src).path)[-1] - response = requests.get(subtitle.src) + response = requests.get(subtitle.src, timeout=60) output_path = Path(f"{filepath}.{subtitle.land}{extension}") output_path.write_bytes(response.content) if decrypter is not None: