Update 测试.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user