Update GAT.py

This commit is contained in:
frxz751113
2024-09-30 11:39:40 +08:00
committed by GitHub
parent 3089910da9
commit ede2baf6eb
+2 -2
View File
@@ -178,14 +178,14 @@ import requests
from tqdm import tqdm
import threading
import re
def test_connectivity(url, max_attempts=1):
def test_connectivity(url, max_attempts=4):
video_formats = ["m3u", "/", "rtsp"]
if not any(re.search(keyword, url, re.I) for keyword in video_formats):
print("\n特殊网址: 跳过检测")
return False
for _ in range(max_attempts):
try:
response = requests.get(url, timeout=3)
response = requests.get(url, timeout=0.3)
return response.status_code == 200
except requests.RequestException:
pass