Guovin / TV

📺电视直播源更新工具🚀:包含💰央视(付费)频道、📡卫视频道、🏠广东频道、🌊港·澳·台频道、🎬电影频道、🎥咪咕直播;支持自定义增加频道(含图标);支持组播源、酒店源、订阅源、线上检索;每天自动更新两次,结果可用于TVBox等播放软件;支持工作流、Docker(amd64/arm64)、命令行、软件界面多种部署/运行方式 | Live TV source update tool
MIT License
752 stars 445 forks source link

是否可以支持包含IPV4与IPV6结尾标记的直播源测试,并考虑增加测试后生成文件添加结尾标记 #385

Open FRANKASEE opened 3 hours ago

FRANKASEE commented 3 hours ago

如下示例: 凤凰资讯,http://118.251.63.148:8888/udp/239.76.246.135:1234$IPV4『线路1』 凤凰资讯,http://124.230.56.55:55555/udp/239.76.246.135:1234$IPV4『线路2』 凤凰资讯,http://124.230.56.93:55555/udp/239.76.246.135:1234$IPV4『线路3』 凤凰资讯,http://[2409:8087:2001:20:2800:0:df6e:eb27]/ott.mobaibox.com/PLTV/3/224/3221228524/index.m3u8$IPV6『线路4』 凤凰资讯,http://[2409:8087:2001:20:2800:0:df6e:eb27]/ott.mobaibox.com/PLTV/3/224/3221228524/index.m3u8$IPV6『线路5

Guovin commented 3 hours ago

目前IPv6的接口都会添加$IPv6,其余IPv4则默认不添加

FRANKASEE commented 2 hours ago

能否把IPV6和IPV4分别设置获取数量, 比如:

提取前20个IPv6和前20个IPv4的直播源

                        ipv6_streams = [url for url in filtered_urls if is_ipv6(url)][:20]
                        ipv4_streams = [url for url in filtered_urls if not is_ipv6(url)][:20]

                        # 将IPv6放在前面,IPv4放在后面
                        combined_streams = ipv6_streams + ipv4_streams

                        total_urls = len(combined_streams)
                        for index, url in enumerate(combined_streams, start=1):
                            if is_ipv6(url):
                                url_suffix = f"$IPV6" if total_urls == 1 else f"$IPV6『线路{index}』"
                            else:
                                url_suffix = f"$IPV4" if total_urls == 1 else f"$IPV4『线路{index}』"
                            base_url = url.split('$', 1)[0] if '$' in url else url
                            new_url = f"{base_url}{url_suffix}"
FRANKASEE commented 2 hours ago

这个逻辑是先测试出IPV6和IPV4各50个有效的结果,再对延迟结果从小到大排序,提取延迟低的20个IPV6和IPV4作为最终生成的文件。还可以根据每个人的使用习惯不同,可以自己设置IPV6在前,还是IPV4在前。

Guovin commented 2 hours ago

好提议,关于接口协议偏好设置会与接口来源偏好设置一起在后面的版本实现

FRANKASEE commented 2 hours ago

期待