From d71641d8810e35026094d1a232e7f40b8d877276 Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Fri, 16 Aug 2024 00:02:05 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E5=9C=A8=E7=BA=BFV4=E6=BA=90=E4=BC=98?= =?UTF-8?q?=E9=80=89.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/在线V4源优选.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py/在线V4源优选.py b/py/在线V4源优选.py index 2f3f5ec..e31c343 100644 --- a/py/在线V4源优选.py +++ b/py/在线V4源优选.py @@ -32,8 +32,11 @@ with open("源.txt", 'r', encoding='utf-8') as file: lines = file.readlines() # 使用列表推导式过滤行 -filtered_lines = [line for line in lines if ',' in line and - all(substr not in line for substr in ['epg', 'mitv', 'udp', 'rtp', '[', 'P2p', 'p2p', 'p3p', 'P2P', 'P3p', 'P3P'])] +filtered_lines = [ + line for line in lines + if any(substr.lower() in line.lower() for substr in ['CCTV', '卫视', '4K', '4k', '8K', '影', '剧', '经典']) + and not any(substr.lower() in line.lower() for substr in ['epg', 'mitv', 'udp', 'rtp', 'P2P', 'p2p', '[', 'P3P']) +] # 使用with语句打开输出文件进行写入 with open("源.txt", 'w', encoding='utf-8') as output_file: