From c550e65b77763222b6f4051c11b53817a1ad2b2b Mon Sep 17 00:00:00 2001 From: "guorong.zheng" <360996299@qq.com> Date: Tue, 12 Nov 2024 16:31:56 +0800 Subject: [PATCH 1/2] feat:foodie --- config/config.ini | 4 +- docs/config.md | 94 ++++++++++++++++---------------- docs/config_en.md | 94 ++++++++++++++++---------------- main.py | 10 ++-- tkinter_ui/hotel.py | 18 +++--- tkinter_ui/multicast.py | 22 ++++---- tkinter_ui/tkinter_ui.py | 4 +- updates/hotel/request.py | 13 +++-- updates/multicast/request.py | 9 +-- updates/online_search/request.py | 22 +------- utils/channel.py | 4 +- utils/config.py | 12 ++-- utils/constants.py | 4 ++ 13 files changed, 148 insertions(+), 162 deletions(-) diff --git a/config/config.ini b/config/config.ini index 242ba7bcc02..8a470ddc300 100644 --- a/config/config.ini +++ b/config/config.ini @@ -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 diff --git a/docs/config.md b/docs/config.md index 99ebee1c9eb..af3f085dbe7 100644 --- a/docs/config.md +++ b/docs/config.md @@ -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 | 开启显示接口说明信息,用于控制是否显示分辨率、接口协议类型等信息,为$符号后的内容,播放软件使用该信息对接口进行描述 | diff --git a/docs/config_en.md b/docs/config_en.md index b1faabdf640..0462d9c83f2 100644 --- a/docs/config_en.md +++ b/docs/config_en.md @@ -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 | diff --git a/main.py b/main.py index c0a31bfa937..7088327d408 100644 --- a/main.py +++ b/main.py @@ -71,7 +71,7 @@ def __init__(self): 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 @@ async def visit_page(self, channel_names=None): 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 @@ async def visit_page(self, channel_names=None): 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 @@ async def visit_page(self, channel_names=None): 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 @@ async def main(self): 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, ) diff --git a/tkinter_ui/hotel.py b/tkinter_ui/hotel.py index c70c2725e61..debeb99ad91 100644 --- a/tkinter_ui/hotel.py +++ b/tkinter_ui/hotel.py @@ -34,16 +34,16 @@ def init_ui(self, root): 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 @@ def init_ui(self, root): 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 @@ def update_page_num(self, event): 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", diff --git a/tkinter_ui/multicast.py b/tkinter_ui/multicast.py index a0681405829..3105e466a2c 100644 --- a/tkinter_ui/multicast.py +++ b/tkinter_ui/multicast.py @@ -36,18 +36,18 @@ def init_ui(self, root): 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 @@ def init_ui(self, root): 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 @@ def update_page_num(self, event): 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", diff --git a/tkinter_ui/tkinter_ui.py b/tkinter_ui/tkinter_ui.py index fb29d2a9216..f5388088002 100644 --- a/tkinter_ui/tkinter_ui.py +++ b/tkinter_ui/tkinter_ui.py @@ -65,12 +65,12 @@ def save_config(self): "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(), diff --git a/updates/hotel/request.py b/updates/hotel/request.py index fa61d8ea50f..08c3fd28d65 100644 --- a/updates/hotel/request.py +++ b/updates/hotel/request.py @@ -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 @@ def process_region_by_hotel(region): 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 @@ def process_region_by_hotel(region): 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 @@ def process_region_by_hotel(region): 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 = { diff --git a/updates/multicast/request.py b/updates/multicast/request.py index f97dc59d496..5b12feed4c0 100644 --- a/updates/multicast/request.py +++ b/updates/multicast/request.py @@ -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 @@ def process_channel_by_multicast(region, type): 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() diff --git a/updates/online_search/request.py b/updates/online_search/request.py index 6bbbf93276e..7106d61509f 100644 --- a/updates/online_search/request.py +++ b/updates/online_search/request.py @@ -28,32 +28,12 @@ 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 diff --git a/utils/channel.py b/utils/channel.py index 78b6655462c..b5f2d13ed0e 100644 --- a/utils/channel.py +++ b/utils/channel.py @@ -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), ] diff --git a/utils/config.py b/utils/config.py index ea711309fff..447039c8cc2 100644 --- a/utils/config.py +++ b/utils/config.py @@ -196,8 +196,8 @@ def open_hotel_fofa(self): 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 @@ def open_multicast_fofa(self): 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 @@ def open_method(self): "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 diff --git a/utils/constants.py b/utils/constants.py index 53028673b33..24190d05fd7 100644 --- a/utils/constants.py +++ b/utils/constants.py @@ -60,3 +60,7 @@ } 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" From c5ac87ead4a4494405fb24693152107e3507b01f Mon Sep 17 00:00:00 2001 From: "guorong.zheng" <360996299@qq.com> Date: Tue, 12 Nov 2024 17:59:29 +0800 Subject: [PATCH 2/2] update:fofa cache --- updates/fofa/fofa_hotel_region_result.pkl | Bin 20197 -> 42796 bytes updates/fofa/fofa_multicast_region_result.pkl | Bin 1046 -> 1062 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/updates/fofa/fofa_hotel_region_result.pkl b/updates/fofa/fofa_hotel_region_result.pkl index 6954a64d647ed7e7b22474fdd40a2e048f5d4496..b6d8fe42af5b6998704d967e28820afeff84f55f 100644 GIT binary patch literal 42796 zcmd5_{caT374IJjRVqu7`UaIygj8vE?#%4&%t|PEg1kYSZtSI45M-4#g?@=RF@|&u z7>sQSAx%UIEeW+#5ZK`OWjy=w7CCojcW3RLJ9F+mXG|j{Lb32YbMEi=J70J1Tz>1$ zuO9s@{^zf&C&IUTlqWADwQu=NgrY7g&z#S+1~zEgE&(_U32g|Np>oJPUqi zIZmT$+xGD&T;JdMuD^II+F9@H-2BUQbNY0vq5LhYAAY#B8ZHceE`)D69{ek6R@H6z zw(nQk=TFU^ZB@?BUT9Td0r8QrK5^&$_s_I0oorv6ooiosZ|-dKlKlBe@m_PjeR_80 zqFO(baSiT#3+td%a;1d9#;l0{bNcN0 ziilZ)z@?b@_3`qpg!#3Y`Dl>VI2fq_sm|80*da17kZjGLiF^^3?{E>OP$ijsF|kh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ax*do!tzW3mR+Uk!4YFeM}PQ5__L~T(4?TEizpV;0&ow?P)&{m$Sy$tWF|pj zi^k%^zZRANl?qT!mK%4yGLAi6fh(bWEE>ggXwDkJJ+BSL>*zc;+n>0&1Iok}T+N}v zh4s`y`Lk|Qa3odJSh7_^#A-LZEa^ujm`*Fk&l`PQs}0MW7%u0z5Vj^SQD-Z8ig@=( z9?`cyFZAd<+XPRM%sF^Fe?M1&+hs1KzmVjyiOEd2^6}vWm-)e&$RD3C z!0+*(u#k|m1q_c1t+;L9jJ7xOIsbO}yiVLHrnY{5Ipik0d+p}m0+0o#ps^hFyC8hDoCYXydFq39QYn0Ti>?DU)s@%9%yZYyEgSo zLWLFks>LhtdM5SBI$d);H8^5cXJ;|SpSV=7HQ~bdbrjJL4VqvVT3&O5b!pR@i(8*k zFpawykIbxobyB^2iQ8O*W4n`9#T&Jewc*_+fqL-4sQTRr(N=o1)|ULC_b#S_2Ha{M z7b#A+CQ{7Bsg`y=iDqtuItrhs7V~>GJu)t~F)_mLZ5OR*p!;*NRS@&joL})V9QIp< zN43Wj-nroIp!zTSv;{G%<0tQ*E=cJJM-P~7$WvV2OOvlW$W>|rYOFnAuT>9BE1R%eZ)4` zPj~X)rhcP+emv^W!uhZZI|mdgfRDnTpn5_^_n<=`{(JA}3tTQ1xbGlM(9)n^->y=z zUCYxHqGgE1?hMsRh!4qVe&2`8VG}$@J`>;3qvAVNJwF?tAIEP)MQ|!IpT$xs5W9H1 zD-Hc)1-LfKU5glE(y6Kxejp<>!AybG-$WUD$BJT4Fl<20q>L|4Gt5jHu>Z^n@xAe5 JmJ%4)@;{K?H4gv) diff --git a/updates/fofa/fofa_multicast_region_result.pkl b/updates/fofa/fofa_multicast_region_result.pkl index 9f0724fff017a73fcb51e2d0648493a21b6308b5..54f5091642f63557e593358e02684cb021d39fc2 100644 GIT binary patch delta 60 zcmbQnv5bSIfn}=nL>5nJjUKk=Q?@?Yzi>+Ilpe--AX(bO_GCxbv#r}F7ch#lX7B(- PCYEV4W$