fix:m3u update time logo()

This commit is contained in:
guorong.zheng 2025-01-08 15:36:40 +08:00
parent c8c7299c7c
commit 2204e5a786
2 changed files with 6 additions and 3 deletions

@ -116,6 +116,9 @@ class UpdateSource:
for channel_obj in self.channel_items.values()
for name in channel_obj.keys()
]
if not channel_names:
print(f"❌ No channel names found! Please check the {config.source_file}!")
return
await self.visit_page(channel_names)
self.tasks = []
append_total_data(
@ -169,7 +172,7 @@ class UpdateSource:
"wb",
) as file:
pickle.dump(channel_data_cache, file)
convert_to_m3u()
convert_to_m3u(channel_names[0])
print(
f"🥳 Update completed! Total time spent: {format_interval(time() - main_start_time)}. Please check the {user_final_file} file!"
)

@ -349,7 +349,7 @@ def get_ip_address():
return f"http://{ip}:{config.app_port}"
def convert_to_m3u():
def convert_to_m3u(first_channel_name=None):
"""
Convert result txt to m3u format
"""
@ -374,7 +374,7 @@ def convert_to_m3u():
r"(CCTV|CETV)-(\d+)(\+.*)?",
lambda m: f"{m.group(1)}{m.group(2)}"
+ ("+" if m.group(3) else ""),
original_channel_name,
first_channel_name if current_group == "🕘️更新时间" else original_channel_name,
)
m3u_output += f'#EXTINF:-1 tvg-name="{processed_channel_name}" tvg-logo="https://live.fanmingming.cn/tv/{processed_channel_name}.png"'
if current_group: