Update GAT.py
This commit is contained in:
@@ -178,14 +178,14 @@ import requests
|
|||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import threading
|
import threading
|
||||||
import re
|
import re
|
||||||
def test_connectivity(url, max_attempts=1):
|
def test_connectivity(url, max_attempts=4):
|
||||||
video_formats = ["m3u", "/", "rtsp"]
|
video_formats = ["m3u", "/", "rtsp"]
|
||||||
if not any(re.search(keyword, url, re.I) for keyword in video_formats):
|
if not any(re.search(keyword, url, re.I) for keyword in video_formats):
|
||||||
print("\n特殊网址: 跳过检测")
|
print("\n特殊网址: 跳过检测")
|
||||||
return False
|
return False
|
||||||
for _ in range(max_attempts):
|
for _ in range(max_attempts):
|
||||||
try:
|
try:
|
||||||
response = requests.get(url, timeout=3)
|
response = requests.get(url, timeout=0.3)
|
||||||
return response.status_code == 200
|
return response.status_code == 200
|
||||||
except requests.RequestException:
|
except requests.RequestException:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user