Merge pull request from Guovin/dev

Release:v1.3.5
This commit is contained in:
Govin 2024-08-13 15:25:48 +08:00 committed by GitHub
commit bdbfee1a26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 148 additions and 91 deletions

@ -1,5 +1,15 @@
# 更新日志Changelog
## v1.3.5
### 2024/8/13
- 新增支持地区组播 ip 更新,调整默认以此模式运行,基本实现高清流畅播放(#225Added support for updating multicast IP for new regions and adjusted the default to run in this mode, basically achieving high-definition smooth playback (#225)
- 新增支持使用 FFmpeg 进行测速排序、获取分辨率信息Added support for using FFmpeg for speed testing and sorting, and obtaining resolution information
- 接口源增加分辨率信息用于源切换时显示Added resolution information to the interface source for display during source switching
- 调整配置文件与结果文件路径config、output 目录),方便 docker 卷挂载(#226Adjusted the paths for configuration and result files (config, output directories) to facilitate Docker volume mounting (#226)
- 修改配置文件类型config.iniModified the configuration file type (config.ini)
## v1.3.4
### 2024/7/31

@ -59,10 +59,10 @@ pipenv run ui
### 方式三Docker 更新
- requests轻量级性能要求低更新速度快稳定性不确定推荐订阅源使用此版本
- driver性能要求较高更新速度较慢稳定性、成功率高在线搜索、组播源使用此版本)
- requests轻量级性能要求低更新速度快稳定性不确定推荐组播源、订阅源使用此版本)
- driver性能要求较高更新速度较慢稳定性、成功率高推荐在线搜索使用此版本)
建议都试用一次,选择自己合适的版本,在线搜索和组播源使用 requests 能拿到结果的话,优先选择 requests 版本。
建议都试用一次,选择自己合适的版本,在线搜索使用 requests 能拿到结果的话,优先选择 requests 版本。
```bash
1. 拉取镜像:
@ -76,10 +76,13 @@ docker pull guovern/tv-driver:latest
docker run -d -p 8000:8000 guovern/tv-requests 或 tv-driver
卷挂载参数(可选):
-v 宿主机路径/TV:/tv-requests 或 tv-driver
实现宿主机文件与容器文件同步,修改模板、配置、获取更新结果文件可直接在宿主机文件夹下操作
使用此命令运行容器请务必先clone本项目至宿主机
配置文件:
-v 宿主机路径/config:/tv-requests/config 或 tv-driver/config
结果文件:
-v 宿主机路径/output:/tv-requests/output 或 tv-driver/output
3. 查看更新结果:访问(域名:8000
```

@ -59,10 +59,10 @@ pipenv run ui
### Method 3: Docker Update
- requests: Lightweight, low performance requirements, fast update speed, stability uncertain (Recommend using this version for the subscription source)
- driver: Higher performance requirements, slower update speed, high stability, high success rate (Online search, multicast source use this version)
- requests: Lightweight, low performance requirements, fast update speed, stability uncertain (Recommend using this version for the multicast source and the subscription source)
- driver: Higher performance requirements, slower update speed, high stability, high success rate (Online search use this version)
It's recommended to try each one and choose the version that suits you. If you can get results with requests for online searches and multicast sources, prioritize choosing the version that uses requests.
It's recommended to try each one and choose the version that suits you. If you can get results with requests for online searches, prioritize choosing the version that uses requests.
```bash
1. Pull the image:
@ -76,10 +76,13 @@ docker pull guovern/tv-driver:latest
docker run -d -p 8000:8000 guovern/tv-requests or driver
Volume Mount Parameter (Optional):
-v host path/TV:/tv-requests or tv-driver
This allows synchronization of files between the host machine and the container. Modifying templates, configurations, and retrieving updated result files can be directly operated in the host machine's folder.
Note: Before running the container with this command, be sure to first clone this project to the host machine.
config:
-v <path>/config:/tv-requests/config or tv-driver/config
result:
-v <path>/output:/tv-requests/output or tv-driver/output
3. Check the update results: Visit (domain:8000)
```

