Forráskód Böngészése

Merge branch 'dev-xym-log' of Server/long-article-manage into master

xueyiming 3 hónapja
szülő
commit
33e0eed10d

+ 3 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/VideoDownloader.java

@@ -80,6 +80,9 @@ public class VideoDownloader {
             }
             Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXY_HOST, PROXY_PORT));
             HttpURLConnection connection = (HttpURLConnection) new URL(videoUrl).openConnection(proxy);
+            connection.setConnectTimeout(10000);
+            // 设置读取超时时间(单位:毫秒)
+            connection.setReadTimeout(60000);
             connection.setRequestMethod("GET");
             connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0");
             connection.setRequestProperty("Accept", "*/*");