mirror of
https://github.com/alantang1977/JunTV.git
synced 2024-12-05 04:43:12 +02:00
feat:foodie
This commit is contained in:
parent
fa490a80a0
commit
c550e65b77
13 changed files with 148 additions and 162 deletions
|
@ -26,14 +26,14 @@ url_keywords_blacklist =
|
|||
open_subscribe = True
|
||||
subscribe_urls = https://live.fanmingming.com/tv/m3u/ipv6.m3u,https://ghp.ci/https://raw.githubusercontent.com/joevess/IPTV/main/home.m3u8,https://aktv.top/live.txt,http://175.178.251.183:6689/live.txt,https://ghproxy.net/https://raw.githubusercontent.com/kimwang1978/collect-tv-txt/main/merged_output.txt,https://m3u.ibert.me/txt/fmml_dv6.txt,https://m3u.ibert.me/txt/o_cn.txt,https://m3u.ibert.me/txt/j_iptv.txt,https://github.moeyy.xyz/https://raw.githubusercontent.com/PizazzGY/TVBox/main/live.txt,https://ghproxy.net/https://raw.githubusercontent.com/xzw832/cmys/main/S_CCTV.txt,https://ghproxy.net/https://raw.githubusercontent.com/xzw832/cmys/main/S_weishi.txt,http://itv.22m.top/ITVBox/tv/tvonline.txt
|
||||
open_multicast = True
|
||||
open_multicast_tonkiang = True
|
||||
open_multicast_foodie = True
|
||||
open_multicast_fofa = True
|
||||
multicast_region_list = 全部
|
||||
multicast_page_num = 1
|
||||
open_proxy = False
|
||||
open_driver = True
|
||||
open_hotel = True
|
||||
open_hotel_tonkiang = True
|
||||
open_hotel_foodie = True
|
||||
open_hotel_fofa = True
|
||||
hotel_region_list = 全部
|
||||
hotel_page_num = 1
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
| 配置项 | 默认值 | 描述 |
|
||||
| ----------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| open_service | True | 开启页面服务,用于控制是否启动结果页面服务;如果使用青龙等平台部署,有专门设定的定时任务,需要更新完成后停止运行,可以关闭该功能 |
|
||||
| open_update | True | 开启更新,用于控制是否更新接口,若关闭则所有工作模式(获取接口和测速)均停止 |
|
||||
| open_use_old_result | True | 开启使用历史更新结果(包含模板与结果文件的接口),合并至本次更新中 |
|
||||
| open_driver | True | 开启浏览器运行,若更新无数据可开启此模式,较消耗性能 |
|
||||
| open_proxy | False | 开启代理,自动获取免费可用代理,若更新无数据可开启此模式 |
|
||||
| source_file | config/demo.txt | 模板文件路径 |
|
||||
| final_file | output/result.txt | 生成结果文件路径 |
|
||||
| open_online_search | False | 开启关键字搜索源功能 |
|
||||
| online_search_page_num | 3 | 关键字搜索频道获取分页数量 |
|
||||
| urls_limit | 15 | 单个频道接口数量 |
|
||||
| open_keep_all | False | 保留所有检索结果,会保留非模板频道名称的结果,推荐手动维护时开启 |
|
||||
| open_sort | True | 开启排序功能(响应速度、日期、分辨率) |
|
||||
| sort_timeout | 5 | 单个接口测速超时时长,单位秒(s);数值越大测速所属时间越长,能提高获取接口数量,但质量会有所下降;数值越小测速所需时间越短,能获取低延时的接口,质量较好;调整此值能优化更新时间 |
|
||||
| open_ffmpeg | True | 开启使用 FFmpeg 进行测速,获取更准确的速度与分辨率信息,需要提前手动安装 |
|
||||
| open_m3u_result | True | 开启转换生成 m3u 文件类型结果链接,支持显示频道图标 |
|
||||
| open_filter_resolution | True | 开启分辨率过滤,低于最小分辨率(min_resolution)的接口将会被过滤 |
|
||||
| min_resolution | 1920x1080 | 接口最小分辨率,需要开启 open_filter_resolution 才能生效 |
|
||||
| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) |
|
||||
| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) |
|
||||
| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 |
|
||||
| ipv_type | ipv4 | 生成结果中接口的协议类型,可选值:ipv4、ipv6、全部 |
|
||||
| ipv_type_prefer | IPv4 | 接口协议类型偏好,优先将该类型的接口排在结果前面,可选值:IPv4、IPv6、自动 |
|
||||
| ipv4_num | 15 | 结果中偏好的 IPv4 接口数量 |
|
||||
| ipv6_num | 15 | 结果中偏好的 IPv6 接口数量 |
|
||||
| domain_blacklist | epg.pw | 接口域名黑名单,用于过滤低质量含广告类域名的接口 |
|
||||
| url_keywords_blacklist | | 接口关键字黑名单,用于过滤含特定字符的接口 |
|
||||
| open_subscribe | False | 开启订阅源功能 |
|
||||
| subscribe_urls | | 订阅源,请输入订阅链接(支持 txt 与 m3u 链接),多个链接以逗号分隔 |
|
||||
| open_multicast | True | 开启组播源功能,关闭后所有组播源工作模式都将关闭 |
|
||||
| open_multicast_tonkiang | True | 开启 Tonkiang 组播源工作模式 |
|
||||
| open_multicast_fofa | True | 开启 FOFA 组播源工作模式 |
|
||||
| multicast_region_list | 全部 | 组播源地区列表,[更多地区](../updates/multicast/multicast_map.json),"全部"表示所有地区 |
|
||||
| multicast_page_num | 3 | 组播地区获取分页数量 |
|
||||
| open_hotel | True | 开启酒店源功能,关闭后所有酒店源工作模式都将关闭 |
|
||||
| open_hotel_tonkiang | False | 开启 Tonkiang 酒店源工作模式 |
|
||||
| open_hotel_fofa | True | 开启 FOFA、ZoomEye 酒店源工作模式 |
|
||||
| hotel_region_list | 全部 | 酒店源地区列表,[更多地区](../updates/fofa/fofa_map.py),"全部"表示所有地区 |
|
||||
| hotel_page_num | 3 | 酒店地区获取分页数量 |
|
||||
| request_timeout | 10 | 查询请求超时时长,单位秒(s),用于控制查询接口文本链接的超时时长以及重试时长,调整此值能优化更新时间 |
|
||||
| origin_type_prefer | hotel,multicast,subscribe,online_search | 结果偏好的接口来源,结果优先按该顺序进行排序,hotel:酒店源,multicast:组播源,subscribe:订阅源,online_search:关键字搜索 |
|
||||
| hotel_num | 10 | 结果中偏好的酒店源接口数量 |
|
||||
| multicast_num | 10 | 结果中偏好的组播源接口数量 |
|
||||
| subscribe_num | 10 | 结果中偏好的订阅源接口数量 |
|
||||
| online_search_num | 10 | 结果中偏好的关键字搜索接口数量 |
|
||||
| open_url_info | True | 开启显示接口说明信息,用于控制是否显示分辨率、接口协议类型等信息,为$符号后的内容,播放软件使用该信息对接口进行描述 |
|
||||
| 配置项 | 默认值 | 描述 |
|
||||
| ---------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| open_service | True | 开启页面服务,用于控制是否启动结果页面服务;如果使用青龙等平台部署,有专门设定的定时任务,需要更新完成后停止运行,可以关闭该功能 |
|
||||
| open_update | True | 开启更新,用于控制是否更新接口,若关闭则所有工作模式(获取接口和测速)均停止 |
|
||||
| open_use_old_result | True | 开启使用历史更新结果(包含模板与结果文件的接口),合并至本次更新中 |
|
||||
| open_driver | True | 开启浏览器运行,若更新无数据可开启此模式,较消耗性能 |
|
||||
| open_proxy | False | 开启代理,自动获取免费可用代理,若更新无数据可开启此模式 |
|
||||
| source_file | config/demo.txt | 模板文件路径 |
|
||||
| final_file | output/result.txt | 生成结果文件路径 |
|
||||
| open_online_search | False | 开启关键字搜索源功能 |
|
||||
| online_search_page_num | 3 | 关键字搜索频道获取分页数量 |
|
||||
| urls_limit | 15 | 单个频道接口数量 |
|
||||
| open_keep_all | False | 保留所有检索结果,会保留非模板频道名称的结果,推荐手动维护时开启 |
|
||||
| open_sort | True | 开启排序功能(响应速度、日期、分辨率) |
|
||||
| sort_timeout | 5 | 单个接口测速超时时长,单位秒(s);数值越大测速所属时间越长,能提高获取接口数量,但质量会有所下降;数值越小测速所需时间越短,能获取低延时的接口,质量较好;调整此值能优化更新时间 |
|
||||
| open_ffmpeg | True | 开启使用 FFmpeg 进行测速,获取更准确的速度与分辨率信息,需要提前手动安装 |
|
||||
| open_m3u_result | True | 开启转换生成 m3u 文件类型结果链接,支持显示频道图标 |
|
||||
| open_filter_resolution | True | 开启分辨率过滤,低于最小分辨率(min_resolution)的接口将会被过滤 |
|
||||
| min_resolution | 1920x1080 | 接口最小分辨率,需要开启 open_filter_resolution 才能生效 |
|
||||
| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) |
|
||||
| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) |
|
||||
| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 |
|
||||
| ipv_type | ipv4 | 生成结果中接口的协议类型,可选值:ipv4、ipv6、全部 |
|
||||
| ipv_type_prefer | IPv4 | 接口协议类型偏好,优先将该类型的接口排在结果前面,可选值:IPv4、IPv6、自动 |
|
||||
| ipv4_num | 15 | 结果中偏好的 IPv4 接口数量 |
|
||||
| ipv6_num | 15 | 结果中偏好的 IPv6 接口数量 |
|
||||
| domain_blacklist | epg.pw | 接口域名黑名单,用于过滤低质量含广告类域名的接口 |
|
||||
| url_keywords_blacklist | | 接口关键字黑名单,用于过滤含特定字符的接口 |
|
||||
| open_subscribe | False | 开启订阅源功能 |
|
||||
| subscribe_urls | | 订阅源,请输入订阅链接(支持 txt 与 m3u 链接),多个链接以逗号分隔 |
|
||||
| open_multicast | True | 开启组播源功能,关闭后所有组播源工作模式都将关闭 |
|
||||
| open_multicast_foodie | True | 开启 Foodie 组播源工作模式 |
|
||||
| open_multicast_fofa | True | 开启 FOFA 组播源工作模式 |
|
||||
| multicast_region_list | 全部 | 组播源地区列表,[更多地区](../updates/multicast/multicast_map.json),"全部"表示所有地区 |
|
||||
| multicast_page_num | 3 | 组播地区获取分页数量 |
|
||||
| open_hotel | True | 开启酒店源功能,关闭后所有酒店源工作模式都将关闭 |
|
||||
| open_hotel_foodie | False | 开启 Foodie 酒店源工作模式 |
|
||||
| open_hotel_fofa | True | 开启 FOFA、ZoomEye 酒店源工作模式 |
|
||||
| hotel_region_list | 全部 | 酒店源地区列表,[更多地区](../updates/fofa/fofa_map.py),"全部"表示所有地区 |
|
||||
| hotel_page_num | 3 | 酒店地区获取分页数量 |
|
||||
| request_timeout | 10 | 查询请求超时时长,单位秒(s),用于控制查询接口文本链接的超时时长以及重试时长,调整此值能优化更新时间 |
|
||||
| origin_type_prefer | hotel,multicast,subscribe,online_search | 结果偏好的接口来源,结果优先按该顺序进行排序,hotel:酒店源,multicast:组播源,subscribe:订阅源,online_search:关键字搜索 |
|
||||
| hotel_num | 10 | 结果中偏好的酒店源接口数量 |
|
||||
| multicast_num | 10 | 结果中偏好的组播源接口数量 |
|
||||
| subscribe_num | 10 | 结果中偏好的订阅源接口数量 |
|
||||
| online_search_num | 10 | 结果中偏好的关键字搜索接口数量 |
|
||||
| open_url_info | True | 开启显示接口说明信息,用于控制是否显示分辨率、接口协议类型等信息,为$符号后的内容,播放软件使用该信息对接口进行描述 |
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
| Configuration Item | Default Value | Description |
|
||||
| ----------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| open_service | True | Enable page service, used to control whether to start the result page service; if deployed on platforms like Qinglong with dedicated scheduled tasks, the function can be turned off after updates are completed and the task is stopped |
|
||||
| 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 (including the interface for template and result files) and merge them into the current update |
|
||||
| open_driver | True | Enable browser execution, If there are no updates, this mode can be enabled, which consumes more performance |
|
||||
| open_proxy | False | Enable proxy, automatically obtains free available proxies, If there are no updates, this mode can be enabled |
|
||||
| source_file | config/demo.txt | Template file path |
|
||||
| final_file | output/result.txt | Generated result file path |
|
||||
| open_online_search | False | Enable keyword search source feature |
|
||||
| online_search_page_num | 3 | Page retrieval quantity for keyword search channels |
|
||||
| urls_limit | 15 | 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) |
|
||||
| sort_timeout | 5 | The timeout duration for speed testing of a single interface, in seconds (s). A larger value means a longer testing period, which can increase the number of interfaces obtained but may decrease their quality. A smaller value means a shorter testing time, which can obtain low-latency interfaces with better quality. Adjusting this value can optimize the update time. |
|
||||
| open_ffmpeg | True | Enable speed testing using FFmpeg to obtain more accurate speed and resolution information. Manual installation is required in advance. |
|
||||
| open_m3u_result | True | Enable the conversion to generate m3u file type result links, supporting the display of channel icons |
|
||||
| open_filter_resolution | True | Enable resolution filtering, interfaces with resolution lower than the minimum resolution (min_resolution) will be filtered |
|
||||
| min_resolution | 1920x1080 | Minimum interface resolution, requires enabling open_filter_resolution to take effect |
|
||||
| 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 protocol type of interface in the generated result, optional values: ipv4, ipv6, all |
|
||||
| ipv_type_prefer | IPv4 | Interface protocol type preference, prioritize interfaces of this type in the results, optional values: IPv4, IPv6, auto |
|
||||
| ipv4_num | 15 | The preferred number of IPv4 interfaces in the result |
|
||||
| ipv6_num | 15 | The preferred number of IPv6 interfaces in the result |
|
||||
| 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 | False | Enable subscription source feature |
|
||||
| subscribe_urls | | Subscription source, please enter the subscription link (supports txt and m3u links), multiple links should be separated by commas |
|
||||
| open_multicast | True | Enable the multicast source function, after disabling it all multicast sources will stop working |
|
||||
| open_multicast_tonkiang | True | Enable Tonkiang multicast source work mode |
|
||||
| open_multicast_fofa | True | Enable FOFA multicast source work mode |
|
||||
| multicast_region_list | all | Multicast source region list, [more regions](../updates/multicast/multicast_map.json, all means all regions) |
|
||||
| multicast_page_num | 3 | Number of pages to retrieve for multicast regions |
|
||||
| open_hotel | True | Enable the hotel source function, after closing it all hotel source working modes will be disabled |
|
||||
| open_hotel_tonkiang | False | Enable Tonkiang hotel source work mode |
|
||||
| open_hotel_fofa | True | Enable FOFA、ZoomEye hotel source work mode |
|
||||
| hotel_region_list | all | List of hotel source regions, [more regions](../updates/fofa/fofa_map.py), 'all' indicates all regions |
|
||||
| hotel_page_num | 3 | Number of pages to retrieve for hotel regions |
|
||||
| request_timeout | 10 | Query request timeout duration, in seconds (s), used to control the timeout and retry duration for querying interface text links. Adjusting this value can optimize update time. |
|
||||
| origin_type_prefer | hotel, multicast, subscribe, online_search | Result preference for the source of the interface, results are prioritized in this order: hotel: hotel source, multicast: multicast source, subscribe: subscription source, online_search: keyword search |
|
||||
| hotel_num | 10 | The number of preferred hotel source interfaces in the results |
|
||||
| multicast_num | 10 | The number of preferred multicast source interfaces in the results |
|
||||
| subscribe_num | 10 | The number of preferred subscribe source interfaces in the results |
|
||||
| online_search_num | 10 | The number of preferred keyword search interfaces in the results |
|
||||
| open_url_info | True | Enable display of API description information, used to control whether to show resolution, API protocol type, etc., the content after the $ symbol, playback software uses this information to describe the API |
|
||||
| Configuration Item | Default Value | Description |
|
||||
| ---------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| open_service | True | Enable page service, used to control whether to start the result page service; if deployed on platforms like Qinglong with dedicated scheduled tasks, the function can be turned off after updates are completed and the task is stopped |
|
||||
| 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 (including the interface for template and result files) and merge them into the current update |
|
||||
| open_driver | True | Enable browser execution, If there are no updates, this mode can be enabled, which consumes more performance |
|
||||
| open_proxy | False | Enable proxy, automatically obtains free available proxies, If there are no updates, this mode can be enabled |
|
||||
| source_file | config/demo.txt | Template file path |
|
||||
| final_file | output/result.txt | Generated result file path |
|
||||
| open_online_search | False | Enable keyword search source feature |
|
||||
| online_search_page_num | 3 | Page retrieval quantity for keyword search channels |
|
||||
| urls_limit | 15 | 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) |
|
||||
| sort_timeout | 5 | The timeout duration for speed testing of a single interface, in seconds (s). A larger value means a longer testing period, which can increase the number of interfaces obtained but may decrease their quality. A smaller value means a shorter testing time, which can obtain low-latency interfaces with better quality. Adjusting this value can optimize the update time. |
|
||||
| open_ffmpeg | True | Enable speed testing using FFmpeg to obtain more accurate speed and resolution information. Manual installation is required in advance. |
|
||||
| open_m3u_result | True | Enable the conversion to generate m3u file type result links, supporting the display of channel icons |
|
||||
| open_filter_resolution | True | Enable resolution filtering, interfaces with resolution lower than the minimum resolution (min_resolution) will be filtered |
|
||||
| min_resolution | 1920x1080 | Minimum interface resolution, requires enabling open_filter_resolution to take effect |
|
||||
| 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 protocol type of interface in the generated result, optional values: ipv4, ipv6, all |
|
||||
| ipv_type_prefer | IPv4 | Interface protocol type preference, prioritize interfaces of this type in the results, optional values: IPv4, IPv6, auto |
|
||||
| ipv4_num | 15 | The preferred number of IPv4 interfaces in the result |
|
||||
| ipv6_num | 15 | The preferred number of IPv6 interfaces in the result |
|
||||
| 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 | False | Enable subscription source feature |
|
||||
| subscribe_urls | | Subscription source, please enter the subscription link (supports txt and m3u links), multiple links should be separated by commas |
|
||||
| open_multicast | True | Enable the multicast source function, after disabling it all multicast sources will stop working |
|
||||
| open_multicast_foodie | True | Enable Foodie multicast source work mode |
|
||||
| open_multicast_fofa | True | Enable FOFA multicast source work mode |
|
||||
| multicast_region_list | all | Multicast source region list, [more regions](../updates/multicast/multicast_map.json, all means all regions) |
|
||||
| multicast_page_num | 3 | Number of pages to retrieve for multicast regions |
|
||||
| open_hotel | True | Enable the hotel source function, after closing it all hotel source working modes will be disabled |
|
||||
| open_hotel_foodie | False | Enable Foodie hotel source work mode |
|
||||
| open_hotel_fofa | True | Enable FOFA、ZoomEye hotel source work mode |
|
||||
| hotel_region_list | all | List of hotel source regions, [more regions](../updates/fofa/fofa_map.py), 'all' indicates all regions |
|
||||
| hotel_page_num | 3 | Number of pages to retrieve for hotel regions |
|
||||
| request_timeout | 10 | Query request timeout duration, in seconds (s), used to control the timeout and retry duration for querying interface text links. Adjusting this value can optimize update time. |
|
||||
| origin_type_prefer | hotel, multicast, subscribe, online_search | Result preference for the source of the interface, results are prioritized in this order: hotel: hotel source, multicast: multicast source, subscribe: subscription source, online_search: keyword search |
|
||||
| hotel_num | 10 | The number of preferred hotel source interfaces in the results |
|
||||
| multicast_num | 10 | The number of preferred multicast source interfaces in the results |
|
||||
| subscribe_num | 10 | The number of preferred subscribe source interfaces in the results |
|
||||
| online_search_num | 10 | The number of preferred keyword search interfaces in the results |
|
||||
| open_url_info | True | Enable display of API description information, used to control whether to show resolution, API protocol type, etc., the content after the $ symbol, playback software uses this information to describe the API |
|
||||
|
|
10
main.py
10
main.py
|
@ -71,7 +71,7 @@ class UpdateSource:
|
|||
self.tasks = []
|
||||
self.channel_items = {}
|
||||
self.hotel_fofa_result = {}
|
||||
self.hotel_tonkiang_result = {}
|
||||
self.hotel_foodie_result = {}
|
||||
self.multicast_result = {}
|
||||
self.subscribe_result = {}
|
||||
self.online_search_result = {}
|
||||
|
@ -84,7 +84,7 @@ class UpdateSource:
|
|||
tasks_config = [
|
||||
("hotel_fofa", get_channels_by_fofa, "hotel_fofa_result"),
|
||||
("multicast", get_channels_by_multicast, "multicast_result"),
|
||||
("hotel_tonkiang", get_channels_by_hotel, "hotel_tonkiang_result"),
|
||||
("hotel_foodie", get_channels_by_hotel, "hotel_foodie_result"),
|
||||
("subscribe", get_channels_by_subscribe_urls, "subscribe_result"),
|
||||
(
|
||||
"online_search",
|
||||
|
@ -95,7 +95,7 @@ class UpdateSource:
|
|||
|
||||
for setting, task_func, result_attr in tasks_config:
|
||||
if (
|
||||
setting == "hotel_tonkiang" or setting == "hotel_fofa"
|
||||
setting == "hotel_foodie" or setting == "hotel_fofa"
|
||||
) and config.open_hotel == False:
|
||||
continue
|
||||
if config.open_method[setting]:
|
||||
|
@ -104,7 +104,7 @@ class UpdateSource:
|
|||
task = asyncio.create_task(
|
||||
task_func(subscribe_urls, callback=self.update_progress)
|
||||
)
|
||||
elif setting == "hotel_tonkiang" or setting == "hotel_fofa":
|
||||
elif setting == "hotel_foodie" or setting == "hotel_fofa":
|
||||
task = asyncio.create_task(task_func(callback=self.update_progress))
|
||||
else:
|
||||
task = asyncio.create_task(
|
||||
|
@ -152,7 +152,7 @@ class UpdateSource:
|
|||
self.channel_data,
|
||||
self.hotel_fofa_result,
|
||||
self.multicast_result,
|
||||
self.hotel_tonkiang_result,
|
||||
self.hotel_foodie_result,
|
||||
self.subscribe_result,
|
||||
self.online_search_result,
|
||||
)
|
||||
|
|
|
@ -34,16 +34,16 @@ class HotelUI:
|
|||
frame_hotel_mode, text="工作模式:", width=9
|
||||
)
|
||||
self.open_hotel_mode_label.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
self.open_hotel_tonkiang_var = tk.BooleanVar(value=config.open_hotel_tonkiang)
|
||||
self.open_hotel_tonkiang_checkbutton = ttk.Checkbutton(
|
||||
self.open_hotel_foodie_var = tk.BooleanVar(value=config.open_hotel_foodie)
|
||||
self.open_hotel_foodie_checkbutton = ttk.Checkbutton(
|
||||
frame_hotel_mode,
|
||||
variable=self.open_hotel_tonkiang_var,
|
||||
variable=self.open_hotel_foodie_var,
|
||||
onvalue=True,
|
||||
offvalue=False,
|
||||
command=self.update_open_hotel_tonkiang,
|
||||
text="Tonkiang",
|
||||
command=self.update_open_hotel_foodie,
|
||||
text="Foodie",
|
||||
)
|
||||
self.open_hotel_tonkiang_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
self.open_hotel_foodie_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
|
||||
self.open_hotel_fofa_var = tk.BooleanVar(value=config.open_hotel_fofa)
|
||||
self.open_hotel_fofa_checkbutton = ttk.Checkbutton(
|
||||
|
@ -88,9 +88,9 @@ class HotelUI:
|
|||
def update_open_hotel(self):
|
||||
config.set("Settings", "open_hotel", str(self.open_hotel_var.get()))
|
||||
|
||||
def update_open_hotel_tonkiang(self):
|
||||
def update_open_hotel_foodie(self):
|
||||
config.set(
|
||||
"Settings", "open_hotel_tonkiang", str(self.open_hotel_tonkiang_var.get())
|
||||
"Settings", "open_hotel_foodie", str(self.open_hotel_foodie_var.get())
|
||||
)
|
||||
|
||||
def update_open_hotel_fofa(self):
|
||||
|
@ -109,7 +109,7 @@ class HotelUI:
|
|||
def change_entry_state(self, state):
|
||||
for entry in [
|
||||
"open_hotel_checkbutton",
|
||||
"open_hotel_tonkiang_checkbutton",
|
||||
"open_hotel_foodie_checkbutton",
|
||||
"open_hotel_fofa_checkbutton",
|
||||
"region_list_combo",
|
||||
"page_num_entry",
|
||||
|
|
|
@ -36,18 +36,18 @@ class MulticastUI:
|
|||
frame_multicast_mode, text="工作模式:", width=9
|
||||
)
|
||||
self.open_multicast_mode_label.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
self.open_multicast_tonkiang_var = tk.BooleanVar(
|
||||
value=config.open_multicast_tonkiang
|
||||
self.open_multicast_foodie_var = tk.BooleanVar(
|
||||
value=config.open_multicast_foodie
|
||||
)
|
||||
self.open_multicast_tonkiang_checkbutton = ttk.Checkbutton(
|
||||
self.open_multicast_foodie_checkbutton = ttk.Checkbutton(
|
||||
frame_multicast_mode,
|
||||
variable=self.open_multicast_tonkiang_var,
|
||||
variable=self.open_multicast_foodie_var,
|
||||
onvalue=True,
|
||||
offvalue=False,
|
||||
command=self.update_open_multicast_tonkiang,
|
||||
text="Tonkiang",
|
||||
command=self.update_open_multicast_foodie,
|
||||
text="Foodie",
|
||||
)
|
||||
self.open_multicast_tonkiang_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
self.open_multicast_foodie_checkbutton.pack(side=tk.LEFT, padx=4, pady=8)
|
||||
|
||||
self.open_multicast_fofa_var = tk.BooleanVar(value=config.open_multicast_fofa)
|
||||
self.open_multicast_fofa_checkbutton = ttk.Checkbutton(
|
||||
|
@ -107,11 +107,11 @@ class MulticastUI:
|
|||
def update_open_multicast(self):
|
||||
config.set("Settings", "open_multicast", str(self.open_multicast_var.get()))
|
||||
|
||||
def update_open_multicast_tonkiang(self):
|
||||
def update_open_multicast_foodie(self):
|
||||
config.set(
|
||||
"Settings",
|
||||
"open_multicast_tonkiang",
|
||||
str(self.open_multicast_tonkiang_var.get()),
|
||||
"open_multicast_foodie",
|
||||
str(self.open_multicast_foodie_var.get()),
|
||||
)
|
||||
|
||||
def update_open_multicast_fofa(self):
|
||||
|
@ -132,7 +132,7 @@ class MulticastUI:
|
|||
def change_entry_state(self, state):
|
||||
for entry in [
|
||||
"open_multicast_checkbutton",
|
||||
"open_multicast_tonkiang_checkbutton",
|
||||
"open_multicast_foodie_checkbutton",
|
||||
"open_multicast_fofa_checkbutton",
|
||||
"region_list_combo",
|
||||
"page_num_entry",
|
||||
|
|
|
@ -65,12 +65,12 @@ class TkinterUI:
|
|||
"open_subscribe": self.subscribe_ui.open_subscribe_var.get(),
|
||||
"subscribe_urls": self.subscribe_ui.subscribe_urls_text.get(1.0, tk.END),
|
||||
"open_multicast": self.multicast_ui.open_multicast_var.get(),
|
||||
"open_multicast_tonkiang": self.multicast_ui.open_multicast_tonkiang_var.get(),
|
||||
"open_multicast_foodie": self.multicast_ui.open_multicast_foodie_var.get(),
|
||||
"open_multicast_fofa": self.multicast_ui.open_multicast_fofa_var.get(),
|
||||
"multicast_region_list": self.multicast_ui.region_list_combo.get(),
|
||||
"multicast_page_num": self.multicast_ui.page_num_entry.get(),
|
||||
"open_hotel": self.hotel_ui.open_hotel_var.get(),
|
||||
"open_hotel_tonkiang": self.hotel_ui.open_hotel_tonkiang_var.get(),
|
||||
"open_hotel_foodie": self.hotel_ui.open_hotel_foodie_var.get(),
|
||||
"open_hotel_fofa": self.hotel_ui.open_hotel_fofa_var.get(),
|
||||
"hotel_region_list": self.hotel_ui.region_list_combo.get(),
|
||||
"hotel_page_num": self.hotel_ui.page_num_entry.get(),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from utils.config import config
|
||||
import utils.constants as constants
|
||||
from utils.channel import (
|
||||
get_results_from_multicast_soup,
|
||||
get_results_from_multicast_soup_requests,
|
||||
|
@ -28,7 +29,7 @@ async def get_channels_by_hotel(callback=None):
|
|||
Get the channels by multicase
|
||||
"""
|
||||
channels = {}
|
||||
pageUrl = "http://www.foodieguide.com/iptvsearch/hoteliptv.php"
|
||||
pageUrl = constants.foodie_hotel_url
|
||||
proxy = None
|
||||
open_proxy = config.open_proxy
|
||||
open_driver = config.open_driver
|
||||
|
@ -51,7 +52,7 @@ async def get_channels_by_hotel(callback=None):
|
|||
try:
|
||||
retry_func(
|
||||
lambda: driver.get(pageUrl),
|
||||
name=f"Tonkiang hotel search:{name}",
|
||||
name=f"Foodie hotel search:{name}",
|
||||
)
|
||||
except Exception as e:
|
||||
if open_proxy:
|
||||
|
@ -68,7 +69,7 @@ async def get_channels_by_hotel(callback=None):
|
|||
try:
|
||||
page_soup = retry_func(
|
||||
lambda: get_soup_requests(pageUrl, data=post_form, proxy=proxy),
|
||||
name=f"Tonkiang hotel search:{name}",
|
||||
name=f"Foodie hotel search:{name}",
|
||||
)
|
||||
except Exception as e:
|
||||
if open_proxy:
|
||||
|
@ -144,15 +145,15 @@ async def get_channels_by_hotel(callback=None):
|
|||
pbar.update()
|
||||
if callback:
|
||||
callback(
|
||||
f"正在获取Tonkiang酒店源, 剩余{region_list_len - pbar.n}个地区待查询, 预计剩余时间: {get_pbar_remaining(n=pbar.n, total=pbar.total, start_time=start_time)}",
|
||||
f"正在获取Foodie酒店源, 剩余{region_list_len - pbar.n}个地区待查询, 预计剩余时间: {get_pbar_remaining(n=pbar.n, total=pbar.total, start_time=start_time)}",
|
||||
int((pbar.n / region_list_len) * 100),
|
||||
)
|
||||
return info_list
|
||||
|
||||
region_list_len = len(region_list)
|
||||
pbar = tqdm_asyncio(total=region_list_len, desc="Tonkiang hotel search")
|
||||
pbar = tqdm_asyncio(total=region_list_len, desc="Foodie hotel search")
|
||||
if callback:
|
||||
callback(f"正在获取Tonkiang酒店源, 共{region_list_len}个地区", 0)
|
||||
callback(f"正在获取Foodie酒店源, 共{region_list_len}个地区", 0)
|
||||
search_region_result = defaultdict(list)
|
||||
with ThreadPoolExecutor(max_workers=3) as executor:
|
||||
futures = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from utils.config import config
|
||||
import utils.constants as constants
|
||||
from utils.channel import (
|
||||
get_results_from_multicast_soup,
|
||||
get_results_from_multicast_soup_requests,
|
||||
|
@ -32,7 +33,7 @@ async def get_channels_by_multicast(names, callback=None):
|
|||
Get the channels by multicase
|
||||
"""
|
||||
channels = {}
|
||||
pageUrl = "http://www.foodieguide.com/iptvsearch/hoteliptv.php"
|
||||
pageUrl = constants.foodie_hotel_url
|
||||
proxy = None
|
||||
open_proxy = config.open_proxy
|
||||
open_driver = config.open_driver
|
||||
|
@ -148,17 +149,17 @@ async def get_channels_by_multicast(names, callback=None):
|
|||
pbar.update()
|
||||
if callback:
|
||||
callback(
|
||||
f"正在进行Tonkiang组播更新, 剩余{region_type_list_len - pbar.n}个地区待查询, 预计剩余时间: {get_pbar_remaining(n=pbar.n, total=pbar.total, start_time=start_time)}",
|
||||
f"正在进行Foodie组播更新, 剩余{region_type_list_len - pbar.n}个地区待查询, 预计剩余时间: {get_pbar_remaining(n=pbar.n, total=pbar.total, start_time=start_time)}",
|
||||
int((pbar.n / region_type_list_len) * 100),
|
||||
)
|
||||
return {"region": region, "type": type, "data": info_list}
|
||||
|
||||
if config.open_multicast_tonkiang:
|
||||
if config.open_multicast_foodie:
|
||||
region_type_list_len = len(region_type_list)
|
||||
pbar = tqdm_asyncio(total=region_type_list_len, desc="Multicast search")
|
||||
if callback:
|
||||
callback(
|
||||
f"正在进行Tonkiang组播更新, {len(names)}个频道, 共{region_type_list_len}个地区",
|
||||
f"正在进行Foodie组播更新, {len(names)}个频道, 共{region_type_list_len}个地区",
|
||||
0,
|
||||
)
|
||||
start_time = time()
|
||||
|
|
|
@ -28,32 +28,12 @@ from concurrent.futures import ThreadPoolExecutor
|
|||
from requests_custom.utils import get_soup_requests, close_session
|
||||
|
||||
|
||||
async def use_accessible_url(callback):
|
||||
"""
|
||||
Check if the url is accessible
|
||||
"""
|
||||
callback(f"正在获取最优的关键字搜索节点", 0)
|
||||
baseUrl1 = "http://www.foodieguide.com/iptvsearch/"
|
||||
baseUrl2 = "http://tonkiang.us/"
|
||||
task1 = create_task(get_speed(baseUrl1, timeout=config.request_timeout))
|
||||
task2 = create_task(get_speed(baseUrl2, timeout=config.request_timeout))
|
||||
task_results = await gather(task1, task2)
|
||||
callback(f"获取关键字搜索节点完成", 100)
|
||||
if task_results[0] == float("inf") and task_results[1] == float("inf"):
|
||||
return None
|
||||
if task_results[0] < task_results[1]:
|
||||
return baseUrl1
|
||||
else:
|
||||
return baseUrl2
|
||||
|
||||
|
||||
async def get_channels_by_online_search(names, callback=None):
|
||||
"""
|
||||
Get the channels by online search
|
||||
"""
|
||||
channels = {}
|
||||
# pageUrl = await use_accessible_url(callback)
|
||||
pageUrl = "http://www.foodieguide.com/iptvsearch/"
|
||||
pageUrl = constants.foodie_url
|
||||
if not pageUrl:
|
||||
return channels
|
||||
proxy = None
|
||||
|
|
|
@ -548,7 +548,7 @@ def append_total_data(
|
|||
data,
|
||||
hotel_fofa_result=None,
|
||||
multicast_result=None,
|
||||
hotel_tonkiang_result=None,
|
||||
hotel_foodie_result=None,
|
||||
subscribe_result=None,
|
||||
online_search_result=None,
|
||||
):
|
||||
|
@ -558,7 +558,7 @@ def append_total_data(
|
|||
total_result = [
|
||||
("hotel_fofa", hotel_fofa_result),
|
||||
("multicast", multicast_result),
|
||||
("hotel_tonkiang", hotel_tonkiang_result),
|
||||
("hotel_foodie", hotel_foodie_result),
|
||||
("subscribe", subscribe_result),
|
||||
("online_search", online_search_result),
|
||||
]
|
||||
|
|
|
@ -196,8 +196,8 @@ class ConfigManager:
|
|||
return self.config.getboolean("Settings", f"open_hotel_fofa", fallback=True)
|
||||
|
||||
@property
|
||||
def open_hotel_tonkiang(self):
|
||||
return self.config.getboolean("Settings", f"open_hotel_tonkiang", fallback=True)
|
||||
def open_hotel_foodie(self):
|
||||
return self.config.getboolean("Settings", f"open_hotel_foodie", fallback=True)
|
||||
|
||||
@property
|
||||
def open_multicast(self):
|
||||
|
@ -208,9 +208,9 @@ class ConfigManager:
|
|||
return self.config.getboolean("Settings", f"open_multicast_fofa", fallback=True)
|
||||
|
||||
@property
|
||||
def open_multicast_tonkiang(self):
|
||||
def open_multicast_foodie(self):
|
||||
return self.config.getboolean(
|
||||
"Settings", f"open_multicast_tonkiang", fallback=True
|
||||
"Settings", f"open_multicast_foodie", fallback=True
|
||||
)
|
||||
|
||||
@property
|
||||
|
@ -225,9 +225,9 @@ class ConfigManager:
|
|||
"multicast": self.open_multicast,
|
||||
"online_search": self.open_online_search,
|
||||
"hotel_fofa": self.open_hotel_fofa,
|
||||
"hotel_tonkiang": self.open_hotel_tonkiang,
|
||||
"hotel_foodie": self.open_hotel_foodie,
|
||||
"multicast_fofa": self.open_multicast_fofa,
|
||||
"multicast_tonkiang": self.open_multicast_tonkiang,
|
||||
"multicast_foodie": self.open_multicast_foodie,
|
||||
}
|
||||
|
||||
@property
|
||||
|
|
|
@ -60,3 +60,7 @@ origin_map = {
|
|||
}
|
||||
|
||||
ipv6_proxy = "http://www.ipv6proxy.net/go.php?u="
|
||||
|
||||
foodie_url = "http://www.foodieguide.com/iptvsearch/"
|
||||
|
||||
foodie_hotel_url = "http://www.foodieguide.com/iptvsearch/hoteliptv.php"
|
||||
|
|
Loading…
Reference in a new issue