@ -1,25 +1,25 @@
| 配置项 | 默认值 | 描述 |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| open_update | True | 开启更新,若关闭则只运行结果页面服务 |
| open_use_old_result | True | 开启使用历史更新结果,合并至本次更新中 |
| open_driver | False | 开启浏览器运行,若更新无数据可开启此模式,较消耗性能 |
| open_proxy | True | 开启代理,自动获取免费可用代理,若更新无数据可开启此模式 |
| source_file | "demo.txt" | 模板文件名称 |
| final_file | "result.txt" | 生成文件名称 |
| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) |
| open_online_search | False | 开启线上检索源功能 |
| favorite_page_num | 5 | 关注频道获取分页数量 |
| default_page_num | 3 | 常规频道获取分页数量 |
| urls_limit | 10 | 单个频道接口数量 |
| open_keep_all | False | 保留所有检索结果,会保留非模板频道名称的结果,推荐手动维护时开启 |
| 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",<br>"https://m3u.ibert.me/txt/o_cn.txt",<br>"https://m3u.ibert.me/txt/j_iptv.txt"] | 订阅源列表 |
| open_multicast | True | 开启组播源功能 |
| region_list | ["all"] | 组播源地区列表,[更多地区](../multicast/multicast_map.json)"all"表示所有地区 |
| 配置项 | 默认值 | 描述 |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| open_update | True | 开启更新,若关闭则只运行结果页面服务 |
| open_use_old_result | True | 开启使用历史更新结果,合并至本次更新中 |
| open_driver | False | 开启浏览器运行,若更新无数据可开启此模式,较消耗性能 |
| open_proxy | True | 开启代理,自动获取免费可用代理,若更新无数据可开启此模式 |
| source_file | config/demo.txt | 模板文件名称 |
| final_file | output/result.txt | 生成文件名称 |
| favorite_list | 广东珠江,CCTV-1,CCTV-5,CCTV-5+,CCTV-13,广东体育,广东卫视,大湾区卫视,浙江卫视,湖南卫视,翡翠台 | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) |
| open_online_search | False | 开启线上检索源功能 |
| favorite_page_num | 5 | 关注频道获取分页数量 |
| default_page_num | 3 | 常规频道获取分页数量 |
| urls_limit | 10 | 单个频道接口数量 |
| open_keep_all | False | 保留所有检索结果,会保留非模板频道名称的结果,推荐手动维护时开启 |
| 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,<br>https://m3u.ibert.me/txt/o_cn.txt,<br>https://m3u.ibert.me/txt/j_iptv.txt | 订阅源列表 |
| open_multicast | True | 开启组播源功能 |
| region_list | 广东 | 组播源地区列表,[更多地区](../updates/multicast/multicast_map.json)all 表示所有地区 |

@ -1,25 +1,25 @@
| Configuration Item | Default Value | Description |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| open_update | True | Enable updates, if disabled then only the result page service is run |
| open_use_old_result | True | Enable the use of historical update results and merge them into the current update |
| open_driver | False | Enable browser execution, If there are no updates, this mode can be enabled, which consumes more performance |
| open_proxy | True | Enable proxy, automatically obtains free available proxies, If there are no updates, this mode can be enabled |
| 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 | False | 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_keep_all | False | Retain all search results, retain results with non-template channel names, recommended to be turned on when manually maintaining |
| open_sort | True | Enable the sorting function (response speed, date, resolution) |
| 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",<br>"https://m3u.ibert.me/txt/o_cn.txt",<br>"https://m3u.ibert.me/txt/j_iptv.txt"] | Subscription source list |
| open_multicast | True | Enable multicast source function |
| region_list | ["all"] | Multicast source region list, [more regions](../multicast/multicast_map.json, "all" means all regions) |
| Configuration Item | Default Value | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| open_update | True | Enable updates, if disabled then only the result page service is run |
| open_use_old_result | True | Enable the use of historical update results and merge them into the current update |
| open_driver | False | Enable browser execution, If there are no updates, this mode can be enabled, which consumes more performance |
| open_proxy | True | Enable proxy, automatically obtains free available proxies, If there are no updates, this mode can be enabled |
| source_file | config/demo.txt | Template file name |
| final_file | output/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 | False | 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_keep_all | False | Retain all search results, retain results with non-template channel names, recommended to be turned on when manually maintaining |
| open_sort | True | Enable the sorting function (response speed, date, resolution) |
| 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,<br>https://m3u.ibert.me/txt/o_cn.txt,<br>https://m3u.ibert.me/txt/j_iptv.txt | Subscription source list |
| open_multicast | True | Enable multicast source function |
| region_list | 广东 | Multicast source region list, [more regions](../updates/multicast/multicast_map.json, all means all regions) |

