Update iptv流畅度检测.py

This commit is contained in:
frxz751113
2024-08-15 12:08:13 +08:00
committed by GitHub
parent afdddbe972
commit 326b4c2773
+8 -2
View File
@@ -770,6 +770,12 @@ deduplicate_lines(input_file_path, output_file_path)
################################################################################ ################################################################################
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
from pypinyin import lazy_pinyin
from opencc import OpenCC
import base64
import cv2
#################################################### 对整理好的频道列表测试HTTP连接 #################################################### 对整理好的频道列表测试HTTP连接
# 函数:获取视频分辨率 # 函数:获取视频分辨率
def get_video_resolution(video_path, timeout=2): def get_video_resolution(video_path, timeout=2):
@@ -844,9 +850,9 @@ def main(source_file_path, output_file_path):
# 使用with语句打开输出文件准备写入 # 使用with语句打开输出文件准备写入
with open(output_file_path, 'w', encoding='utf-8') as output_file: with open(output_file_path, 'w', encoding='utf-8') as output_file:
# 创建线程池,最大工作线程数为64 # 创建线程池,最大工作线程数为64
with ThreadPoolExecutor(max_workers=64) as executor: with ThreadPoolExecutor(max_workers=264) as executor:
# 为线程池中的每个线程提交worker函数 # 为线程池中的每个线程提交worker函数
for _ in range(64): for _ in range(264):
executor.submit(worker, task_queue, output_file, order_list, valid_count, invalid_count, len(lines)) executor.submit(worker, task_queue, output_file, order_list, valid_count, invalid_count, len(lines))
# 将所有行放入任务队列 # 将所有行放入任务队列
for line in lines: for line in lines: