浏览代码

fix (gui): timeout

Byaidu 1 年之前
父节点
当前提交
b7832ae08c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pdf2zh/gui.py

+ 1 - 1
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: