From b7832ae08c652119ceff074b78567eeeeab8f00c Mon Sep 17 00:00:00 2001 From: Byaidu <909756245@qq.com> Date: Tue, 3 Dec 2024 20:04:51 +0800 Subject: [PATCH] fix (gui): timeout --- pdf2zh/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf2zh/gui.py b/pdf2zh/gui.py index bc1c5353..1f66dd71 100644 --- a/pdf2zh/gui.py +++ b/pdf2zh/gui.py @@ -91,7 +91,7 @@ def upload_file(file, service, progress=gr.Progress()): def download_with_limit(url, save_path, size_limit): chunk_size = 1024 total_size = 0 - with requests.get(url, stream=True) as response: + with requests.get(url, stream=True, timeout=10) as response: response.raise_for_status() content = response.headers.get("Content-Disposition") try: