Przeglądaj źródła

fix (gui): timeout

Byaidu 1 rok temu
rodzic
commit
b7832ae08c
1 zmienionych plików z 1 dodań i 1 usunięć
  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: