From 85b4581680b87bb55efb3f469fbdec8a2deb238d Mon Sep 17 00:00:00 2001 From: "guorong.zheng" <360996299@qq.com> Date: Wed, 15 May 2024 17:03:19 +0800 Subject: [PATCH] release:v1.1.4 --- CHANGELOG.md | 9 +++++++++ README-EN.md | 40 +++++++++++++++++++++++----------------- README.md | 40 +++++++++++++++++++++++----------------- config.py | 2 +- docs/tutorial-EN.md | 36 +++++++++++++++++++++--------------- docs/tutorial.md | 10 ++++++++-- main.py | 1 - utils.py | 2 +- version.json | 2 +- 9 files changed, 87 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f50c1..1d2cbbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # 更新日志(Changelog) +## v1.1.4 + +### 2024/5/15 + +- 新增组播源功能(Added multicast source feature) +- 新增控制开关,控制多种获取模式的启用状态(Added control switch to manage the activation status of various acquisition modes) +- 新增严格匹配(Added strict matching) +- 优化文件读取,提升模板初始化速度(Optimized file reading to improve initialization speed based on templates) + ## v1.1.3 ### 2024/5/8 diff --git a/README-EN.md b/README-EN.md index 27e0135..3c096c4 100644 --- a/README-EN.md +++ b/README-EN.md @@ -1,4 +1,4 @@ -# Customization of TVBox TV Channel Menu and Automatic Verification and Update of Live Source Interfaces +# TVBox Custom TV Channel Menu and Live Source Interface Automatic Verification and Update Tool Customize channel menus and automatically obtain and update the latest live source interfaces based on template files, verify, and generate usable channel interface files. @@ -16,25 +16,31 @@ Customize channel menus and automatically obtain and update the latest live sour - Ensure update timeliness, configure to retrieve interfaces updated within a recent time range - Can filter ipv4, ipv6 interfaces - Blacklist feature: Interface domain and keywords -- Customize the source of interface acquisition +- Supports multiple ways of obtaining sources: online search, multicast source, subscription source ## Config -| Configuration Item | Default Value | Description | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| source_file | "demo.txt" | Template file name | -| final_file | "result.txt" | Generated file name | -| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | List of favorite channel names (used only to distinguish from regular channels, custom page retrieval quantity) | -| favorite_page_num | 5 | Page retrieval quantity for favorite channels | -| default_page_num | 3 | Page retrieval quantity for regular channels | -| urls_limit | 10 | Number of interfaces per channel | -| response_time_weight | 0.5 | Response time weight value (the sum of all weight values should be 1) | -| resolution_weight | 0.5 | Resolution weight value (the sum of all weight values should be 1) | -| recent_days | 30 | Retrieve interfaces updated within a recent time range (in days), reducing appropriately can avoid matching issues | -| ipv_type | "ipv4" | The type of interface in the generated result, optional values: "ipv4", "ipv6", "all" | -| domain_blacklist | ["epg.pw"] | Interface domain blacklist, used to filter out interfaces with low-quality, ad-inclusive domains | -| url_keywords_blacklist | [] | Interface keyword blacklist, used to filter out interfaces containing specific characters | -| extend_base_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | The source of interface acquisition, currently only compatible with specific content formats and fuzzy matching of some channel names | +| Configuration Item | Default Value | Description | +| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| source_file | "demo.txt" | Template file name | +| final_file | "result.txt" | Generated file name | +| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | List of favorite channel names (used only to distinguish from regular channels, custom page retrieval quantity) | +| open_online_search | True | Enable online search source feature | +| favorite_page_num | 5 | Page retrieval quantity for favorite channels | +| default_page_num | 3 | Page retrieval quantity for regular channels | +| urls_limit | 10 | Number of interfaces per channel | +| open_sort | True | Enable the sorting test function, it is recommended to turn it off if you are not using online search | +| response_time_weight | 0.5 | Response time weight value (the sum of all weight values should be 1) | +| resolution_weight | 0.5 | Resolution weight value (the sum of all weight values should be 1) | +| recent_days | 30 | Retrieve interfaces updated within a recent time range (in days), reducing appropriately can avoid matching issues | +| ipv_type | "ipv4" | The type of interface in the generated result, optional values: "ipv4", "ipv6", "all" | +| domain_blacklist | ["epg.pw"] | Interface domain blacklist, used to filter out interfaces with low-quality, ad-inclusive domains | +| url_keywords_blacklist | [] | Interface keyword blacklist, used to filter out interfaces containing specific characters | +| open_subscribe | True | Enable subscription source feature | +| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | Subscription source list | +| open_multicast | True | Enable multicast source function | +| region_list | ['广东'] | Multicast source region list, for more regions please see the fofa_map.py file | +| strict_match | False | Strict matching, when enabled, can minimize the issue of channel interface mismatch to the greatest extent, but at the same time, some fuzzy matching results may be lost | ## Quick Start diff --git a/README.md b/README.md index f8ca96a..e28c853 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TVBox 电视频道菜单自定义与直播源接口自动校验与更新 +# TVBox 电视频道菜单自定义与直播源接口自动校验与更新工具 自定义频道菜单,根据模板文件的直播源接口,自动获取并更新最新的直播源接口,校验并生成可用的频道接口文件 @@ -16,25 +16,31 @@ - 保证更新时效性,配置获取最近时间范围内更新的接口 - 可过滤 ipv4、ipv6 接口 - 黑名单功能:接口域名与关键字 -- 自定义接口获取源 +- 支持多种获取源方式:线上检索、组播源、订阅源 ## 配置 -| 配置项 | 默认值 | 描述 | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | -| source_file | "demo.txt" | 模板文件名称 | -| final_file | "result.txt" | 生成文件名称 | -| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) | -| favorite_page_num | 5 | 关注频道获取分页数量 | -| default_page_num | 3 | 常规频道获取分页数量 | -| urls_limit | 10 | 单个频道接口数量 | -| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) | -| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) | -| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 | -| ipv_type | "ipv4" | 生成结果中接口的类型,可选值:"ipv4"、"ipv6"、"all" | -| domain_blacklist | ["epg.pw"] | 接口域名黑名单,用于过滤低质量含广告类域名的接口 | -| url_keywords_blacklist | [] | 接口关键字黑名单,用于过滤含特定字符的接口 | -| extend_base_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | 接口获取源,目前仅兼容特定内容格式与部分频道名称的模糊匹配 | +| 配置项 | 默认值 | 描述 | +| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| source_file | "demo.txt" | 模板文件名称 | +| final_file | "result.txt" | 生成文件名称 | +| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) | +| open_online_search | True | 开启线上检索源功能 | +| favorite_page_num | 5 | 关注频道获取分页数量 | +| default_page_num | 3 | 常规频道获取分页数量 | +| urls_limit | 10 | 单个频道接口数量 | +| open_sort | True | 开启排序测试功能,若没有使用线上检索建议关闭 | +| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) | +| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) | +| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 | +| ipv_type | "ipv4" | 生成结果中接口的类型,可选值:"ipv4"、"ipv6"、"all" | +| domain_blacklist | ["epg.pw"] | 接口域名黑名单,用于过滤低质量含广告类域名的接口 | +| url_keywords_blacklist | [] | 接口关键字黑名单,用于过滤含特定字符的接口 | +| open_subscribe | True | 开启订阅源功能 | +| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | 订阅源列表 | +| open_multicast | True | 开启组播源功能 | +| region_list | ['广东'] | 组播源地区列表,更多地区请见 fofa_map.py 文件 | +| strict_match | False | 严格匹配,开启可最大程度减少频道接口不匹配问题,同时会丢失部分模糊匹配结果 | ## 快速上手 diff --git a/config.py b/config.py index c780297..00fbfb7 100644 --- a/config.py +++ b/config.py @@ -25,7 +25,7 @@ ipv_type = "ipv4" domain_blacklist = ["epg.pw"] url_keywords_blacklist = [] open_subscribe = True -extend_base_urls = [ +subscribe_urls = [ "https://m3u.ibert.me/txt/fmml_dv6.txt", "https://m3u.ibert.me/txt/o_cn.txt", "https://m3u.ibert.me/txt/j_iptv.txt", diff --git a/docs/tutorial-EN.md b/docs/tutorial-EN.md index 9239e99..6ab26cb 100644 --- a/docs/tutorial-EN.md +++ b/docs/tutorial-EN.md @@ -57,21 +57,27 @@ Similar to editing the template, modify the running configuration Adjust the configuration as needed. Below is the default configuration explanation: -| Configuration Item | Default Value | Description | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| source_file | "demo.txt" | Template file name | -| final_file | "result.txt" | Generated file name | -| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | List of favorite channel names (used only to distinguish from regular channels, custom page retrieval quantity) | -| favorite_page_num | 5 | Page retrieval quantity for favorite channels | -| default_page_num | 3 | Page retrieval quantity for regular channels | -| urls_limit | 10 | Number of interfaces per channel | -| response_time_weight | 0.5 | Response time weight value (the sum of all weight values should be 1) | -| resolution_weight | 0.5 | Resolution weight value (the sum of all weight values should be 1) | -| recent_days | 30 | Retrieve interfaces updated within a recent time range (in days), reducing appropriately can avoid matching issues | -| ipv_type | "ipv4" | The type of interface in the generated result, optional values: "ipv4", "ipv6", "all" | -| domain_blacklist | ["epg.pw"] | Interface domain blacklist, used to filter out interfaces with low-quality, ad-inclusive domains | -| url_keywords_blacklist | [] | Interface keyword blacklist, used to filter out interfaces containing specific characters | -| extend_base_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | The source of interface acquisition, currently only compatible with specific content formats and fuzzy matching of some channel names | +| Configuration Item | Default Value | Description | +| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| source_file | "demo.txt" | Template file name | +| final_file | "result.txt" | Generated file name | +| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | List of favorite channel names (used only to distinguish from regular channels, custom page retrieval quantity) | +| open_online_search | True | Enable online search source feature | +| favorite_page_num | 5 | Page retrieval quantity for favorite channels | +| default_page_num | 3 | Page retrieval quantity for regular channels | +| urls_limit | 10 | Number of interfaces per channel | +| open_sort | True | Enable the sorting test function, it is recommended to turn it off if you are not using online search | +| response_time_weight | 0.5 | Response time weight value (the sum of all weight values should be 1) | +| resolution_weight | 0.5 | Resolution weight value (the sum of all weight values should be 1) | +| recent_days | 30 | Retrieve interfaces updated within a recent time range (in days), reducing appropriately can avoid matching issues | +| ipv_type | "ipv4" | The type of interface in the generated result, optional values: "ipv4", "ipv6", "all" | +| domain_blacklist | ["epg.pw"] | Interface domain blacklist, used to filter out interfaces with low-quality, ad-inclusive domains | +| url_keywords_blacklist | [] | Interface keyword blacklist, used to filter out interfaces containing specific characters | +| open_subscribe | True | Enable subscription source feature | +| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | Subscription source list | +| open_multicast | True | Enable multicast source function | +| region_list | ['广东'] | Multicast source region list, for more regions please see the fofa_map.py file | +| strict_match | False | Strict matching, when enabled, can minimize the issue of channel interface mismatch to the greatest extent, but at the same time, some fuzzy matching results may be lost | ## Step 4: Run Updates Locally (Recommended, Stable, Supports a large number of channel updates) diff --git a/docs/tutorial.md b/docs/tutorial.md index 9b46e12..9fb6d60 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -57,20 +57,26 @@ 按照您的需要适当调整配置,以下是默认配置说明 | 配置项 | 默认值 | 描述 | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | +| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | source_file | "demo.txt" | 模板文件名称 | | final_file | "result.txt" | 生成文件名称 | | favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) | +| open_online_search | True | 开启线上检索源功能 | | favorite_page_num | 5 | 关注频道获取分页数量 | | default_page_num | 3 | 常规频道获取分页数量 | | urls_limit | 10 | 单个频道接口数量 | +| open_sort | True | 开启排序测试功能,若没有使用线上检索建议关闭 | | response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) | | resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) | | recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 | | ipv_type | "ipv4" | 生成结果中接口的类型,可选值:"ipv4"、"ipv6"、"all" | | domain_blacklist | ["epg.pw"] | 接口域名黑名单,用于过滤低质量含广告类域名的接口 | | url_keywords_blacklist | [] | 接口关键字黑名单,用于过滤含特定字符的接口 | -| extend_base_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | 接口获取源,目前仅兼容特定内容格式与部分频道名称的模糊匹配 | +| open_subscribe | True | 开启订阅源功能 | +| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",
"https://m3u.ibert.me/txt/o_cn.txt",
"https://m3u.ibert.me/txt/j_iptv.txt"] | 订阅源列表 | +| open_multicast | True | 开启组播源功能 | +| region_list | ['广东'] | 组播源地区列表,更多地区请见 fofa_map.py 文件 | +| strict_match | False | 严格匹配,开启可最大程度减少频道接口不匹配问题,同时会丢失部分模糊匹配结果 | ## 步骤四:本地运行更新(推荐,稳定,支持大量频道更新) diff --git a/main.py b/main.py index 16692fa..b7cdd7c 100644 --- a/main.py +++ b/main.py @@ -31,7 +31,6 @@ from logging.handlers import RotatingFileHandler import os from tqdm import tqdm import re -import fofa_map import time handler = RotatingFileHandler("result_new.log", encoding="utf-8") diff --git a/utils.py b/utils.py index c23afca..7820980 100644 --- a/utils.py +++ b/utils.py @@ -59,7 +59,7 @@ async def getChannelsByExtendBaseUrls(channel_names): channels = {} pattern = r"^(.*?),(?!#genre#)(.*?)$" sub_pattern = r"_\((.*?)\)|_\[(.*?)\]|频道" - for base_url in config.extend_base_urls: + for base_url in config.subscribe_urls: try: print(f"Processing extend base url: {base_url}") try: diff --git a/version.json b/version.json index d03151b..8c0f63a 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "1.1.3" + "version": "1.1.4" } \ No newline at end of file