@ -38,20 +38,20 @@
跟编辑模板一样,修改运行配置
### 1. 点击 config.py 配置文件:
### 1. 点击 config.ini 配置文件:
![config.py入口](./images/config-btn.png 'config.py入口')
![config.ini入口](./images/config-btn.png 'config.ini入口')
### 2. 复制默认配置文件内容:
![copy config.py](./images/copy-config.png '复制默认模板')
![copy config.ini](./images/copy-config.png '复制默认模板')
### 3. 新建个人配置文件 user_config.py
### 3. 新建个人配置文件 user_config.ini
![创建user_config.py](./images/edit-user-config.png '创建user_config.py')
![创建user_config.ini](./images/edit-user-config.png '创建user_config.ini')
1. 创建文件
2. 配置文件命名为 user_config.py
2. 配置文件命名为 user_config.ini
3. 粘贴默认模板,修改 source_file = "user_demo.txt"final_file = "user_result.txt"
4. 点击 Commit changes...进行保存
@ -102,10 +102,13 @@ docker pull guovern/tv-driver:latest
docker run -d -p 8000:8000 guovern/tv-requests 或 tv-driver
卷挂载参数(可选):
-v 宿主机路径/TV:/tv-requests 或 tv-driver
实现宿主机文件与容器文件同步,修改模板、配置、获取更新结果文件可直接在宿主机文件夹下操作
使用此命令运行容器请务必先clone本项目至宿主机
配置文件:
-v 宿主机路径/config:/tv-requests/config 或 tv-driver/config
结果文件:
-v 宿主机路径/output:/tv-requests/output 或 tv-driver/output
3. 查看更新结果:访问(域名:8000
```

@ -38,20 +38,20 @@ When you click to confirm and create in step one, you will be automatically redi
Similar to editing the template, modify the running configuration
### 1. Click on the config.py configuration file:
### 1. Click on the config.ini configuration file:
![config.py Entrance](./images/config-btn.png 'config.py Entrance')
![config.ini Entrance](./images/config-btn.png 'config.ini Entrance')
### 2. Copy the default configuration file content:
![Copy config.py](./images/copy-config.png 'Copy default template')
![Copy config.ini](./images/copy-config.png 'Copy default template')
### 3. Create a personal configuration file user_config.py:
### 3. Create a personal configuration file user_config.ini:
![Create user_config.py](./images/edit-user-config.png 'Create user_config.py')
![Create user_config.ini](./images/edit-user-config.png 'Create user_config.ini')
1. Create file
2. Name the configuration file user_config.py
2. Name the configuration file user_config.ini
3. Paste the default template, modify source_file = "user_demo.txt"; final_file = "user_result.txt"
4. Click Commit changes... to save.
@ -102,10 +102,13 @@ docker pull guovern/tv-driver:latest
docker run -d -p 8000:8000 guovern/tv-requests or driver
Volume Mount Parameter (Optional):
-v host path/TV:/tv-requests or tv-driver
This allows synchronization of files between the host machine and the container. Modifying templates, configurations, and retrieving updated result files can be directly operated in the host machine's folder.
Note: Before running the container with this command, be sure to first clone this project to the host machine.
config:
-v <path>/config:/tv-requests/config or tv-driver/config
result:
-v <path>/output:/tv-requests/output or tv-driver/output
3. Check the update results: Visit (domain:8000)
```

@ -9,6 +9,7 @@ import os
import asyncio
import threading
import webbrowser
import json
config = get_config()
@ -18,7 +19,7 @@ class TkinterUI:
def __init__(self, root):
self.root = root
self.root.title("直播源接口更新工具")
self.version = "v1.3.4"
self.version = "v1.3.5"
self.update_source = UpdateSource()
self.update_running = False
self.config_entrys = [
@ -46,7 +47,7 @@ class TkinterUI:
"domain_blacklist_text",
"url_keywords_blacklist_text",
"subscribe_urls_text",
"region_list_text",
"region_list_combo",
]
self.result_url = None
@ -159,9 +160,7 @@ class TkinterUI:
def update_region_list(self, event):
config.set(
"Settings",
"region_list",
self.region_list_text.get(1.0, tk.END),
"Settings", "region_list", ",".join(self.region_list_combo.selected_values)
)
def view_result_link_callback(self, event):
@ -191,7 +190,7 @@ class TkinterUI:
"open_subscribe": self.open_subscribe_var.get(),
"subscribe_urls": self.subscribe_urls_text.get(1.0, tk.END),
"open_multicast": self.open_multicast_var.get(),
"region_list": self.region_list_text.get(1.0, tk.END),
"region_list": self.region_list_combo.get(),
}
for key, value in config_values.items():
@ -654,12 +653,24 @@ class TkinterUI:
self.region_list_label = tk.Label(frame4_region_list, text="组播地区:", width=9)
self.region_list_label.pack(side=tk.LEFT, padx=4, pady=8)
self.region_list_text = scrolledtext.ScrolledText(frame4_region_list, height=5)
self.region_list_text.pack(
with open("updates/multicast/multicast_map.json", "r", encoding="utf-8") as f:
regions_obj = json.load(f)
regions = list(regions_obj.keys())
region_selected_values = [
value
for value in config.get("Settings", "region_list").split(",")
if value.strip()
]
self.region_list_combo = MultiSelectCombobox(
frame4_region_list,
values=regions,
selected_values=region_selected_values,
height=10,
)
self.region_list_combo.pack(
side=tk.LEFT, padx=4, pady=8, expand=True, fill=tk.BOTH
)
self.region_list_text.insert(tk.END, config.get("Settings", "region_list"))
self.region_list_text.bind("<KeyRelease>", self.update_region_list)
self.region_list_combo.bind("<KeyRelease>", self.update_region_list)
root_operate = tk.Frame(self.root)
root_operate.pack(fill=tk.X, pady=8, padx=120)
@ -722,6 +733,30 @@ class TkinterUI:
self.view_result_link.pack_forget()
class MultiSelectCombobox(ttk.Combobox):
def __init__(self, master=None, **kwargs):
selected_values = kwargs.pop("selected_values", [])
values = kwargs.pop("values", [])
super().__init__(master, **kwargs)
self.selected_values = selected_values
self.values = values
self["values"] = self.values
self.bind("<<ComboboxSelected>>", self.on_select)
self.update_values()
def on_select(self, event):
selected_value = self.get()
if selected_value in self.selected_values:
self.selected_values.remove(selected_value)
else:
self.selected_values.append(selected_value)
self.update_values()
def update_values(self):
display_text = ", ".join(self.selected_values)
self.set(display_text)
if __name__ == "__main__":
root = tk.Tk()
tkinter_ui = TkinterUI(root)

@ -1,3 +1,3 @@
{
"version": "1.3.4"
"version": "1.3.5"
}