From ba5fbe418126cc7d02529de6eaee5a5a3f302d5e Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:36:27 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E7=BD=91=E7=BB=9C=E6=94=B6=E9=9B=86.p?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/网络收集.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/py/网络收集.py b/py/网络收集.py index a272f42..a09ee9a 100644 --- a/py/网络收集.py +++ b/py/网络收集.py @@ -107,11 +107,6 @@ simplified_text = converter.convert(traditional_text) with open('汇总.txt', 'w', encoding='utf-8') as file: file.write(simplified_text) -excluded_keywords = ['epg', 'mitv', 'udp', 'rtp', 'P2p', 'p2p', 'p3p', 'P2P', '新闻综合', 'P3p', '9930/qilu', 'shandong', 'jdshipin', 'goodiptv', '购物', '[', 'P3P', 'CCTV', '腔', '曲', '/pt', '//1', '/hls/', '春节'] -with open('汇总.txt', 'r', encoding='utf-8') as infile, open('汇总.txt', 'w', encoding='utf-8') as outfile: - for line in infile: - if not any(keyword in line for keyword in excluded_keywords): - outfile.write(line) with open('汇总.txt', 'r', encoding="utf-8") as file: @@ -341,7 +336,7 @@ import re import os # 定义一个包含所有要排除的关键词的列表 excluded_keywords = [ - 'epg', 'mitv', 'udp', 'rtp', 'P2p', 'p2p', 'p3p', 'P2P', '新闻综合', 'P3p', '9930/qilu', 'shandong', 'goodiptv', '购物', '[', 'P3P', '腔', '曲', '//1', '/hls/', '春节' + 'epg', 'mitv', 'udp', 'rtp', 'P2p', 'p2p', 'p3p', 'P2P', '新闻综合', 'P3p', 'jdshipin', '9930/qilu', 'shandong', 'goodiptv', '购物', '[', 'P3P', '腔', '曲', '//1', '/hls/', '春节' # 在这里添加需要排除的关键词 ]