Update IPTV搜索引擎采集.py

This commit is contained in:
frxz751113
2024-09-21 01:05:38 +08:00
committed by GitHub
parent e529616e17
commit af64ee8c65
+3 -4
View File
@@ -421,12 +421,11 @@ check_and_write_file('2.txt', 'a.txt', keywords="央视频道, CCTV, CHC, 全
check_and_write_file('2.txt', 'b.txt', keywords="卫视频道, 卫视, 凤凰, 星空") check_and_write_file('2.txt', 'b.txt', keywords="卫视频道, 卫视, 凤凰, 星空")
check_and_write_file('2.txt', 'c0.txt', keywords="组播剧场, 第一剧场, 怀旧剧场, 风云音乐, 风云剧场, 欢笑剧场, 都市剧场, 高清电影, 家庭影院, 动作电影, 影迷, 峨眉, 重温, 女性, 地理") check_and_write_file('2.txt', 'c0.txt', keywords="组播剧场, 第一剧场, 怀旧剧场, 风云音乐, 风云剧场, 欢笑剧场, 都市剧场, 高清电影, 家庭影院, 动作电影, 影迷, 峨眉, 重温, 女性, 地理")
check_and_write_file('2.txt', 'c.txt', keywords="组播剧场, 爱动漫, SiTV, 爱怀旧, 爱经典, 爱科幻, 爱青春, 爱悬疑, 爱幼教, 爱院线") check_and_write_file('2.txt', 'c.txt', keywords="组播剧场, 爱动漫, SiTV, 爱怀旧, 爱经典, 爱科幻, 爱青春, 爱悬疑, 爱幼教, 爱院线")
check_and_write_file('2.txt', 'd.txt', keywords="江苏频道, 江苏") check_and_write_file('2.txt', 'd.txt', keywords="北京频道, 北京")
check_and_write_file('2.txt', 'e.txt', keywords="北京频道, 北京")
############################################################################################################################################################################################################################### ###############################################################################################################################################################################################################################
##############################################################对生成的文件进行合并 ##############################################################对生成的文件进行合并
file_contents = [] file_contents = []
file_paths = ["a.txt", "b.txt", "c0.txt", "c.txt", "d.txt", "e.txt"] # 替换为实际的文件路径列表 file_paths = ["a.txt", "b.txt", "c0.txt", "c.txt", "d.txt"] # 替换为实际的文件路径列表
for file_path in file_paths: for file_path in file_paths:
if os.path.exists(file_path): if os.path.exists(file_path):
with open(file_path, 'r', encoding="utf-8") as file: with open(file_path, 'r', encoding="utf-8") as file:
@@ -612,7 +611,7 @@ with open(file_path, 'r+', encoding='utf-8') as f:
################################################################################################任务结束,删除不必要的过程文件 ################################################################################################任务结束,删除不必要的过程文件
files_to_remove = ['去重.txt', '分类.txt', "2.txt", "4.txt", "5.txt", "a.txt", "b.txt", "c0.txt", "c.txt", "d.txt", "e.txt"] files_to_remove = ['去重.txt', '分类.txt', "2.txt", "4.txt", "5.txt", "a.txt", "b.txt", "c0.txt", "c.txt", "d.txt"]
for file in files_to_remove: for file in files_to_remove:
if os.path.exists(file): if os.path.exists(file):
os.remove(file) os.remove(file)