Update 测试.py

This commit is contained in:
frxz751113
2024-09-03 18:35:51 +08:00
committed by GitHub
parent 8d5114e6ae
commit 2f5bd1d5a2
+2 -2
View File
@@ -111,12 +111,12 @@ for valid_url in valid_urls: # 确保这里是 valid_urls
response = requests.get(valid_url, timeout=3)
json_data = response.content.decode('utf-8')
lines = json_data.split('\n')
except UnicodeDecodeError:
except requests.RequestException as e:
pass
# 正则表达式匹配 #EXTINF 行
pattern = r"#EXTINF:-1 group-title=\"([^\"]+)\","
matches = re.finditer(pattern, json_data)
for match in matches:
channel_name = match.group(1)
# 获取下一行的 URL