├── Z_00_cctv.txt ├── Z_11_cctv.txt ├── Z_12_cctv.txt ├── Z_13_cctv.txt ├── Z_14_cctv.txt ├── Z_15_cctv.txt ├── Z_21_cctv.txt ├── Z_22_cctv.txt ├── Z_23_cctv.txt ├── duliip.txt ├── pingdao.txt ├── Z_00_weishi.txt ├── Z_11_weishi.txt ├── Z_12_weishi.txt ├── Z_13_weishi.txt ├── Z_14_weishi.txt ├── Z_15_weishi.txt ├── Z_21_weishi.txt ├── Z_22_weishi.txt ├── Z_23_weishi.txt ├── bywork ├── 1.txt ├── weishi.py └── ktpd.py ├── hotel_bak.py ├── unicom-test.txt ├── unicom24-113-64-145-105.txt ├── xiangang.txt ├── itv_fofa.txt ├── seekip_ok.txt ├── S_CCTV.txt ├── ssili126.png ├── S_weishi.txt ├── config.py ├── Pipfile ├── 123.py ├── 20_cctv.txt ├── 13_weishi.txt ├── temp ├── backup.txt └── ip_head.py ├── 22_cctv.txt ├── 21_cctv.txt ├── cfg_ip.txt ├── source.json ├── 13_cctv.txt ├── 23_cctv.txt ├── duliip_49_87_154.txt ├── 12_cctv.txt ├── 15_cctv.txt ├── test.py ├── .github └── workflows │ ├── ffmpeg.yml │ ├── main.yml │ ├── allrun.yml │ ├── itv.yml │ ├── itv_fofa.yml │ ├── weishi.yml │ └── cctv.yml ├── 20_weishi.txt ├── 22_weishi.txt ├── 1.txt ├── LICENSE ├── url_ffmpeg.py ├── itv_fofa.py ├── 11_cctv.txt ├── 21_weishi.txt ├── editfiles.py ├── duliip_219_137_29.txt ├── ip_qianxin_check.py ├── unicom_182_123_72.txt ├── unicom22_182_122_73.txt ├── new_file.txt ├── 23_weishi.txt ├── prv_cctv.txt ├── 12_weishi.txt ├── 15_weishi.txt ├── unicom21_61_52_158.txt ├── prv_weishi.txt ├── 11_weishi.txt ├── duliip_36_99_132.txt ├── unicom23_221_5_12.txt ├── ip_head.py ├── duliip_113_15_187.txt ├── duliip_222_218_158.txt ├── duliip_219_159_194.txt ├── pindao.py ├── README.md ├── xiangang.py ├── duliip_119_54_9.txt ├── seektv.py ├── duliip_sx.txt ├── mywlkj_gt.txt ├── duliip_113_64_145.txt ├── mywlkj.txt ├── ip_check.py ├── weishi.py ├── iptv.py ├── hotel_duli_ip.py ├── nanxun_tv.py ├── itv.py └── ktpd.py /Z_00_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_11_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_12_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_13_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_14_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_15_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_21_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_22_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_23_cctv.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /duliip.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pingdao.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_00_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_11_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_12_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_13_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_14_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_15_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_21_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_22_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Z_23_weishi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bywork/1.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hotel_bak.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /unicom-test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unicom24-113-64-145-105.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xiangang.txt: -------------------------------------------------------------------------------- 1 | 【 港澳台频道 】,#genre# 2 | -------------------------------------------------------------------------------- /itv_fofa.txt: -------------------------------------------------------------------------------- 1 | 最近更新时间:2024-03-21 17:45:25 2 | -------------------------------------------------------------------------------- /seekip_ok.txt: -------------------------------------------------------------------------------- 1 | 测试完成时间,2025-04-15 12:25:30 2 | -------------------------------------------------------------------------------- /S_CCTV.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ssili126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xzw832/cmys/HEAD/ssili126.png -------------------------------------------------------------------------------- /S_weishi.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | source_file = "demo.txt" 2 | final_file = "result.txt" 3 | favorite_list = [ 4 | "凤凰", 5 | "汕头", 6 | ] 7 | favorite_page_num = 1 8 | default_page_num = 1 9 | urls_limit = 8 10 | response_time_weight = 0.5 11 | resolution_weight = 0.5 12 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [scripts] 7 | build = "python main.py" 8 | 9 | [dev-packages] 10 | 11 | [packages] 12 | requests = "*" 13 | feedparser = "*" 14 | pytz = "*" 15 | selenium = "*" 16 | selenium-stealth = "*" 17 | aiohttp = "*" 18 | bs4 = "*" 19 | 20 | [requires] 21 | python_version = "*" -------------------------------------------------------------------------------- /123.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | channel_url = 'http://mywlkj.ddns.net:754/tv/1905.php?id=cctv6' # 替换为你想测试的URL 4 | response = requests.get(channel_url, allow_redirects=True) 5 | 6 | # 检查是否有重定向发生 7 | if response.history: 8 | # 如果有重定向历史,说明发生了重定向 9 | print("发生了重定向") 10 | # 获取最终重定向到的地址 11 | final_url = response.url 12 | print("最终地址:", final_url) 13 | else: 14 | # 如果没有重定向历史,说明没有发生重定向 15 | print("没有发生重定向") 16 | # 返回原始请求的地址 17 | original_url = url 18 | print("原始地址:", original_url) 19 | -------------------------------------------------------------------------------- /20_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_联通,http://20_央卫秒开/hls/1/index.m3u8 2 | CCTV10_联通,http://20_央卫秒开/hls/10/index.m3u8 3 | CCTV11_联通,http://20_央卫秒开/hls/11/index.m3u8 4 | CCTV12法制_联通,http://20_央卫秒开/hls/12/index.m3u8 5 | CCTV13_联通,http://20_央卫秒开/hls/13/index.m3u8 6 | CCTV14_联通,http://20_央卫秒开/hls/14/index.m3u8 7 | CCTV15_联通,http://20_央卫秒开/hls/15/index.m3u8 8 | CCTV2经济_联通,http://20_央卫秒开/hls/2/index.m3u8 9 | CCTV3_联通,http://20_央卫秒开/hls/3/index.m3u8 10 | CCTV5_联通,http://20_央卫秒开/hls/5/index.m3u8 11 | CCTV6_联通,http://20_央卫秒开/hls/6/index.m3u8 12 | CCTV7_联通,http://20_央卫秒开/hls/7/index.m3u8 13 | CCTV8_联通,http://20_央卫秒开/hls/8/index.m3u8 14 | CCTV9_联通,http://20_央卫秒开/hls/9/index.m3u8 15 | -------------------------------------------------------------------------------- /13_weishi.txt: -------------------------------------------------------------------------------- 1 | 东方卫视_电信,http://13_央卫秒开/tsfile/live/0107_1.m3u8 2 | 南方卫视_电信,http://13_央卫秒开/tsfile/live/1000_1.m3u8 3 | 广东体育_电信,http://13_央卫秒开/tsfile/live/0142_1.m3u8 4 | 广东公共_电信,http://13_央卫秒开/tsfile/live/1004_1.m3u8 5 | 广东卫视_电信,http://13_央卫秒开/tsfile/live/0125_1.m3u8 6 | 广东新闻_电信,http://13_央卫秒开/tsfile/live/1005_1.m3u8 7 | 广东珠江_电信,http://13_央卫秒开/tsfile/live/1006_1.m3u8 8 | 广东综合_电信,http://13_央卫秒开/tsfile/live/1001_1.m3u8 9 | 广州影视_电信,http://13_央卫秒开/tsfile/live/1003_1.m3u8 10 | 广州新闻_电信,http://13_央卫秒开/tsfile/live/1002_1.m3u8 11 | 江苏卫视_电信,http://13_央卫秒开/tsfile/live/0127_1.m3u8 12 | 浙江卫视_电信,http://13_央卫秒开/tsfile/live/0124_1.m3u8 13 | 湖南卫视_电信,http://13_央卫秒开/tsfile/live/0128_1.m3u8 14 | -------------------------------------------------------------------------------- /temp/backup.txt: -------------------------------------------------------------------------------- 1 | 失效连接,#genre# 2 | 14_央卫秒开,http://113.64.145.220:8081/hls/138/index.m3u8 3 | 15_央卫秒开,http://219.159.194.196:8181/tsfile/live/0013_1.m3u8 4 | 0_央卫秒开,http://59.32.97.236:9901/tsfile/live/1140_1.m3u8 5 | 12_央卫秒开,http://222.218.158.31:8181/tsfile/live/0001_1.m3u8 6 | 0_央卫秒开,http://119.125.134.113:9901/tsfile/live/1152_1.m3u8 7 | 有效连接,#genre# 8 | 汕头经济生活_电信,http://119.23.60.89:8460/udp/239.253.43.46:5146 9 | 汕头文旅体育_电信,http://119.23.60.89:8460/udp/239.253.43.47:5146 10 | 13_央卫秒开,http://219.137.29.213:4433/tsfile/live/0125_1.m3u8 11 | 16_央卫秒开,http://113.15.187.233:8181/tsfile/live/0013_1.m3u8 12 | 11_央卫秒开,http://119.54.9.159:9999/hls/1/index.m3u8 13 | 测试完成时间,2024-04-08 11:08:54 14 | -------------------------------------------------------------------------------- /22_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_联通,http://22_央卫秒开/hls/1/index.m3u8 2 | CCTV10_联通,http://22_央卫秒开/hls/10/index.m3u8 3 | CCTV11_联通,http://22_央卫秒开/hls/11/index.m3u8 4 | CCTV12_联通,http://22_央卫秒开/hls/12/index.m3u8 5 | CCTV13_联通,http://22_央卫秒开/hls/13/index.m3u8 6 | CCTV14_联通,http://22_央卫秒开/hls/14/index.m3u8 7 | CCTV15_联通,http://22_央卫秒开/hls/15/index.m3u8 8 | CCTV2_联通,http://22_央卫秒开/hls/2/index.m3u8 9 | CCTV3_联通,http://22_央卫秒开/hls/3/index.m3u8 10 | CCTV4_联通,http://22_央卫秒开/hls/4/index.m3u8 11 | CCTV5_联通,http://22_央卫秒开/hls/5/index.m3u8 12 | CCTV6_联通,http://22_央卫秒开/hls/6/index.m3u8 13 | CCTV7_联通,http://22_央卫秒开/hls/7/index.m3u8 14 | CCTV8_联通,http://22_央卫秒开/hls/8/index.m3u8 15 | CCTV9_联通,http://22_央卫秒开/hls/9/index.m3u8 16 | -------------------------------------------------------------------------------- /21_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_联通,http://21_央卫秒开/hls/1/index.m3u8 2 | CCTV10_联通,http://21_央卫秒开/hls/10/index.m3u8 3 | CCTV11_联通,http://21_央卫秒开/hls/11/index.m3u8 4 | CCTV12_联通,http://21_央卫秒开/hls/12/index.m3u8 5 | CCTV13_联通,http://21_央卫秒开/hls/13/index.m3u8 6 | CCTV14_联通,http://21_央卫秒开/hls/14/index.m3u8 7 | CCTV15_联通,http://21_央卫秒开/hls/15/index.m3u8 8 | CCTV2_联通,http://21_央卫秒开/hls/2/index.m3u8 9 | CCTV3_联通,http://21_央卫秒开/hls/3/index.m3u8 10 | CCTV4_联通,http://21_央卫秒开/hls/4/index.m3u8 11 | CCTV5_联通,http://21_央卫秒开/hls/5/index.m3u8 12 | CCTV6_联通,http://21_央卫秒开/hls/6/index.m3u8 13 | CCTV7_联通,http://21_央卫秒开/hls/7/index.m3u8 14 | CCTV8_联通,http://21_央卫秒开/hls/8/index.m3u8 15 | CCTV9_联通,http://21_央卫秒开/hls/9/index.m3u8 16 | IPTV5+_联通,http://21_央卫秒开/hls/75/index.m3u8 17 | -------------------------------------------------------------------------------- /cfg_ip.txt: -------------------------------------------------------------------------------- 1 | 失效连接,#genre# 2 | 13_央卫秒开,http://219.137.29.213:4433/tsfile/live/0125_1.m3u8 3 | 22_央卫秒开,http://182.122.73.119:8089/hls/1/index.m3u8 4 | 23_央卫秒开,http://221.5.12.130:2223/hls/62/index.m3u8 5 | 16_央卫秒开,http://113.15.187.162:8181/tsfile/live/0013_1.m3u8 6 | 15_央卫秒开,http://219.159.194.200:8181/tsfile/live/0013_1.m3u8 7 | 11_央卫秒开,http://119.54.9.159:9999/hls/1/index.m3u8 8 | 0_央卫秒开,http://119.125.134.141:9901/tsfile/live/1152_1.m3u8 9 | 12_央卫秒开,http://222.218.158.141:8181/tsfile/live/0001_1.m3u8 10 | 14_央卫秒开,http://113.64.145.220:8081/hls/138/index.m3u8 11 | 21_央卫秒开,http://61.52.158.236:808/hls/1/index.m3u8 12 | 汕头文旅体育_电信,http://119.23.60.89:8460/udp/239.253.43.47:5146 13 | 汕头经济生活_电信,http://119.23.60.89:8460/udp/239.253.43.46:5146 14 | 有效连接,#genre# 15 | 测试完成时间,2025-04-15 12:25:29 16 | -------------------------------------------------------------------------------- /source.json: -------------------------------------------------------------------------------- 1 | { 2 | "urls": [ 3 | { "url": "http://www.饭太硬.top/tv", "name": "饭太硬" }, 4 | { "url": "http://fan.xxooo.cf/tv", "name": "饭太硬(备用)" }, 5 | { "url": "http://xhww.fun/小米/DEMO.json", "name": "小米" }, 6 | { "url": "http://肥猫.live", "name": "肥猫" }, 7 | { "url": "https://tvbox.cainisi.cf", "name": "菜妮丝" }, 8 | { "url": "https://agit.ai/Yoursmile7/TVBox/raw/branch/master/XC.json", "name": "南风" }, 9 | { "url": "https://100km.top/0", "name": "骚零" }, 10 | { "url": "http://tv.rihou.cc/天天开心", "name": "天天开心" }, 11 | { "url": "http://rihou.cc:88/荷城茶秀", "name": "荷城茶秀" }, 12 | { "url": "https://agit.ai/hu/hcr/raw/branch/master/短剧.json", "name": "短剧频道" }, 13 | { "url": "https://jihulab.com/ymz1231/xymz/-/raw/main/ymshaoer", "name": "少儿频道" } 14 | ] 15 | } -------------------------------------------------------------------------------- /13_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_电信,http://13_央卫秒开/tsfile/live/0001_1.m3u8 2 | CCTV10_电信,http://13_央卫秒开/tsfile/live/0010_1.m3u8 3 | CCTV11_电信,http://13_央卫秒开/tsfile/live/0011_1.m3u8 4 | CCTV12_电信,http://13_央卫秒开/tsfile/live/0012_1.m3u8 5 | CCTV13_电信,http://13_央卫秒开/tsfile/live/0013_1.m3u8 6 | CCTV14_电信,http://13_央卫秒开/tsfile/live/0014_1.m3u8 7 | CCTV15_电信,http://13_央卫秒开/tsfile/live/0015_1.m3u8 8 | CCTV2_电信,http://13_央卫秒开/tsfile/live/0002_1.m3u8 9 | CCTV3_电信,http://13_央卫秒开/tsfile/live/0003_1.m3u8 10 | CCTV4_电信,http://13_央卫秒开/tsfile/live/0004_1.m3u8 11 | CCTV5+_电信,http://13_央卫秒开/tsfile/live/0016_1.m3u8 12 | CCTV5_电信,http://13_央卫秒开/tsfile/live/0005_1.m3u8 13 | CCTV6_电信,http://13_央卫秒开/tsfile/live/0006_1.m3u8 14 | CCTV7_电信,http://13_央卫秒开/tsfile/live/0007_1.m3u8 15 | CCTV8_电信,http://13_央卫秒开/tsfile/live/0008_1.m3u8 16 | CCTV9_电信,http://13_央卫秒开/tsfile/live/0009_1.m3u8 17 | -------------------------------------------------------------------------------- /23_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_联通,http://23_央卫秒开/hls/23/index.m3u8 2 | CCTV2_联通,http://23_央卫秒开/hls/73/index.m3u8 3 | CCTV10_联通,http://23_央卫秒开/hls/56/index.m3u8 4 | CCTV11_联通,http://23_央卫秒开/hls/60/index.m3u8 5 | CCTV12_联通,http://23_央卫秒开/hls/81/index.m3u8 6 | CCTV13_联通,http://23_央卫秒开/hls/65/index.m3u8 7 | CCTV14_联通,http://23_央卫秒开/hls/84/index.m3u8 8 | CCTV15_联通,http://23_央卫秒开/hls/70/index.m3u8 9 | CCTV3_联通,http://23_央卫秒开/hls/24/index.m3u8 10 | CCTV4_联通,http://23_央卫秒开/hls/74/index.m3u8 11 | CCTV5+_联通,http://23_央卫秒开/hls/91/index.m3u8 12 | CCTV5_联通,http://23_央卫秒开/hls/89/index.m3u8 13 | CCTV6_联通,http://23_央卫秒开/hls/75/index.m3u8 14 | CCTV7_联通,http://23_央卫秒开/hls/79/index.m3u8 15 | CCTV8_联通,http://23_央卫秒开/hls/80/index.m3u8 16 | CCTV9_联通,http://23_央卫秒开/hls/90/index.m3u8 17 | CCTV风云音乐_联通,http://23_央卫秒开/hls/70/index.m3u8 18 | CCTV风云足球_联通,http://23_央卫秒开/hls/85/index.m3u8 19 | -------------------------------------------------------------------------------- /duliip_49_87_154.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://49.87.154.246:9901/tsfile/live/0001_1.m3u8 2 | CCTV13,http://49.87.154.246:9901/tsfile/live/1001_1.m3u8 3 | CCTV8,http://49.87.154.246:9901/tsfile/live/0008_1.m3u8 4 | 优漫卡通,http://49.87.154.246:9901/tsfile/live/1026_1.m3u8 5 | 动漫秀场,http://49.87.154.246:9901/tsfile/live/1027_1.m3u8 6 | 吉林卫视,http://49.87.154.246:9901/tsfile/live/0116_1.m3u8 7 | 四川卫视,http://49.87.154.246:9901/tsfile/live/0123_1.m3u8 8 | 安徽卫视,http://49.87.154.246:9901/tsfile/live/0130_1.m3u8 9 | 山西卫视,http://49.87.154.246:9901/tsfile/live/0118_1.m3u8 10 | 江苏体育休闲,http://49.87.154.246:9901/tsfile/live/1009_1.m3u8 11 | 江苏城市,http://49.87.154.246:9901/tsfile/live/1007_1.m3u8 12 | 河南卫视,http://49.87.154.246:9901/tsfile/live/0139_1.m3u8 13 | 法治天地,http://49.87.154.246:9901/tsfile/live/1031_1.m3u8 14 | 都市剧场,http://49.87.154.246:9901/tsfile/live/1028_1.m3u8 15 | 风云剧场,http://49.87.154.246:9901/tsfile/live/1030_1.m3u8 16 | -------------------------------------------------------------------------------- /12_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_电信,http://12_央卫秒开/tsfile/live/0001_1.m3u8 2 | CCTV10_电信,http://12_央卫秒开/tsfile/live/0010_1.m3u8 3 | CCTV11_电信,http://12_央卫秒开/tsfile/live/0011_1.m3u8 4 | CCTV12_电信,http://12_央卫秒开/tsfile/live/0012_1.m3u8 5 | CCTV13_电信,http://12_央卫秒开/tsfile/live/0013_1.m3u8 6 | CCTV14_电信,http://12_央卫秒开/tsfile/live/0014_1.m3u8 7 | CCTV15_电信,http://12_央卫秒开/tsfile/live/0015_1.m3u8 8 | CCTV16_电信,http://12_央卫秒开/tsfile/live/1021_1.m3u8 9 | CCTV17_电信,http://12_央卫秒开/tsfile/live/0019_1.m3u8 10 | CCTV2_电信,http://12_央卫秒开/tsfile/live/0002_1.m3u8 11 | CCTV3_电信,http://12_央卫秒开/tsfile/live/0003_1.m3u8 12 | CCTV4_电信,http://12_央卫秒开/tsfile/live/0004_1.m3u8 13 | CCTV5+_电信,http://12_央卫秒开/tsfile/live/0016_1.m3u8 14 | CCTV5_电信,http://12_央卫秒开/tsfile/live/0005_1.m3u8 15 | CCTV6_电信,http://12_央卫秒开/tsfile/live/0006_1.m3u8 16 | CCTV7_电信,http://12_央卫秒开/tsfile/live/0007_1.m3u8 17 | CCTV8_电信,http://12_央卫秒开/tsfile/live/0008_1.m3u8 18 | CCTV9_电信,http://12_央卫秒开/tsfile/live/0009_1.m3u8 19 | -------------------------------------------------------------------------------- /15_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_电信,http://15_央卫秒开/tsfile/live/0001_1.m3u8 2 | CCTV10_电信,http://15_央卫秒开/tsfile/live/0010_1.m3u8 3 | CCTV11_电信,http://15_央卫秒开/tsfile/live/0011_1.m3u8 4 | CCTV12_电信,http://15_央卫秒开/tsfile/live/0012_1.m3u8 5 | CCTV13_电信,http://15_央卫秒开/tsfile/live/0013_1.m3u8 6 | CCTV14_电信,http://15_央卫秒开/tsfile/live/0014_1.m3u8 7 | CCTV15_电信,http://15_央卫秒开/tsfile/live/0015_1.m3u8 8 | CCTV16_电信,http://15_央卫秒开/tsfile/live/1021_1.m3u8 9 | CCTV17_电信,http://15_央卫秒开/tsfile/live/0019_1.m3u8 10 | CCTV2_电信,http://15_央卫秒开/tsfile/live/0002_1.m3u8 11 | CCTV3_电信,http://15_央卫秒开/tsfile/live/0003_1.m3u8 12 | CCTV4_电信,http://15_央卫秒开/tsfile/live/0004_1.m3u8 13 | CCTV5+_电信,http://15_央卫秒开/tsfile/live/0016_1.m3u8 14 | CCTV5_电信,http://15_央卫秒开/tsfile/live/0005_1.m3u8 15 | CCTV6_电信,http://15_央卫秒开/tsfile/live/0006_1.m3u8 16 | CCTV7_电信,http://15_央卫秒开/tsfile/live/0007_1.m3u8 17 | CCTV8_电信,http://15_央卫秒开/tsfile/live/0008_1.m3u8 18 | CCTV9_电信,http://15_央卫秒开/tsfile/live/0009_1.m3u8 19 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import time 2 | import requests 3 | 4 | # ll是电视直播源的链接列表 5 | ll=['http://110.185.240.85:6066/udp/239.93.0.66:5140', 6 | 'http://115.215.255.252:4022/rtp/233.50.201.246:5140', 7 | 'http://115.216.16.105:8090/rtp/233.50.201.246:5140', 8 | 'http://118.113.157.84:4022/udp/239.93.0.66:5140' 9 | ] 10 | headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} 11 | se=requests.Session() 12 | 13 | for i in ll: 14 | now=time.time() 15 | try: 16 | res=se.get(i,headers=headers,timeout=5,stream=True) 17 | if res.status_code==200: 18 | for k in res.iter_content(chunk_size=1048576): 19 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 20 | # 如果能获取视频流,则输出读取的时间以及链接 21 | if k: 22 | print(f'{time.time()-now:.2f}\t{i}') 23 | break 24 | except Exception: 25 | # 无法连接并超时的情况下输出“X” 26 | print(f'X\t{i}') 27 | -------------------------------------------------------------------------------- /.github/workflows/ffmpeg.yml: -------------------------------------------------------------------------------- 1 | name: Get Live Source Resolution 2 | 3 | on: 4 | # 手动运行 5 | workflow_dispatch: 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repository 12 | uses: actions/checkout@v2 13 | 14 | # 安装FFmpeg 15 | - name: Install FFmpeg 16 | run: | 17 | sudo apt-get update 18 | sudo apt-get install -y ffmpeg 19 | 20 | # 设置FFmpeg路径到PATH环境变量 21 | - name: Add FFmpeg to PATH 22 | run: | 23 | echo "export PATH=$PATH:/usr/bin/ffmpeg" >> $GITHUB_ENV 24 | 25 | # 设置Python环境 26 | - name: Set up Python 27 | uses: actions/setup-python@v2 28 | with: 29 | python-version: 3.9 30 | 31 | # 安装ffmpeg-python库 32 | - name: Install ffmpeg-python 33 | run: | 34 | pip install ffmpeg-python 35 | 36 | # 运行你的Python脚本 37 | - name: Run your Python script 38 | run: | 39 | python /home/runner/work/cmys/cmys/url_ffmpeg.py 40 | -------------------------------------------------------------------------------- /20_weishi.txt: -------------------------------------------------------------------------------- 1 | 东南卫视_联通,http://20_央卫秒开/hls/33/index.m3u8 2 | 东方卫视_联通,http://20_央卫秒开/hls/21/index.m3u8 3 | 云南卫视_联通,http://20_央卫秒开/hls/30/index.m3u8 4 | 北京卫视_联通,http://20_央卫秒开/hls/20/index.m3u8 5 | 吉林卫视_联通,http://20_央卫秒开/hls/39/index.m3u8 6 | 四川卫视_联通,http://20_央卫秒开/hls/28/index.m3u8 7 | 天津卫视_联通,http://20_央卫秒开/hls/22/index.m3u8 8 | 安徽卫视_联通,http://20_央卫秒开/hls/24/index.m3u8 9 | 山东卫视_联通,http://20_央卫秒开/hls/23/index.m3u8 10 | 山西卫视_联通,http://20_央卫秒开/hls/40/index.m3u8 11 | 广东卫视_联通,http://20_央卫秒开/hls/35/index.m3u8 12 | 广西卫视_联通,http://20_央卫秒开/hls/36/index.m3u8 13 | 旅游卫视_联通,http://20_央卫秒开/hls/38/index.m3u8 14 | 江苏卫视_联通,http://20_央卫秒开/hls/18/index.m3u8 15 | 江西卫视_联通,http://20_央卫秒开/hls/26/index.m3u8 16 | 河北卫视_联通,http://20_央卫秒开/hls/37/index.m3u8 17 | 河南卫视_联通,http://20_央卫秒开/hls/16/index.m3u8 18 | 浙江卫视_联通,http://20_央卫秒开/hls/19/index.m3u8 19 | 深圳卫视_联通,http://20_央卫秒开/hls/25/index.m3u8 20 | 湖北卫视_联通,http://20_央卫秒开/hls/27/index.m3u8 21 | 湖南卫视_联通,http://20_央卫秒开/hls/17/index.m3u8 22 | 贵州卫视_联通,http://20_央卫秒开/hls/31/index.m3u8 23 | 辽宁卫视_联通,http://20_央卫秒开/hls/32/index.m3u8 24 | 重庆卫视_联通,http://20_央卫秒开/hls/34/index.m3u8 25 | 黑龙江卫视_联通,http://20_央卫秒开/hls/29/index.m3u8 26 | -------------------------------------------------------------------------------- /22_weishi.txt: -------------------------------------------------------------------------------- 1 | 东南卫视_联通,http://22_央卫秒开/hls/46/index.m3u8 2 | 东方卫视_联通,http://22_央卫秒开/hls/34/index.m3u8 3 | 云南卫视_联通,http://22_央卫秒开/hls/43/index.m3u8 4 | 北京卫视_联通,http://22_央卫秒开/hls/33/index.m3u8 5 | 四川卫视_联通,http://22_央卫秒开/hls/41/index.m3u8 6 | 天津卫视_联通,http://22_央卫秒开/hls/35/index.m3u8 7 | 安徽卫视_联通,http://22_央卫秒开/hls/37/index.m3u8 8 | 山东卫视_联通,http://22_央卫秒开/hls/36/index.m3u8 9 | 广东卫视_联通,http://22_央卫秒开/hls/48/index.m3u8 10 | 江苏卫视_联通,http://22_央卫秒开/hls/31/index.m3u8 11 | 江西卫视_联通,http://22_央卫秒开/hls/39/index.m3u8 12 | 河南公共_联通,http://22_央卫秒开/hls/24/index.m3u8 13 | 河南卫视_联通,http://22_央卫秒开/hls/17/index.m3u8 14 | 河南新闻_联通,http://22_央卫秒开/hls/22/index.m3u8 15 | 河南民生_联通,http://22_央卫秒开/hls/19/index.m3u8 16 | 河南法治_联通,http://22_央卫秒开/hls/20/index.m3u8 17 | 河南电视剧_联通,http://22_央卫秒开/hls/21/index.m3u8 18 | 河南都市_联通,http://22_央卫秒开/hls/18/index.m3u8 19 | 浙江卫视_联通,http://22_央卫秒开/hls/32/index.m3u8 20 | 深圳卫视_联通,http://22_央卫秒开/hls/38/index.m3u8 21 | 湖北卫视_联通,http://22_央卫秒开/hls/40/index.m3u8 22 | 湖南卫视_联通,http://22_央卫秒开/hls/30/index.m3u8 23 | 贵州卫视_联通,http://22_央卫秒开/hls/44/index.m3u8 24 | 辽宁卫视_联通,http://22_央卫秒开/hls/45/index.m3u8 25 | 黑龙江卫视_联通,http://22_央卫秒开/hls/42/index.m3u8 26 | -------------------------------------------------------------------------------- /1.txt: -------------------------------------------------------------------------------- 1 | channel_line = [] 2 | with open("cfg_ip.txt", 'r', encoding='utf-8') as file: 3 | lines = file.readlines() 4 | for line in lines: 5 | line = line.strip() 6 | count = line.count(',') 7 | if count == 1: 8 | if line: 9 | channel_name, channel_url = line.split(',') 10 | if 'http' in channel_url: # 读出原来的配置IP表 11 | for result in results: # 占时循环进行判断名称是否相同,相同时,替代有效的IP 12 | ok_name, ok_url, speed = result 13 | if channel_name == ok_name: 14 | channel_line.append(f"{channel_name},{ok_url}") 15 | else: 16 | channel_line.append(f"{channel_name},{channel_url}") 17 | else: 18 | channel_line.append(f"{channel_name},{channel_url}") 19 | file.close() 20 | 21 | with open("cfg_ip.txt", 'w', encoding='utf-8') as file: 22 | for line in channel_line: 23 | channel_name, channel_url = line.split(',') 24 | file.write(f"{channel_name},{channel_url}\n") 25 | file.close() 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-PRESENT Govin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /url_ffmpeg.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | def test_stream_resolution(stream_url): 4 | # 构建ffmpeg命令 5 | command = ['ffmpeg', '-i', stream_url, '-t', '0.1', '-an', '-vn', '-rw_frame_count', '1', '-loglevel', 'quiet'] 6 | 7 | # 使用subprocess运行命令 8 | try: 9 | output = subprocess.check_output(command, stderr=subprocess.STDOUT) 10 | except subprocess.CalledProcessError as e: 11 | print(f"Error: {e.output.decode()}") 12 | return None 13 | 14 | # 解析输出结果获取分辨率 15 | output_str = output.decode() 16 | lines = output_str.split('\n') 17 | for line in lines: 18 | if 'Video: ' in line: 19 | parts = line.split(', ') 20 | for part in parts: 21 | if 'Video: ' in part: 22 | video_info = part.split() 23 | if len(video_info) > 2: 24 | resolution = video_info[2] 25 | return resolution 26 | return None 27 | 28 | # 使用示例 29 | stream_url = "http://119.54.0.212:9999/hls/48/index.m3u8" 30 | resolution = test_stream_resolution(stream_url) 31 | if resolution: 32 | print(f"Stream resolution is: {resolution}") 33 | else: 34 | print("Unable to determine stream resolution.") 35 | -------------------------------------------------------------------------------- /itv_fofa.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | API_URL = "https://fofa.info/api/v1/search/all" 4 | API_KEY = "g832@qq.com" 5 | SECRET = "01eb0c0d94dab0f234627012f7e6b527" 6 | QUERY = "你的查询语句" # 例如: "protocol=\"http\"" 7 | 8 | PAGE = 1 9 | PAGE_SIZE = 50 # 每页条数,fofa API 限制最大 100 10 | 11 | def get_token(key, secret): 12 | url = "https://fofa.info/api/v1/info/ip" 13 | data = { 14 | "email": key, 15 | "key": secret 16 | } 17 | response = requests.post(url, data=data) 18 | return response.json()["data"]["Token"] 19 | 20 | def search_fofa(query, page, page_size, token): 21 | url = API_URL 22 | data = { 23 | "email": API_KEY, 24 | "key": SECRET, 25 | "qbase64": base64.b64encode(query.encode('utf-8')).decode('utf-8'), 26 | "page": page, 27 | "size": page_size, 28 | "token": token 29 | } 30 | headers = { 31 | "Range": f"items {page}-{page_size}" 32 | } 33 | response = requests.post(url, data=data, headers=headers) 34 | return response.json() 35 | 36 | if __name__ == "__main__": 37 | token = get_token(API_KEY, SECRET) 38 | results = search_fofa(QUERY, PAGE, PAGE_SIZE, token) 39 | # 处理结果 40 | for result in results: 41 | print(result) 42 | -------------------------------------------------------------------------------- /11_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_联通,http://11_央卫秒开/hls/1/index.m3u8 2 | CCTV10_联通,http://11_央卫秒开/hls/10/index.m3u8 3 | CCTV11_联通,http://11_央卫秒开/hls/11/index.m3u8 4 | CCTV12_联通,http://11_央卫秒开/hls/12/index.m3u8 5 | CCTV13_联通,http://11_央卫秒开/hls/13/index.m3u8 6 | CCTV14_联通,http://11_央卫秒开/hls/14/index.m3u8 7 | CCTV15_联通,http://11_央卫秒开/hls/15/index.m3u8 8 | CCTV16_联通,http://11_央卫秒开/hls/16/index.m3u8 9 | CCTV164k_联通,http://11_央卫秒开/hls/29/index.m3u8 10 | CCTV17_联通,http://11_央卫秒开/hls/17/index.m3u8 11 | CCTV2_联通,http://11_央卫秒开/hls/2/index.m3u8 12 | CCTV3_联通,http://11_央卫秒开/hls/3/index.m3u8 13 | CCTV4_联通,http://11_央卫秒开/hls/4/index.m3u8 14 | CCTV5_联通,http://11_央卫秒开/hls/5/index.m3u8 15 | CCTV6_联通,http://11_央卫秒开/hls/6/index.m3u8 16 | CCTV7_联通,http://11_央卫秒开/hls/7/index.m3u8 17 | CCTV8_联通,http://11_央卫秒开/hls/8/index.m3u8 18 | CCTV9_联通,http://11_央卫秒开/hls/9/index.m3u8 19 | CCTV台球_联通,http://11_央卫秒开/hls/78/index.m3u8 20 | CCTV文化精品_联通,http://11_央卫秒开/hls/81/index.m3u8 21 | CETV1_联通,http://11_央卫秒开/hls/70/index.m3u8 22 | CETV2_联通,http://11_央卫秒开/hls/71/index.m3u8 23 | CETV4_联通,http://11_央卫秒开/hls/72/index.m3u8 24 | CCTV靓装_联通,http://11_央卫秒开/hls/83/index.m3u8 25 | CCTV风云剧场_联通,http://11_央卫秒开/hls/86/index.m3u8 26 | CCTV风云足球_联通,http://11_央卫秒开/hls/77/index.m3u8 27 | CCTV风云音乐_联通,http://11_央卫秒开/hls/79/index.m3u8 28 | CCTV高尔夫_联通,http://11_央卫秒开/hls/89/index.m3u8 29 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Python main 2 | on: 3 | #schedule: 4 | # - cron: '0 5,13,17,23 * * *' 5 | 6 | # 手动运行 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v4 16 | 17 | - name: Set up Python 18 | uses: actions/setup-python@v4 19 | with: 20 | python-version: 3.x 21 | 22 | - name: Install dependencies 23 | run: pip install selenium requests futures eventlet 24 | 25 | # 运行测试等其他任务... 26 | #- name: Run itv 27 | # run: python ${{ github.workspace }}/itv.py 28 | 29 | - name: Run cctv 30 | run: python ${{ github.workspace }}/cctv.py 31 | 32 | - name: Run weishi 33 | run: python ${{ github.workspace }}/weishi.py 34 | 35 | - name: Run ktpd 36 | run: python ${{ github.workspace }}/ktpd.py 37 | 38 | - name: Run ysyl 39 | run: python ${{ github.workspace }}/ysyl.py 40 | 41 | - name: Run qita 42 | run: python ${{ github.workspace }}/qita.py 43 | - name: 提交总表更改 44 | run: | 45 | git config --local user.name "xzw832" 46 | git config --local user.email "g832@x-zw.com" 47 | git add . 48 | git commit *.txt -m "Add generated file" 49 | git push -f 50 | 51 | -------------------------------------------------------------------------------- /.github/workflows/allrun.yml: -------------------------------------------------------------------------------- 1 | name: qita setup 2 | on: 3 | schedule: 4 | - cron: '0 * * * *' #14-在晚上22点起运行,时区应该是+8 5 | # 手动运行 6 | workflow_dispatch: 7 | 8 | jobs: 9 | push: 10 | runs-on: ${{ matrix.operating-system }} 11 | strategy: 12 | matrix: 13 | # in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded 14 | operating-system: ['ubuntu-20.04'] 15 | steps: 16 | - uses: actions/checkout@v3 # Checking out the repo 17 | - name: Run with setup-python 3.8 18 | uses: actions/setup-python@v3 19 | with: 20 | python-version: '3.9' 21 | update-environment: false 22 | cache: 'pipenv' 23 | 24 | - name: Install pipenv 25 | run: pip3 install --user pipenv 26 | - name: Install dependecies 27 | run: pipenv --python python3 && pipenv install 28 | # 安装所需的包 29 | - name: Install dependencies 30 | run: | 31 | pip install selenium requests futures eventlet 32 | pip install beautifulsoup4 33 | 34 | - name: Run ip_check.py 35 | run: python ${{ github.workspace }}/ip_check.py 36 | 37 | - name: Run hotel_ip_seek 38 | run: python ${{ github.workspace }}/hotel_ip_seek.py 39 | 40 | - name: 提交更改 41 | run: | 42 | git config --local user.name "xzw832" 43 | git config --local user.email "g832@x-zw.com" 44 | git add . 45 | git commit *.txt -m "Add generated file" 46 | git push -f 47 | -------------------------------------------------------------------------------- /21_weishi.txt: -------------------------------------------------------------------------------- 1 | 公共_联通,http://21_央卫秒开/hls/23/index.m3u8 2 | 内蒙古_联通,http://21_央卫秒开/hls/57/index.m3u8 3 | 军事_联通,http://21_央卫秒开/hls/68/index.m3u8 4 | 北京卫视_联通,http://21_央卫秒开/hls/33/index.m3u8 5 | 北京少儿_联通,http://21_央卫秒开/hls/60/index.m3u8 6 | 厦门卫视_联通,http://21_央卫秒开/hls/64/index.m3u8 7 | 嘉佳卡通_联通,http://21_央卫秒开/hls/63/index.m3u8 8 | 四川卫视_联通,http://21_央卫秒开/hls/52/index.m3u8 9 | 宁夏卫视_联通,http://21_央卫秒开/hls/55/index.m3u8 10 | 安徽卫视_联通,http://21_央卫秒开/hls/32/index.m3u8 11 | 山西卫视_联通,http://21_央卫秒开/hls/50/index.m3u8 12 | 收视指南_联通,http://21_央卫秒开/hls/62/index.m3u8 13 | 新农村_联通,http://21_央卫秒开/hls/24/index.m3u8 14 | 新电影_联通,http://21_央卫秒开/hls/73/index.m3u8 15 | 新疆卫视_联通,http://21_央卫秒开/hls/59/index.m3u8 16 | 新闻_联通,http://21_央卫秒开/hls/22/index.m3u8 17 | 梨园_联通,http://21_央卫秒开/hls/26/index.m3u8 18 | 民生_联通,http://21_央卫秒开/hls/19/index.m3u8 19 | 江苏卫视_联通,http://21_央卫秒开/hls/30/index.m3u8 20 | 江西卫视_联通,http://21_央卫秒开/hls/49/index.m3u8 21 | 河南卫视_联通,http://21_央卫秒开/hls/16/index.m3u8 22 | 河南国际_联通,http://21_央卫秒开/hls/25/index.m3u8 23 | 法治_联通,http://21_央卫秒开/hls/20/index.m3u8 24 | 浙江卫视_联通,http://21_央卫秒开/hls/31/index.m3u8 25 | 湖北卫视_联通,http://21_央卫秒开/hls/47/index.m3u8 26 | 热播剧场_联通,http://21_央卫秒开/hls/71/index.m3u8 27 | 电视剧_联通,http://21_央卫秒开/hls/21/index.m3u8 28 | 电视剧_联通,http://21_央卫秒开/hls/74/index.m3u8 29 | 相声小品_联通,http://21_央卫秒开/hls/17/index.m3u8 30 | 经典电影_联通,http://21_央卫秒开/hls/69/index.m3u8 31 | 美国大片_联通,http://21_央卫秒开/hls/66/index.m3u8 32 | 西藏卫视_联通,http://21_央卫秒开/hls/58/index.m3u8 33 | 谍战剧场_联通,http://21_央卫秒开/hls/70/index.m3u8 34 | 都市_联通,http://21_央卫秒开/hls/18/index.m3u8 35 | 金鹰卡通_联通,http://21_央卫秒开/hls/61/index.m3u8 36 | 陕西卫视_联通,http://21_央卫秒开/hls/51/index.m3u8 37 | 青海卫视_联通,http://21_央卫秒开/hls/56/index.m3u8 38 | -------------------------------------------------------------------------------- /.github/workflows/itv.yml: -------------------------------------------------------------------------------- 1 | name: itvruning 2 | on: 3 | # 手动运行 4 | workflow_call: 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v2 12 | 13 | # 安装依赖并创建虚拟环境 14 | - name: Set up Python environment 15 | uses: actions/setup-python@v2 16 | with: 17 | python-version: 3.9 18 | 19 | # 将当前目录添加到PYTHONPATH 20 | - name: Add current directory to PYTHONPATH 21 | run: | 22 | echo "export PYTHONPATH=$(pwd)" >> $GITHUB_ENV 23 | 24 | # 如果之前已经有了缓存,则从缓存中还原 25 | - name: Restore cache if available 26 | id: restore_cache 27 | uses: actions/cache@v2 28 | with: 29 | path: ~/.cache/pip 30 | key: python-${{ hashFiles('requirements.txt') }} 31 | 32 | # 安装所需的包 33 | - name: Install dependencies 34 | run: pip install selenium requests futures eventlet 35 | 36 | # 运行测试等其他任务... 37 | - name: Run itv 38 | run: python ${{ github.workspace }}/itv.py 39 | - name: 提交更改 40 | run: | 41 | git config --local user.name "xzw832" 42 | git config --local user.email "g832@x-zw.com" 43 | git add . 44 | git commit itv.txt -m "Add generated file" 45 | git push -f 46 | 47 | # 保存新的缓存 48 | - name: Save cache for future use 49 | if: steps.restore_cache.outputs.cache-hit != 'true' 50 | uses: actions/cache@v2 51 | with: 52 | path: ~/.cache/pip 53 | key: python-${{ hashFiles('requirements.txt') }} 54 | -------------------------------------------------------------------------------- /editfiles.py: -------------------------------------------------------------------------------- 1 | name: Cmys_set 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'itv11.txt' # 仅当该文件被修改时触发运行 7 | branches: [main] # 限制只在主分支上触发运行 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | 19 | - name: Set up Python 20 | uses: actions/setup-python@v2 21 | with: 22 | python-version: 3.8 23 | 24 | - name: Install dependencies 25 | run: pip install selenium requests futures eventlet 26 | 27 | - name: Run cctv 28 | run: python ${{ github.workspace }}/cctv.py 29 | 30 | - name: Run weishi 31 | run: python ${{ github.workspace }}/weishi.py 32 | 33 | - name: Run ktpd 34 | run: python ${{ github.workspace }}/ktpd.py 35 | 36 | - name: Run ysyl 37 | run: python ${{ github.workspace }}/ysyl.py 38 | 39 | - name: Run xiangang 40 | run: python ${{ github.workspace }}/xiangang.py 41 | 42 | - name: Run qita 43 | run: python ${{ github.workspace }}/qita.py 44 | 45 | - name: 提交总表更改 46 | run: | 47 | git config --local user.email "g832@x-zw.com" 48 | git config --local user.name "xzw832" 49 | git add . 50 | git commit cctv.txt -m "Add generated file" 51 | git commit weishi.txt -m "Add generated file" 52 | git commit ktpd.txt -m "Add generated file" 53 | git commit ysyl.txt -m "Add generated file" 54 | git commit qita.txt -m "Add generated file" 55 | git commit itvlist.txt -m "Add generated file" 56 | #git pull --rebase 57 | git push -f 58 | -------------------------------------------------------------------------------- /duliip_219_137_29.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://219.137.29.213:4433/tsfile/live/0001_1.m3u8 2 | CCTV10,http://219.137.29.213:4433/tsfile/live/0010_1.m3u8 3 | CCTV11,http://219.137.29.213:4433/tsfile/live/0011_1.m3u8 4 | CCTV12,http://219.137.29.213:4433/tsfile/live/0012_1.m3u8 5 | CCTV13,http://219.137.29.213:4433/tsfile/live/0013_1.m3u8 6 | CCTV14,http://219.137.29.213:4433/tsfile/live/0014_1.m3u8 7 | CCTV15,http://219.137.29.213:4433/tsfile/live/0015_1.m3u8 8 | CCTV2,http://219.137.29.213:4433/tsfile/live/0002_1.m3u8 9 | CCTV3,http://219.137.29.213:4433/tsfile/live/0003_1.m3u8 10 | CCTV4,http://219.137.29.213:4433/tsfile/live/0004_1.m3u8 11 | CCTV5+,http://219.137.29.213:4433/tsfile/live/0016_1.m3u8 12 | CCTV5,http://219.137.29.213:4433/tsfile/live/0005_1.m3u8 13 | CCTV6,http://219.137.29.213:4433/tsfile/live/0006_1.m3u8 14 | CCTV7,http://219.137.29.213:4433/tsfile/live/0007_1.m3u8 15 | CCTV8,http://219.137.29.213:4433/tsfile/live/0008_1.m3u8 16 | CCTV9,http://219.137.29.213:4433/tsfile/live/0009_1.m3u8 17 | 东方卫视,http://219.137.29.213:4433/tsfile/live/0107_1.m3u8 18 | 南方卫视,http://219.137.29.213:4433/tsfile/live/1000_1.m3u8 19 | 广东体育,http://219.137.29.213:4433/tsfile/live/0142_1.m3u8 20 | 广东公共,http://219.137.29.213:4433/tsfile/live/1004_1.m3u8 21 | 广东卫视,http://219.137.29.213:4433/tsfile/live/0125_1.m3u8 22 | 广东新闻,http://219.137.29.213:4433/tsfile/live/1005_1.m3u8 23 | 广东珠江,http://219.137.29.213:4433/tsfile/live/1006_1.m3u8 24 | 广东综合,http://219.137.29.213:4433/tsfile/live/1001_1.m3u8 25 | 广州影视,http://219.137.29.213:4433/tsfile/live/1003_1.m3u8 26 | 广州新闻,http://219.137.29.213:4433/tsfile/live/1002_1.m3u8 27 | 江苏卫视,http://219.137.29.213:4433/tsfile/live/0127_1.m3u8 28 | 浙江卫视,http://219.137.29.213:4433/tsfile/live/0124_1.m3u8 29 | 湖南卫视,http://219.137.29.213:4433/tsfile/live/0128_1.m3u8 30 | -------------------------------------------------------------------------------- /.github/workflows/itv_fofa.yml: -------------------------------------------------------------------------------- 1 | name: select all iptv 2 | on: 3 | # 手动运行 4 | workflow_dispatch: 5 | 6 | jobs: 7 | push: 8 | runs-on: ${{ matrix.operating-system }} 9 | strategy: 10 | matrix: 11 | # in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded 12 | operating-system: ['ubuntu-20.04'] 13 | steps: 14 | - uses: actions/checkout@v3 # Checking out the repo 15 | - name: Run with setup-python 3.8 16 | uses: actions/setup-python@v3 17 | with: 18 | python-version: '3.9' 19 | update-environment: false 20 | cache: 'pipenv' 21 | 22 | 23 | - name: Set up Chrome 24 | uses: browser-actions/setup-chrome@latest 25 | with: 26 | chrome-version: stable 27 | - name: Download chrome driver 28 | uses: nanasess/setup-chromedriver@master 29 | - name: Launch chrome driver 30 | run: | 31 | export DISPLAY=:99 32 | chromedriver --url-base=/wd/hub & 33 | sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional 34 | 35 | - name: Install pipenv 36 | run: pip3 install --user pipenv 37 | - name: Install dependecies 38 | run: pipenv --python python3 && pipenv install 39 | # 安装所需的包 40 | - name: Install dependencies 41 | run: | 42 | pip install selenium requests futures eventlet 43 | pip install beautifulsoup4 44 | 45 | - name: Run iptv.py 46 | run: python ${{ github.workspace }}/iptv.py 47 | 48 | - name: 提交更改 49 | run: | 50 | git config --local user.name "xzw832" 51 | git config --local user.email "g832@x-zw.com" 52 | git add . 53 | git commit *.txt -m "Add generated file" 54 | git push -f 55 | -------------------------------------------------------------------------------- /.github/workflows/weishi.yml: -------------------------------------------------------------------------------- 1 | name: set hotel_duli_ip 2 | on: 3 | # schedule: 4 | # - cron: '0 9,15 * * *' #14-在晚上22点起运行,时区应该是+8 5 | # 手动运行 6 | workflow_dispatch: 7 | 8 | jobs: 9 | push: 10 | runs-on: ${{ matrix.operating-system }} 11 | strategy: 12 | matrix: 13 | # in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded 14 | operating-system: ['ubuntu-20.04'] 15 | steps: 16 | - uses: actions/checkout@v3 # Checking out the repo 17 | - name: Run with setup-python 3.8 18 | uses: actions/setup-python@v3 19 | with: 20 | python-version: '3.9' 21 | update-environment: false 22 | cache: 'pipenv' 23 | 24 | 25 | - name: Set up Chrome 26 | uses: browser-actions/setup-chrome@latest 27 | with: 28 | chrome-version: stable 29 | - name: Download chrome driver 30 | uses: nanasess/setup-chromedriver@master 31 | - name: Launch chrome driver 32 | run: | 33 | export DISPLAY=:99 34 | chromedriver --url-base=/wd/hub & 35 | sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional 36 | 37 | - name: Install pipenv 38 | run: pip3 install --user pipenv 39 | - name: Install dependecies 40 | run: pipenv --python python3 && pipenv install 41 | # 安装所需的包 42 | - name: Install dependencies 43 | run: | 44 | pip install selenium requests futures eventlet 45 | pip install beautifulsoup4 46 | pip install chardet 47 | 48 | - name: Run hotel_duli_ip 49 | run: python ${{ github.workspace }}/hotel_duli_ip.py 50 | 51 | - name: 提交更改 52 | run: | 53 | git config --local user.name "xzw832" 54 | git config --local user.email "g832@x-zw.com" 55 | git add . 56 | git commit *.txt -m "Add generated file" 57 | git push -f 58 | -------------------------------------------------------------------------------- /ip_qianxin_check.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | from requests.exceptions import Timeout, RequestException 10 | 11 | eventlet.monkey_patch() 12 | 13 | channels = [] 14 | headers = {'User-Agent': 'okhttp/3.12.10(Linux;Android9;V2049ABuild/TP1A.220624.014;wv)AppleWebKit/537.36(KHTML,likeGecko)Version/4.0Chrome/116.0.0.0MobileSafari/537.36'} 15 | 16 | def get_redirected_urls(url): 17 | try: 18 | session = requests.Session() 19 | response = requests.head(url, allow_redirects=False, timeout=2) 20 | 21 | if response.status_code == 200 and 'Location' in response.headers: 22 | redirected_url = response.headers['Location'] 23 | print("1:----------------------------------------------------") 24 | print(f"Initial URL: {url}, Redirected URL: {redirected_url}") 25 | elif response.status_code in [301, 302, 303, 307, 308]: 26 | redirected_url = response.headers['Location'] 27 | print("2:----------------------------------------------------") 28 | print(f"Redirected URL: {redirected_url}") 29 | else: 30 | print(f"Response Status Code: {response.status_code}") 31 | except RequestException as e: 32 | print(f"Error occurred for URL {url}: {e}") 33 | 34 | with open("ip_qianxin.txt", 'r', encoding='utf-8') as file: 35 | lines = file.readlines() 36 | for line in lines: 37 | line = line.strip() 38 | count = line.count(',') 39 | if count == 1: 40 | if line: 41 | channel_name, channel_url = line.split(',') 42 | channels.append((channel_name, channel_url)) 43 | 44 | for channel_name, channel_url in channels: 45 | try: 46 | print(channel_url) 47 | get_redirected_urls(channel_url) 48 | time.sleep(1) 49 | except RequestException as e: 50 | print(f"Error occurred for URL {url}: {e}") 51 | continue 52 | -------------------------------------------------------------------------------- /unicom_182_123_72.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://182.123.72.250:8090/hls/1/index.m3u8 2 | CCTV10,http://182.123.72.250:8090/hls/10/index.m3u8 3 | CCTV11,http://182.123.72.250:8090/hls/11/index.m3u8 4 | CCTV12法制,http://182.123.72.250:8090/hls/12/index.m3u8 5 | CCTV13,http://182.123.72.250:8090/hls/13/index.m3u8 6 | CCTV14,http://182.123.72.250:8090/hls/14/index.m3u8 7 | CCTV15,http://182.123.72.250:8090/hls/15/index.m3u8 8 | CCTV2经济,http://182.123.72.250:8090/hls/2/index.m3u8 9 | CCTV3,http://182.123.72.250:8090/hls/3/index.m3u8 10 | CCTV5,http://182.123.72.250:8090/hls/5/index.m3u8 11 | CCTV6,http://182.123.72.250:8090/hls/6/index.m3u8 12 | CCTV7,http://182.123.72.250:8090/hls/7/index.m3u8 13 | CCTV8,http://182.123.72.250:8090/hls/8/index.m3u8 14 | CCTV9,http://182.123.72.250:8090/hls/9/index.m3u8 15 | 东南卫视,http://182.123.72.250:8090/hls/33/index.m3u8 16 | 东方卫视,http://182.123.72.250:8090/hls/21/index.m3u8 17 | 云南卫视,http://182.123.72.250:8090/hls/30/index.m3u8 18 | 北京卫视,http://182.123.72.250:8090/hls/20/index.m3u8 19 | 吉林卫视,http://182.123.72.250:8090/hls/39/index.m3u8 20 | 四川卫视,http://182.123.72.250:8090/hls/28/index.m3u8 21 | 天津卫视,http://182.123.72.250:8090/hls/22/index.m3u8 22 | 安徽卫视,http://182.123.72.250:8090/hls/24/index.m3u8 23 | 山东卫视,http://182.123.72.250:8090/hls/23/index.m3u8 24 | 山西卫视,http://182.123.72.250:8090/hls/40/index.m3u8 25 | 广东卫视,http://182.123.72.250:8090/hls/35/index.m3u8 26 | 广西卫视,http://182.123.72.250:8090/hls/36/index.m3u8 27 | 旅游卫视,http://182.123.72.250:8090/hls/38/index.m3u8 28 | 江苏卫视,http://182.123.72.250:8090/hls/18/index.m3u8 29 | 江西卫视,http://182.123.72.250:8090/hls/26/index.m3u8 30 | 河北卫视,http://182.123.72.250:8090/hls/37/index.m3u8 31 | 河南卫视,http://182.123.72.250:8090/hls/16/index.m3u8 32 | 浙江卫视,http://182.123.72.250:8090/hls/19/index.m3u8 33 | 深圳卫视,http://182.123.72.250:8090/hls/25/index.m3u8 34 | 湖北卫视,http://182.123.72.250:8090/hls/27/index.m3u8 35 | 湖南卫视,http://182.123.72.250:8090/hls/17/index.m3u8 36 | 贵州卫视,http://182.123.72.250:8090/hls/31/index.m3u8 37 | 辽宁卫视,http://182.123.72.250:8090/hls/32/index.m3u8 38 | 重庆卫视,http://182.123.72.250:8090/hls/34/index.m3u8 39 | 黑龙江卫视,http://182.123.72.250:8090/hls/29/index.m3u8 40 | -------------------------------------------------------------------------------- /unicom22_182_122_73.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://182.122.73.120:8089/hls/1/index.m3u8 2 | CCTV10,http://182.122.73.120:8089/hls/10/index.m3u8 3 | CCTV11,http://182.122.73.120:8089/hls/11/index.m3u8 4 | CCTV12,http://182.122.73.120:8089/hls/12/index.m3u8 5 | CCTV13,http://182.122.73.120:8089/hls/13/index.m3u8 6 | CCTV14,http://182.122.73.120:8089/hls/14/index.m3u8 7 | CCTV15,http://182.122.73.120:8089/hls/15/index.m3u8 8 | CCTV2,http://182.122.73.120:8089/hls/2/index.m3u8 9 | CCTV3,http://182.122.73.120:8089/hls/3/index.m3u8 10 | CCTV4,http://182.122.73.120:8089/hls/4/index.m3u8 11 | CCTV5,http://182.122.73.120:8089/hls/5/index.m3u8 12 | CCTV6,http://182.122.73.120:8089/hls/6/index.m3u8 13 | CCTV7,http://182.122.73.120:8089/hls/7/index.m3u8 14 | CCTV8,http://182.122.73.120:8089/hls/8/index.m3u8 15 | CCTV9,http://182.122.73.120:8089/hls/9/index.m3u8 16 | 东南卫视,http://182.122.73.120:8089/hls/46/index.m3u8 17 | 东方卫视,http://182.122.73.120:8089/hls/34/index.m3u8 18 | 云南卫视,http://182.122.73.120:8089/hls/43/index.m3u8 19 | 北京卫视,http://182.122.73.120:8089/hls/33/index.m3u8 20 | 四川卫视,http://182.122.73.120:8089/hls/41/index.m3u8 21 | 天津卫视,http://182.122.73.120:8089/hls/35/index.m3u8 22 | 安徽卫视,http://182.122.73.120:8089/hls/37/index.m3u8 23 | 山东卫视,http://182.122.73.120:8089/hls/36/index.m3u8 24 | 广东卫视,http://182.122.73.120:8089/hls/48/index.m3u8 25 | 江苏卫视,http://182.122.73.120:8089/hls/31/index.m3u8 26 | 江西卫视,http://182.122.73.120:8089/hls/39/index.m3u8 27 | 河南公共,http://182.122.73.120:8089/hls/24/index.m3u8 28 | 河南卫视,http://182.122.73.120:8089/hls/17/index.m3u8 29 | 河南新闻,http://182.122.73.120:8089/hls/22/index.m3u8 30 | 河南民生,http://182.122.73.120:8089/hls/19/index.m3u8 31 | 河南法治,http://182.122.73.120:8089/hls/20/index.m3u8 32 | 河南电视剧,http://182.122.73.120:8089/hls/21/index.m3u8 33 | 河南都市,http://182.122.73.120:8089/hls/18/index.m3u8 34 | 浙江卫视,http://182.122.73.120:8089/hls/32/index.m3u8 35 | 深圳卫视,http://182.122.73.120:8089/hls/38/index.m3u8 36 | 湖北卫视,http://182.122.73.120:8089/hls/40/index.m3u8 37 | 湖南卫视,http://182.122.73.120:8089/hls/30/index.m3u8 38 | 贵州卫视,http://182.122.73.120:8089/hls/44/index.m3u8 39 | 辽宁卫视,http://182.122.73.120:8089/hls/45/index.m3u8 40 | 黑龙江卫视,http://182.122.73.120:8089/hls/42/index.m3u8 41 | -------------------------------------------------------------------------------- /new_file.txt: -------------------------------------------------------------------------------- 1 | CCTV1_电信,http://119.125.134.209:9901/tsfile/live/1140_1.m3u8 2 | CCTV2_电信,http://119.125.134.209:9901/tsfile/live/1141_1.m3u8 3 | CCTV3_电信,http://119.125.134.209:9901/tsfile/live/1142_1.m3u8 4 | CCTV4_电信,http://119.125.134.209:9901/tsfile/live/1143_1.m3u8 5 | CCTV5_电信,http://119.125.134.209:9901/tsfile/live/1144_1.m3u8 6 | CCTV6_电信,http://119.125.134.209:9901/tsfile/live/1139_1.m3u8 7 | CCTV7_电信,http://119.125.134.209:9901/tsfile/live/1145_1.m3u8 8 | CCTV8_电信,http://119.125.134.209:9901/tsfile/live/1146_1.m3u8 9 | CCTV9_电信,http://119.125.134.209:9901/tsfile/live/1147_1.m3u8 10 | CCTV10_电信,http://119.125.134.209:9901/tsfile/live/1149_1.m3u8 11 | CCTV11_电信,http://119.125.134.209:9901/tsfile/live/1150_1.m3u8 12 | CCTV12_电信,http://119.125.134.209:9901/tsfile/live/1151_1.m3u8 13 | CCTV13_电信,http://119.125.134.209:9901/tsfile/live/1152_1.m3u8 14 | CCTV14_电信,http://119.125.134.209:9901/tsfile/live/1153_1.m3u8 15 | CCTV15_电信,http://119.125.134.209:9901/tsfile/live/1154_1.m3u8 16 | CCTV16_电信,http://119.125.134.209:9901/tsfile/live/1155_1.m3u8 17 | CCTV5+_电信,http://119.125.134.209:9901/tsfile/live/1148_1.m3u8 18 | CCTV1_联通,http://119.125.134.209:9901/tsfile/live/1140_1.m3u8 19 | CCTV2_联通,http://119.125.134.209:9901/tsfile/live/1141_1.m3u8 20 | CCTV3_联通,http://119.125.134.209:9901/tsfile/live/1142_1.m3u8 21 | CCTV4_联通,http://119.125.134.209:9901/tsfile/live/1143_1.m3u8 22 | CCTV5_联通,http://119.125.134.209:9901/tsfile/live/1144_1.m3u8 23 | CCTV6_联通,http://119.125.134.209:9901/tsfile/live/1139_1.m3u8 24 | CCTV7_联通,http://119.125.134.209:9901/tsfile/live/1145_1.m3u8 25 | CCTV8_联通,http://119.125.134.209:9901/tsfile/live/1146_1.m3u8 26 | CCTV9_联通,http://119.125.134.209:9901/tsfile/live/1147_1.m3u8 27 | CCTV10_联通,http://119.125.134.209:9901/tsfile/live/1149_1.m3u8 28 | CCTV11_联通,http://119.125.134.209:9901/tsfile/live/1150_1.m3u8 29 | CCTV12_联通,http://119.125.134.209:9901/tsfile/live/1151_1.m3u8 30 | CCTV13_联通,http://119.125.134.209:9901/tsfile/live/1152_1.m3u8 31 | CCTV14_联通,http://119.125.134.209:9901/tsfile/live/1153_1.m3u8 32 | CCTV15_联通,http://119.125.134.209:9901/tsfile/live/1154_1.m3u8 33 | CCTV16_联通,http://119.125.134.209:9901/tsfile/live/1155_1.m3u8 34 | CCTV5+_联通,http://119.125.134.209:9901/tsfile/live/1148_1.m3u8 35 | -------------------------------------------------------------------------------- /23_weishi.txt: -------------------------------------------------------------------------------- 1 | 本港卫视_联通,http://23_央卫秒开/hls/16/index.m3u8 2 | TVS1_联通,http://23_央卫秒开/hls/1/index.m3u8 3 | 东南卫视_联通,http://23_央卫秒开/hls/37/index.m3u8 4 | 东方卫视_联通,http://23_央卫秒开/hls/67/index.m3u8 5 | 东森新闻_联通,http://23_央卫秒开/hls/13/index.m3u8 6 | 云南卫视_联通,http://23_央卫秒开/hls/55/index.m3u8 7 | 优漫卡通_联通,http://23_央卫秒开/hls/77/index.m3u8 8 | 体育_联通,http://23_央卫秒开/hls/89/index.m3u8 9 | 内蒙古卫视_联通,http://23_央卫秒开/hls/57/index.m3u8 10 | 军事农业_联通,http://23_央卫秒开/hls/79/index.m3u8 11 | 凤凰卫视中文_联通,http://23_央卫秒开/hls/15/index.m3u8 12 | 凤凰卫视资讯_联通,http://23_央卫秒开/hls/12/index.m3u8 13 | 北京卫视_联通,http://23_央卫秒开/hls/78/index.m3u8 14 | 南方卫视_联通,http://23_央卫秒开/hls/59/index.m3u8 15 | 嘉佳卡通_联通,http://23_央卫秒开/hls/72/index.m3u8 16 | 四川卫视_联通,http://23_央卫秒开/hls/66/index.m3u8 17 | 国际_联通,http://23_央卫秒开/hls/74/index.m3u8 18 | 天津卫视_联通,http://23_央卫秒开/hls/92/index.m3u8 19 | 宁夏卫视_联通,http://23_央卫秒开/hls/58/index.m3u8 20 | 安徽卫视_联通,http://23_央卫秒开/hls/34/index.m3u8 21 | 少儿_联通,http://23_央卫秒开/hls/84/index.m3u8 22 | 山东卫视_联通,http://23_央卫秒开/hls/88/index.m3u8 23 | 广东体育_联通,http://23_央卫秒开/hls/1/index.m3u8 24 | 广东卫视_联通,http://23_央卫秒开/hls/14/index.m3u8 25 | 广东影视_联通,http://23_央卫秒开/hls/46/index.m3u8 26 | 广东新闻_联通,http://23_央卫秒开/hls/5/index.m3u8 27 | 广东珠江_联通,http://23_央卫秒开/hls/2/index.m3u8 28 | 揭阳综合_联通,http://23_央卫秒开/hls/11/index.m3u8 29 | 新闻_联通,http://23_央卫秒开/hls/65/index.m3u8 30 | 普宁台_联通,http://23_央卫秒开/hls/12/index.m3u8 31 | 汕头综合_联通,http://23_央卫秒开/hls/76/index.m3u8 32 | 汕头文旅体育_联通,http://23_央卫秒开/hls/62/index.m3u8 33 | 汕头经济生活_联通,http://23_央卫秒开/hls/69/index.m3u8 34 | 江苏卫视_联通,http://23_央卫秒开/hls/71/index.m3u8 35 | 江西卫视_联通,http://23_央卫秒开/hls/87/index.m3u8 36 | 河北卫视_联通,http://23_央卫秒开/hls/47/index.m3u8 37 | 河南卫视_联通,http://23_央卫秒开/hls/64/index.m3u8 38 | 浙江卫视_联通,http://23_央卫秒开/hls/29/index.m3u8 39 | 深圳卫视_联通,http://23_央卫秒开/hls/82/index.m3u8 40 | 深圳电视剧_联通,http://23_央卫秒开/hls/10/index.m3u8 41 | 深圳都市_联通,http://23_央卫秒开/hls/61/index.m3u8 42 | 湖北卫视_联通,http://23_央卫秒开/hls/68/index.m3u8 43 | 湖南卫视_联通,http://23_央卫秒开/hls/63/index.m3u8 44 | 电影_联通,http://23_央卫秒开/hls/75/index.m3u8 45 | 电视剧_联通,http://23_央卫秒开/hls/80/index.m3u8 46 | 社会与法_联通,http://23_央卫秒开/hls/81/index.m3u8 47 | 综合_联通,http://23_央卫秒开/hls/23/index.m3u8 48 | 综艺_联通,http://23_央卫秒开/hls/24/index.m3u8 49 | 财经_联通,http://23_央卫秒开/hls/73/index.m3u8 50 | 重庆卫视_联通,http://23_央卫秒开/hls/93/index.m3u8 51 | 金鹰卡通_联通,http://23_央卫秒开/hls/83/index.m3u8 52 | 陕西卫视_联通,http://23_央卫秒开/hls/54/index.m3u8 53 | -------------------------------------------------------------------------------- /prv_cctv.txt: -------------------------------------------------------------------------------- 1 | CCTV1_电信,http://0_央卫秒开/tsfile/live/1140_1.m3u8 2 | CCTV2_电信,http://0_央卫秒开/tsfile/live/1141_1.m3u8 3 | CCTV3_电信,http://0_央卫秒开/tsfile/live/1142_1.m3u8 4 | CCTV4_电信,http://0_央卫秒开/tsfile/live/1143_1.m3u8 5 | CCTV5_电信,http://0_央卫秒开/tsfile/live/1144_1.m3u8 6 | CCTV6_电信,http://0_央卫秒开/tsfile/live/1139_1.m3u8 7 | CCTV7_电信,http://0_央卫秒开/tsfile/live/1145_1.m3u8 8 | CCTV8_电信,http://0_央卫秒开/tsfile/live/1146_1.m3u8 9 | CCTV9_电信,http://0_央卫秒开/tsfile/live/1147_1.m3u8 10 | CCTV10_电信,http://0_央卫秒开/tsfile/live/1149_1.m3u8 11 | CCTV11_电信,http://0_央卫秒开/tsfile/live/1150_1.m3u8 12 | CCTV12_电信,http://0_央卫秒开/tsfile/live/1151_1.m3u8 13 | CCTV13_电信,http://0_央卫秒开/tsfile/live/1152_1.m3u8 14 | CCTV14_电信,http://0_央卫秒开/tsfile/live/1153_1.m3u8 15 | CCTV15_电信,http://0_央卫秒开/tsfile/live/1154_1.m3u8 16 | CCTV16_电信,http://0_央卫秒开/tsfile/live/1155_1.m3u8 17 | CCTV5+_电信,http://0_央卫秒开/tsfile/live/1148_1.m3u8 18 | CCTV文化精品_电信,http://0_央卫秒开/tsfile/live/1188_1.m3u8 19 | CCTV17_电信,http://0_央卫秒开/tsfile/live/1189_1.m3u8 20 | CCTV风云音乐_电信,http://0_央卫秒开/tsfile/live/1193_1.m3u8 21 | CCTV风云足球_电信,http://0_央卫秒开/tsfile/live/1194_1.m3u8 22 | CCTV女性时尚_电信,http://0_央卫秒开/tsfile/live/1196_1.m3u8 23 | CCTV世界地理_电信,http://0_央卫秒开/tsfile/live/1197_1.m3u8 24 | CCTV兵器科技_电信,http://0_央卫秒开/tsfile/live/1110_1.m3u8 25 | 26 | CCTV1_联通,http://0_央卫秒开/tsfile/live/1140_1.m3u8 27 | CCTV2_联通,http://0_央卫秒开/tsfile/live/1141_1.m3u8 28 | CCTV3_联通,http://0_央卫秒开/tsfile/live/1142_1.m3u8 29 | CCTV4_联通,http://0_央卫秒开/tsfile/live/1143_1.m3u8 30 | CCTV5_联通,http://0_央卫秒开/tsfile/live/1144_1.m3u8 31 | CCTV6_联通,http://0_央卫秒开/tsfile/live/1139_1.m3u8 32 | CCTV7_联通,http://0_央卫秒开/tsfile/live/1145_1.m3u8 33 | CCTV8_联通,http://0_央卫秒开/tsfile/live/1146_1.m3u8 34 | CCTV9_联通,http://0_央卫秒开/tsfile/live/1147_1.m3u8 35 | CCTV10_联通,http://0_央卫秒开/tsfile/live/1149_1.m3u8 36 | CCTV11_联通,http://0_央卫秒开/tsfile/live/1150_1.m3u8 37 | CCTV12_联通,http://0_央卫秒开/tsfile/live/1151_1.m3u8 38 | CCTV13_联通,http://0_央卫秒开/tsfile/live/1152_1.m3u8 39 | CCTV14_联通,http://0_央卫秒开/tsfile/live/1153_1.m3u8 40 | CCTV15_联通,http://0_央卫秒开/tsfile/live/1154_1.m3u8 41 | CCTV16_联通,http://0_央卫秒开/tsfile/live/1155_1.m3u8 42 | CCTV5+_联通,http://0_央卫秒开/tsfile/live/1148_1.m3u8 43 | CCTV央视文化精品_联通,http://0_央卫秒开/tsfile/live/1188_1.m3u8 44 | CCTV17_联通,http://0_央卫秒开/tsfile/live/1189_1.m3u8 45 | CCTV风云音乐_联通,http://0_央卫秒开/tsfile/live/1193_1.m3u8 46 | CCTV风云足球_联通,http://0_央卫秒开/tsfile/live/1194_1.m3u8 47 | CCTV女性时尚_联通,http://0_央卫秒开/tsfile/live/1196_1.m3u8 48 | CCTV世界地理_联通,http://0_央卫秒开/tsfile/live/1197_1.m3u8 49 | CCTV兵器科技_联通,http://0_央卫秒开/tsfile/live/1110_1.m3u8 50 | -------------------------------------------------------------------------------- /.github/workflows/cctv.yml: -------------------------------------------------------------------------------- 1 | name: cctv setup 2 | on: 3 | # schedule: 4 | # - cron: '0 3,7,11,15,19,23 * * *' #14-在晚上22点起运行,时区应该是+8 5 | #- cron: '0 2,9,16,23 * * *' 6 | # 手动运行 7 | workflow_dispatch: 8 | 9 | jobs: 10 | push: 11 | runs-on: ${{ matrix.operating-system }} 12 | strategy: 13 | matrix: 14 | # in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded 15 | operating-system: ['ubuntu-20.04'] 16 | steps: 17 | - uses: actions/checkout@v3 # Checking out the repo 18 | - name: Run with setup-python 3.8 19 | uses: actions/setup-python@v3 20 | with: 21 | python-version: '3.9' 22 | update-environment: false 23 | cache: 'pipenv' 24 | 25 | 26 | - name: Set up Chrome 27 | uses: browser-actions/setup-chrome@latest 28 | with: 29 | chrome-version: stable 30 | - name: Download chrome driver 31 | uses: nanasess/setup-chromedriver@master 32 | - name: Launch chrome driver 33 | run: | 34 | export DISPLAY=:99 35 | chromedriver --url-base=/wd/hub & 36 | sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional 37 | 38 | - name: Install pipenv 39 | run: pip3 install --user pipenv 40 | - name: Install dependecies 41 | run: pipenv --python python3 && pipenv install 42 | # 安装所需的包 43 | - name: Install dependencies 44 | run: | 45 | pip install selenium requests futures eventlet 46 | pip install beautifulsoup4 47 | 48 | - name: Run cctv 49 | run: python ${{ github.workspace }}/cctv.py 50 | 51 | - name: Run weishi 52 | run: python ${{ github.workspace }}/weishi.py 53 | 54 | - name: Run ktpd 55 | run: python ${{ github.workspace }}/ktpd.py 56 | 57 | - name: Run ysyl 58 | run: python ${{ github.workspace }}/ysyl.py 59 | 60 | - name: Run qita 61 | run: python ${{ github.workspace }}/qita.py 62 | 63 | - name: Run tv570 64 | run: python ${{ github.workspace }}/tv570.py 65 | 66 | - name: 提交更改 67 | run: | 68 | git config --local user.name "xzw832" 69 | git config --local user.email "g832@x-zw.com" 70 | git add . 71 | git commit *.txt -m "Add generated file" 72 | git push -f 73 | -------------------------------------------------------------------------------- /12_weishi.txt: -------------------------------------------------------------------------------- 1 | 上海卫视_电信,http://12_央卫秒开/tsfile/live/0107_1.m3u8 2 | 东南卫视_电信,http://12_央卫秒开/tsfile/live/0137_1.m3u8 3 | 中国气象_电信,http://12_央卫秒开/tsfile/live/1015_1.m3u8 4 | 云南卫视_电信,http://12_央卫秒开/tsfile/live/0119_1.m3u8 5 | 兵团卫视_电信,http://12_央卫秒开/tsfile/live/0115_1.m3u8 6 | 内蒙古卫视_电信,http://12_央卫秒开/tsfile/live/0109_1.m3u8 7 | 动作电影_电信,http://12_央卫秒开/tsfile/live/1019_1.m3u8 8 | 北京卫视_电信,http://12_央卫秒开/tsfile/live/0122_1.m3u8 9 | 南宁公共_电信,http://12_央卫秒开/tsfile/live/1014_1.m3u8 10 | 南宁影视_电信,http://12_央卫秒开/tsfile/live/1013_1.m3u8 11 | 南宁综合_电信,http://12_央卫秒开/tsfile/live/0143_1.m3u8 12 | 吉林卫视_电信,http://12_央卫秒开/tsfile/live/0116_1.m3u8 13 | 四川卫视_电信,http://12_央卫秒开/tsfile/live/0123_1.m3u8 14 | 天津卫视_电信,http://12_央卫秒开/tsfile/live/0135_1.m3u8 15 | 安徽卫视_电信,http://12_央卫秒开/tsfile/live/0130_1.m3u8 16 | 家庭影院_电信,http://12_央卫秒开/tsfile/live/1018_1.m3u8 17 | 山东卫视_电信,http://12_央卫秒开/tsfile/live/0131_1.m3u8 18 | 岭南戏剧_电信,http://12_央卫秒开/tsfile/live/1006_1.m3u8 19 | 广东体育_电信,http://12_央卫秒开/tsfile/live/1001_1.m3u8 20 | 广东公共_电信,http://12_央卫秒开/tsfile/live/1002_1.m3u8 21 | 广东卫视_电信,http://12_央卫秒开/tsfile/live/0125_1.m3u8 22 | 广东少儿_电信,http://12_央卫秒开/tsfile/live/1005_1.m3u8 23 | 广东影视_电信,http://12_央卫秒开/tsfile/live/1004_1.m3u8 24 | 广东新闻_电信,http://12_央卫秒开/tsfile/live/1007_1.m3u8 25 | 广东科教_电信,http://12_央卫秒开/tsfile/live/1003_1.m3u8 26 | 广西卫视_电信,http://12_央卫秒开/tsfile/live/0113_1.m3u8 27 | 广西影视_电信,http://12_央卫秒开/tsfile/live/1009_1.m3u8 28 | 广西新闻_电信,http://12_央卫秒开/tsfile/live/1012_1.m3u8 29 | 广西综艺_电信,http://12_央卫秒开/tsfile/live/1010_1.m3u8 30 | 广西都市_电信,http://12_央卫秒开/tsfile/live/1011_1.m3u8 31 | 康巴卫视_电信,http://12_央卫秒开/tsfile/live/0134_1.m3u8 32 | 教育一套_电信,http://12_央卫秒开/tsfile/live/1017_1.m3u8 33 | 旅游卫视_电信,http://12_央卫秒开/tsfile/live/0114_1.m3u8 34 | 江苏卫视_电信,http://12_央卫秒开/tsfile/live/0127_1.m3u8 35 | 江西卫视_电信,http://12_央卫秒开/tsfile/live/0138_1.m3u8 36 | 河北卫视_电信,http://12_央卫秒开/tsfile/live/0117_1.m3u8 37 | 浙江卫视_电信,http://12_央卫秒开/tsfile/live/0124_1.m3u8 38 | 深圳卫视_电信,http://12_央卫秒开/tsfile/live/0126_1.m3u8 39 | 湖北卫视_电信,http://12_央卫秒开/tsfile/live/0132_1.m3u8 40 | 湖南卫视_电信,http://12_央卫秒开/tsfile/live/0128_1.m3u8 41 | 珠江台_电信,http://12_央卫秒开/tsfile/live/1000_1.m3u8 42 | 甘肃卫视_电信,http://12_央卫秒开/tsfile/live/0141_1.m3u8 43 | 电影_电信,http://12_央卫秒开/tsfile/live/1020_1.m3u8 44 | 经典电影_电信,http://12_央卫秒开/tsfile/live/1008_1.m3u8 45 | 西藏卫视_电信,http://12_央卫秒开/tsfile/live/0111_1.m3u8 46 | 贵州卫视_电信,http://12_央卫秒开/tsfile/live/0120_1.m3u8 47 | 辽宁卫视_电信,http://12_央卫秒开/tsfile/live/0121_1.m3u8 48 | 重庆卫视_电信,http://12_央卫秒开/tsfile/live/0142_1.m3u8 49 | 金鹰纪实_电信,http://12_央卫秒开/tsfile/live/1016_1.m3u8 50 | 陕西卫视_电信,http://12_央卫秒开/tsfile/live/0136_1.m3u8 51 | 青海卫视_电信,http://12_央卫秒开/tsfile/live/0140_1.m3u8 52 | 黑龙江卫视+_电信,http://12_央卫秒开/tsfile/live/0143_2.m3u8 53 | -------------------------------------------------------------------------------- /15_weishi.txt: -------------------------------------------------------------------------------- 1 | 上海卫视_电信,http://15_央卫秒开/tsfile/live/0107_1.m3u8 2 | 东南卫视_电信,http://15_央卫秒开/tsfile/live/0137_1.m3u8 3 | 中国气象_电信,http://15_央卫秒开/tsfile/live/1015_1.m3u8 4 | 云南卫视_电信,http://15_央卫秒开/tsfile/live/0119_1.m3u8 5 | 兵团卫视_电信,http://15_央卫秒开/tsfile/live/0115_1.m3u8 6 | 内蒙古卫视_电信,http://15_央卫秒开/tsfile/live/0109_1.m3u8 7 | 动作电影_电信,http://15_央卫秒开/tsfile/live/1019_1.m3u8 8 | 北京卫视_电信,http://15_央卫秒开/tsfile/live/0122_1.m3u8 9 | 南宁公共_电信,http://15_央卫秒开/tsfile/live/1014_1.m3u8 10 | 南宁影视_电信,http://15_央卫秒开/tsfile/live/1013_1.m3u8 11 | 南宁综合_电信,http://15_央卫秒开/tsfile/live/0143_1.m3u8 12 | 吉林卫视_电信,http://15_央卫秒开/tsfile/live/0116_1.m3u8 13 | 四川卫视_电信,http://15_央卫秒开/tsfile/live/0123_1.m3u8 14 | 天津卫视_电信,http://15_央卫秒开/tsfile/live/0135_1.m3u8 15 | 安徽卫视_电信,http://15_央卫秒开/tsfile/live/0130_1.m3u8 16 | 家庭影院_电信,http://15_央卫秒开/tsfile/live/1018_1.m3u8 17 | 山东卫视_电信,http://15_央卫秒开/tsfile/live/0131_1.m3u8 18 | 岭南戏剧_电信,http://15_央卫秒开/tsfile/live/1006_1.m3u8 19 | 广东体育_电信,http://15_央卫秒开/tsfile/live/1001_1.m3u8 20 | 广东公共_电信,http://15_央卫秒开/tsfile/live/1002_1.m3u8 21 | 广东卫视_电信,http://15_央卫秒开/tsfile/live/0125_1.m3u8 22 | 广东少儿_电信,http://15_央卫秒开/tsfile/live/1005_1.m3u8 23 | 广东影视_电信,http://15_央卫秒开/tsfile/live/1004_1.m3u8 24 | 广东新闻_电信,http://15_央卫秒开/tsfile/live/1007_1.m3u8 25 | 广东科教_电信,http://15_央卫秒开/tsfile/live/1003_1.m3u8 26 | 广西卫视_电信,http://15_央卫秒开/tsfile/live/0113_1.m3u8 27 | 广西影视_电信,http://15_央卫秒开/tsfile/live/1009_1.m3u8 28 | 广西新闻_电信,http://15_央卫秒开/tsfile/live/1012_1.m3u8 29 | 广西综艺_电信,http://15_央卫秒开/tsfile/live/1010_1.m3u8 30 | 广西都市_电信,http://15_央卫秒开/tsfile/live/1011_1.m3u8 31 | 康巴卫视_电信,http://15_央卫秒开/tsfile/live/0134_1.m3u8 32 | 教育一套_电信,http://15_央卫秒开/tsfile/live/1017_1.m3u8 33 | 旅游卫视_电信,http://15_央卫秒开/tsfile/live/0114_1.m3u8 34 | 江苏卫视_电信,http://15_央卫秒开/tsfile/live/0127_1.m3u8 35 | 江西卫视_电信,http://15_央卫秒开/tsfile/live/0138_1.m3u8 36 | 河北卫视_电信,http://15_央卫秒开/tsfile/live/0117_1.m3u8 37 | 浙江卫视_电信,http://15_央卫秒开/tsfile/live/0124_1.m3u8 38 | 深圳卫视_电信,http://15_央卫秒开/tsfile/live/0126_1.m3u8 39 | 湖北卫视_电信,http://15_央卫秒开/tsfile/live/0132_1.m3u8 40 | 湖南卫视_电信,http://15_央卫秒开/tsfile/live/0128_1.m3u8 41 | 珠江台_电信,http://15_央卫秒开/tsfile/live/1000_1.m3u8 42 | 甘肃卫视_电信,http://15_央卫秒开/tsfile/live/0141_1.m3u8 43 | 电影_电信,http://15_央卫秒开/tsfile/live/1020_1.m3u8 44 | 经典电影_电信,http://15_央卫秒开/tsfile/live/1008_1.m3u8 45 | 西藏卫视_电信,http://15_央卫秒开/tsfile/live/0111_1.m3u8 46 | 贵州卫视_电信,http://15_央卫秒开/tsfile/live/0120_1.m3u8 47 | 辽宁卫视_电信,http://15_央卫秒开/tsfile/live/0121_1.m3u8 48 | 重庆卫视_电信,http://15_央卫秒开/tsfile/live/0142_1.m3u8 49 | 金鹰纪实_电信,http://15_央卫秒开/tsfile/live/1016_1.m3u8 50 | 陕西卫视_电信,http://15_央卫秒开/tsfile/live/0136_1.m3u8 51 | 青海卫视_电信,http://15_央卫秒开/tsfile/live/0140_1.m3u8 52 | 黑龙江卫视+_电信,http://15_央卫秒开/tsfile/live/0143_2.m3u8 53 | -------------------------------------------------------------------------------- /unicom21_61_52_158.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://61.52.158.49:808/hls/1/index.m3u8 2 | CCTV10,http://61.52.158.49:808/hls/10/index.m3u8 3 | CCTV11,http://61.52.158.49:808/hls/11/index.m3u8 4 | CCTV12,http://61.52.158.49:808/hls/12/index.m3u8 5 | CCTV13,http://61.52.158.49:808/hls/13/index.m3u8 6 | CCTV14,http://61.52.158.49:808/hls/14/index.m3u8 7 | CCTV15,http://61.52.158.49:808/hls/15/index.m3u8 8 | CCTV2,http://61.52.158.49:808/hls/2/index.m3u8 9 | CCTV3,http://61.52.158.49:808/hls/3/index.m3u8 10 | CCTV4,http://61.52.158.49:808/hls/4/index.m3u8 11 | CCTV5,http://61.52.158.49:808/hls/5/index.m3u8 12 | CCTV6,http://61.52.158.49:808/hls/6/index.m3u8 13 | CCTV7,http://61.52.158.49:808/hls/7/index.m3u8 14 | CCTV8,http://61.52.158.49:808/hls/8/index.m3u8 15 | CCTV9,http://61.52.158.49:808/hls/9/index.m3u8 16 | IPTV5+,http://61.52.158.49:808/hls/75/index.m3u8 17 | 公共,http://61.52.158.49:808/hls/23/index.m3u8 18 | 内蒙古,http://61.52.158.49:808/hls/57/index.m3u8 19 | 军事,http://61.52.158.49:808/hls/68/index.m3u8 20 | 北京卫视,http://61.52.158.49:808/hls/33/index.m3u8 21 | 北京少儿,http://61.52.158.49:808/hls/60/index.m3u8 22 | 厦门卫视,http://61.52.158.49:808/hls/64/index.m3u8 23 | 嘉佳卡通,http://61.52.158.49:808/hls/63/index.m3u8 24 | 四川卫视,http://61.52.158.49:808/hls/52/index.m3u8 25 | 宁夏卫视,http://61.52.158.49:808/hls/55/index.m3u8 26 | 安徽卫视,http://61.52.158.49:808/hls/32/index.m3u8 27 | 山西卫视,http://61.52.158.49:808/hls/50/index.m3u8 28 | 收视指南,http://61.52.158.49:808/hls/62/index.m3u8 29 | 新农村,http://61.52.158.49:808/hls/24/index.m3u8 30 | 新电影,http://61.52.158.49:808/hls/73/index.m3u8 31 | 新疆卫视,http://61.52.158.49:808/hls/59/index.m3u8 32 | 新闻,http://61.52.158.49:808/hls/22/index.m3u8 33 | 梨园,http://61.52.158.49:808/hls/26/index.m3u8 34 | 民生,http://61.52.158.49:808/hls/19/index.m3u8 35 | 江苏卫视,http://61.52.158.49:808/hls/30/index.m3u8 36 | 江西卫视,http://61.52.158.49:808/hls/49/index.m3u8 37 | 河南卫视,http://61.52.158.49:808/hls/16/index.m3u8 38 | 河南国际,http://61.52.158.49:808/hls/25/index.m3u8 39 | 法治,http://61.52.158.49:808/hls/20/index.m3u8 40 | 浙江卫视,http://61.52.158.49:808/hls/31/index.m3u8 41 | 湖北卫视,http://61.52.158.49:808/hls/47/index.m3u8 42 | 热播剧场,http://61.52.158.49:808/hls/71/index.m3u8 43 | 电视剧,http://61.52.158.49:808/hls/21/index.m3u8 44 | 电视剧,http://61.52.158.49:808/hls/74/index.m3u8 45 | 相声小品,http://61.52.158.49:808/hls/17/index.m3u8 46 | 经典电影,http://61.52.158.49:808/hls/69/index.m3u8 47 | 美国大片,http://61.52.158.49:808/hls/66/index.m3u8 48 | 西藏卫视,http://61.52.158.49:808/hls/58/index.m3u8 49 | 谍战剧场,http://61.52.158.49:808/hls/70/index.m3u8 50 | 都市,http://61.52.158.49:808/hls/18/index.m3u8 51 | 金鹰卡通,http://61.52.158.49:808/hls/61/index.m3u8 52 | 陕西卫视,http://61.52.158.49:808/hls/51/index.m3u8 53 | 青海卫视,http://61.52.158.49:808/hls/56/index.m3u8 54 | -------------------------------------------------------------------------------- /prv_weishi.txt: -------------------------------------------------------------------------------- 1 | #梅州119.125.134.135:9901 2 | 凤凰卫视中文_电信,http://0_央卫秒开/tsfile/live/1132_1.m3u8 3 | 吉林卫视_电信,http://0_央卫秒开/tsfile/live/1114_1.m3u8 4 | 黑龙江卫视_电信,http://0_央卫秒开/tsfile/live/1118_1.m3u8 5 | 湖北卫视_电信,http://0_央卫秒开/tsfile/live/1119_1.m3u8 6 | 辽宁卫视_电信,http://0_央卫秒开/tsfile/live/1120_1.m3u8 7 | 重庆卫视_电信,http://0_央卫秒开/tsfile/live/1121_1.m3u8 8 | 东南卫视_电信,http://0_央卫秒开/tsfile/live/1122_1.m3u8 9 | 河南卫视_电信,http://0_央卫秒开/tsfile/live/1123_1.m3u8 10 | 香港明珠卫视_电信,http://0_央卫秒开/tsfile/live/1129_1.m3u8 11 | 本港卫视_电信,http://0_央卫秒开/tsfile/live/1130_1.m3u8 12 | 广东珠江卫视_电信,http://0_央卫秒开/tsfile/live/1156_1.m3u8 13 | 大湾区卫视_电信,http://0_央卫秒开/tsfile/live/1161_1.m3u8 14 | 贵州卫视_电信,http://0_央卫秒开/tsfile/live/1164_1.m3u8 15 | 天津卫视_电信,http://0_央卫秒开/tsfile/live/1165_1.m3u8 16 | 深圳卫视_电信,http://0_央卫秒开/tsfile/live/1166_1.m3u8 17 | 安徽卫视_电信,http://0_央卫秒开/tsfile/live/1167_1.m3u8 18 | 山东卫视_电信,http://0_央卫秒开/tsfile/live/1168_1.m3u8 19 | 北京卫视_电信,http://0_央卫秒开/tsfile/live/1169_1.m3u8 20 | 江西卫视_电信,http://0_央卫秒开/tsfile/live/1170_1.m3u8 21 | 海南卫视_电信,http://0_央卫秒开/tsfile/live/1171_1.m3u8 22 | 江苏卫视_电信,http://0_央卫秒开/tsfile/live/1172_1.m3u8 23 | 浙江卫视_电信,http://0_央卫秒开/tsfile/live/1173_1.m3u8 24 | 湖南卫视_电信,http://0_央卫秒开/tsfile/live/1174_1.m3u8 25 | 山西卫视_电信,http://0_央卫秒开/tsfile/live/1175_1.m3u8 26 | 四川卫视_电信,http://0_央卫秒开/tsfile/live/1176_1.m3u8 27 | 陕西卫视_电信,http://0_央卫秒开/tsfile/live/1177_1.m3u8 28 | 河北卫视_电信,http://0_央卫秒开/tsfile/live/1178_1.m3u8 29 | 广西卫视_电信,http://0_央卫秒开/tsfile/live/1179_1.m3u8 30 | 西藏卫视_电信,http://0_央卫秒开/tsfile/live/1181_1.m3u8 31 | 新疆卫视_电信,http://0_央卫秒开/tsfile/live/1182_1.m3u8 32 | 兵团卫视_电信,http://0_央卫秒开/tsfile/live/1183_1.m3u8 33 | 宁夏卫视_电信,http://0_央卫秒开/tsfile/live/1108_1.m3u8 34 | 35 | 凤凰卫视中文_联通,http://0_央卫秒开/tsfile/live/1132_1.m3u8 36 | 吉林卫视_联通,http://0_央卫秒开/tsfile/live/1114_1.m3u8 37 | 黑龙江卫视_联通,http://0_央卫秒开/tsfile/live/1118_1.m3u8 38 | 湖北卫视_联通,http://0_央卫秒开/tsfile/live/1119_1.m3u8 39 | 辽宁卫视_联通,http://0_央卫秒开/tsfile/live/1120_1.m3u8 40 | 重庆卫视_联通,http://0_央卫秒开/tsfile/live/1121_1.m3u8 41 | 东南卫视_联通,http://0_央卫秒开/tsfile/live/1122_1.m3u8 42 | 河南卫视_联通,http://0_央卫秒开/tsfile/live/1123_1.m3u8 43 | 香港明珠卫视_联通,http://0_央卫秒开/tsfile/live/1129_1.m3u8 44 | 本港卫视_联通,http://0_央卫秒开/tsfile/live/1130_1.m3u8 45 | 广东珠江卫视_联通,http://0_央卫秒开/tsfile/live/1156_1.m3u8 46 | 大湾区卫视_联通,http://0_央卫秒开/tsfile/live/1161_1.m3u8 47 | 贵州卫视_联通,http://0_央卫秒开/tsfile/live/1164_1.m3u8 48 | 天津卫视_联通,http://0_央卫秒开/tsfile/live/1165_1.m3u8 49 | 深圳卫视_联通,http://0_央卫秒开/tsfile/live/1166_1.m3u8 50 | 安徽卫视_联通,http://0_央卫秒开/tsfile/live/1167_1.m3u8 51 | 山东卫视_联通,http://0_央卫秒开/tsfile/live/1168_1.m3u8 52 | 北京卫视_联通,http://0_央卫秒开/tsfile/live/1169_1.m3u8 53 | 江西卫视_联通,http://0_央卫秒开/tsfile/live/1170_1.m3u8 54 | 海南卫视_联通,http://0_央卫秒开/tsfile/live/1171_1.m3u8 55 | 江苏卫视_联通,http://0_央卫秒开/tsfile/live/1172_1.m3u8 56 | 浙江卫视_联通,http://0_央卫秒开/tsfile/live/1173_1.m3u8 57 | 湖南卫视_联通,http://0_央卫秒开/tsfile/live/1174_1.m3u8 58 | 山西卫视_联通,http://0_央卫秒开/tsfile/live/1175_1.m3u8 59 | 四川卫视_联通,http://0_央卫秒开/tsfile/live/1176_1.m3u8 60 | 陕西卫视_联通,http://0_央卫秒开/tsfile/live/1177_1.m3u8 61 | 河北卫视_联通,http://0_央卫秒开/tsfile/live/1178_1.m3u8 62 | 广西卫视_联通,http://0_央卫秒开/tsfile/live/1179_1.m3u8 63 | 西藏卫视_联通,http://0_央卫秒开/tsfile/live/1181_1.m3u8 64 | 新疆卫视_联通,http://0_央卫秒开/tsfile/live/1182_1.m3u8 65 | 兵团卫视_联通,http://0_央卫秒开/tsfile/live/1183_1.m3u8 66 | 宁夏卫视_联通,http://0_央卫秒开/tsfile/live/1108_1.m3u8 67 | -------------------------------------------------------------------------------- /11_weishi.txt: -------------------------------------------------------------------------------- 1 | 三沙卫视_联通,http://11_央卫秒开/hls/62/index.m3u8 2 | 世界地理_联通,http://11_央卫秒开/hls/76/index.m3u8 3 | 东北戏曲_联通,http://11_央卫秒开/hls/25/index.m3u8 4 | 东南卫视_联通,http://11_央卫秒开/hls/44/index.m3u8 5 | 东方卫视_联通,http://11_央卫秒开/hls/31/index.m3u8 6 | 中国交通_联通,http://11_央卫秒开/hls/69/index.m3u8 7 | 乐游_联通,http://11_央卫秒开/hls/93/index.m3u8 8 | 云南卫视_联通,http://11_央卫秒开/hls/47/index.m3u8 9 | 佳佳卡通_联通,http://11_央卫秒开/hls/65/index.m3u8 10 | 兵器科技_联通,http://11_央卫秒开/hls/82/index.m3u8 11 | 兵团卫视_联通,http://11_央卫秒开/hls/58/index.m3u8 12 | 内蒙古卫视_联通,http://11_央卫秒开/hls/53/index.m3u8 13 | 动作电影_联通,http://11_央卫秒开/hls/90/index.m3u8 14 | 动漫秀场_联通,http://11_央卫秒开/hls/98/index.m3u8 15 | 北京卡酷_联通,http://11_央卫秒开/hls/63/index.m3u8 16 | 北京卫视_联通,http://11_央卫秒开/hls/30/index.m3u8 17 | 卫生健康_联通,http://11_央卫秒开/hls/88/index.m3u8 18 | 吉林乡村_联通,http://11_央卫秒开/hls/22/index.m3u8 19 | 吉林公共_联通,http://11_央卫秒开/hls/23/index.m3u8 20 | 吉林卫视_联通,http://11_央卫秒开/hls/18/index.m3u8 21 | 吉林影视_联通,http://11_央卫秒开/hls/21/index.m3u8 22 | 吉林教育_联通,http://11_央卫秒开/hls/27/index.m3u8 23 | 吉林生活_联通,http://11_央卫秒开/hls/20/index.m3u8 24 | 吉林综艺_联通,http://11_央卫秒开/hls/24/index.m3u8 25 | 吉林都视_联通,http://11_央卫秒开/hls/19/index.m3u8 26 | 哈哈炫动_联通,http://11_央卫秒开/hls/66/index.m3u8 27 | 四川卫视_联通,http://11_央卫秒开/hls/57/index.m3u8 28 | 国学_联通,http://11_央卫秒开/hls/85/index.m3u8 29 | 天津卫视_联通,http://11_央卫秒开/hls/36/index.m3u8 30 | 女性时尚_联通,http://11_央卫秒开/hls/73/index.m3u8 31 | 宁夏卫视_联通,http://11_央卫秒开/hls/61/index.m3u8 32 | 安徽卫视_联通,http://11_央卫秒开/hls/38/index.m3u8 33 | 家庭影院_联通,http://11_央卫秒开/hls/92/index.m3u8 34 | 山东卫视_联通,http://11_央卫秒开/hls/40/index.m3u8 35 | 山西卫视_联通,http://11_央卫秒开/hls/52/index.m3u8 36 | 广东卫视_联通,http://11_央卫秒开/hls/39/index.m3u8 37 | 广西卫视_联通,http://11_央卫秒开/hls/55/index.m3u8 38 | 延边卫视_联通,http://11_央卫秒开/hls/26/index.m3u8 39 | 快乐垂钓_联通,http://11_央卫秒开/hls/100/index.m3u8 40 | 怀旧剧场_联通,http://11_央卫秒开/hls/80/index.m3u8 41 | 新疆卫视_联通,http://11_央卫秒开/hls/60/index.m3u8 42 | 江苏卫视_联通,http://11_央卫秒开/hls/32/index.m3u8 43 | 江西卫视_联通,http://11_央卫秒开/hls/54/index.m3u8 44 | 汽摩_联通,http://11_央卫秒开/hls/84/index.m3u8 45 | 河北卫视_联通,http://11_央卫秒开/hls/43/index.m3u8 46 | 河南卫视_联通,http://11_央卫秒开/hls/51/index.m3u8 47 | 法治天地_联通,http://11_央卫秒开/hls/94/index.m3u8 48 | 浙江卫视_联通,http://11_央卫秒开/hls/33/index.m3u8 49 | 海南卫视_联通,http://11_央卫秒开/hls/48/index.m3u8 50 | 深圳卫视_联通,http://11_央卫秒开/hls/37/index.m3u8 51 | 游戏风云_联通,http://11_央卫秒开/hls/99/index.m3u8 52 | 湖北卫视_联通,http://11_央卫秒开/hls/45/index.m3u8 53 | 湖南卫视_联通,http://11_央卫秒开/hls/34/index.m3u8 54 | 环球奇观_联通,http://11_央卫秒开/hls/74/index.m3u8 55 | 甘肃卫视_联通,http://11_央卫秒开/hls/59/index.m3u8 56 | 生活时尚_联通,http://11_央卫秒开/hls/96/index.m3u8 57 | 电影_联通,http://11_央卫秒开/hls/91/index.m3u8 58 | 电视指南_联通,http://11_央卫秒开/hls/87/index.m3u8 59 | 第一剧场_联通,http://11_央卫秒开/hls/75/index.m3u8 60 | 纪实人文_联通,http://11_央卫秒开/hls/67/index.m3u8 61 | 茶_联通,http://11_央卫秒开/hls/101/index.m3u8 62 | 西藏卫视_联通,http://11_央卫秒开/hls/56/index.m3u8 63 | 贵州卫视_联通,http://11_央卫秒开/hls/41/index.m3u8 64 | 辽宁卫视_联通,http://11_央卫秒开/hls/35/index.m3u8 65 | 都市剧场_联通,http://11_央卫秒开/hls/97/index.m3u8 66 | 重庆卫视_联通,http://11_央卫秒开/hls/46/index.m3u8 67 | 金色学堂_联通,http://11_央卫秒开/hls/95/index.m3u8 68 | 金鹰卡通_联通,http://11_央卫秒开/hls/64/index.m3u8 69 | 金鹰纪实_联通,http://11_央卫秒开/hls/68/index.m3u8 70 | 长影_联通,http://11_央卫秒开/hls/28/index.m3u8 71 | 陕西卫视_联通,http://11_央卫秒开/hls/49/index.m3u8 72 | 青海卫视_联通,http://11_央卫秒开/hls/50/index.m3u8 73 | 黑龙江卫视_联通,http://11_央卫秒开/hls/42/index.m3u8 74 | -------------------------------------------------------------------------------- /duliip_36_99_132.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://36.99.132.88:808/hls/1/index.m3u8 2 | CCTV10,http://36.99.132.88:808/hls/10/index.m3u8 3 | CCTV11,http://36.99.132.88:808/hls/11/index.m3u8 4 | CCTV12,http://36.99.132.88:808/hls/12/index.m3u8 5 | CCTV13,http://36.99.132.88:808/hls/13/index.m3u8 6 | CCTV14,http://36.99.132.88:808/hls/14/index.m3u8 7 | CCTV15,http://36.99.132.88:808/hls/15/index.m3u8 8 | CCTV17,http://36.99.132.88:808/hls/17/index.m3u8 9 | CCTV2,http://36.99.132.88:808/hls/2/index.m3u8 10 | CCTV3,http://36.99.132.88:808/hls/3/index.m3u8 11 | CCTV4,http://36.99.132.88:808/hls/4/index.m3u8 12 | CCTV5+,http://36.99.132.88:808/hls/18/index.m3u8 13 | CCTV5,http://36.99.132.88:808/hls/5/index.m3u8 14 | CCTV6,http://36.99.132.88:808/hls/6/index.m3u8 15 | CCTV7,http://36.99.132.88:808/hls/7/index.m3u8 16 | CCTV8,http://36.99.132.88:808/hls/8/index.m3u8 17 | CCTV9,http://36.99.132.88:808/hls/9/index.m3u8 18 | CNTV,http://36.99.132.88:808/hls/16/index.m3u8 19 | Err画中画,http://36.99.132.88:808/hls/14/index.m3u8 20 | 东南卫视,http://36.99.132.88:808/hls/83/index.m3u8 21 | 东方卫视,http://36.99.132.88:808/hls/62/index.m3u8 22 | 云南卫视,http://36.99.132.88:808/hls/79/index.m3u8 23 | 信阳公共,http://36.99.132.88:808/hls/101/index.m3u8 24 | 信阳综合,http://36.99.132.88:808/hls/100/index.m3u8 25 | 内蒙古卫视,http://36.99.132.88:808/hls/84/index.m3u8 26 | 北京卫视,http://36.99.132.88:808/hls/64/index.m3u8 27 | 卡酷动画,http://36.99.132.88:808/hls/93/index.m3u8 28 | 吉林卫视,http://36.99.132.88:808/hls/81/index.m3u8 29 | 嘉佳卡通,http://36.99.132.88:808/hls/92/index.m3u8 30 | 四川卫视,http://36.99.132.88:808/hls/76/index.m3u8 31 | 天津卫视,http://36.99.132.88:808/hls/78/index.m3u8 32 | 宁夏卫视,http://36.99.132.88:808/hls/82/index.m3u8 33 | 安徽卫视,http://36.99.132.88:808/hls/68/index.m3u8 34 | 山东卫视,http://36.99.132.88:808/hls/67/index.m3u8 35 | 山西卫视,http://36.99.132.88:808/hls/86/index.m3u8 36 | 平桥广电中心,http://36.99.132.88:808/hls/103/index.m3u8 37 | 广东卫视,http://36.99.132.88:808/hls/65/index.m3u8 38 | 广西卫视,http://36.99.132.88:808/hls/85/index.m3u8 39 | 江苏卫视,http://36.99.132.88:808/hls/63/index.m3u8 40 | 江西卫视,http://36.99.132.88:808/hls/73/index.m3u8 41 | 河北卫视,http://36.99.132.88:808/hls/72/index.m3u8 42 | 河南公共,http://36.99.132.88:808/hls/38/index.m3u8 43 | 河南卫视,http://36.99.132.88:808/hls/31/index.m3u8 44 | 河南国际,http://36.99.132.88:808/hls/40/index.m3u8 45 | 河南新农村,http://36.99.132.88:808/hls/39/index.m3u8 46 | 河南民生,http://36.99.132.88:808/hls/33/index.m3u8 47 | 河南法制,http://36.99.132.88:808/hls/34/index.m3u8 48 | 河南电视剧,http://36.99.132.88:808/hls/35/index.m3u8 49 | 河南都市,http://36.99.132.88:808/hls/32/index.m3u8 50 | 浉河广电中心,http://36.99.132.88:808/hls/102/index.m3u8 51 | 浙江卫视,http://36.99.132.88:808/hls/61/index.m3u8 52 | 海南卫视,http://36.99.132.88:808/hls/88/index.m3u8 53 | 深圳卫视,http://36.99.132.88:808/hls/75/index.m3u8 54 | 湖北卫视,http://36.99.132.88:808/hls/77/index.m3u8 55 | 湖南卫视,http://36.99.132.88:808/hls/74/index.m3u8 56 | 炫动卡通,http://36.99.132.88:808/hls/94/index.m3u8 57 | 甘肃卫视,http://36.99.132.88:808/hls/89/index.m3u8 58 | 贵州卫视,http://36.99.132.88:808/hls/71/index.m3u8 59 | 辽宁卫视,http://36.99.132.88:808/hls/69/index.m3u8 60 | 重庆卫视,http://36.99.132.88:808/hls/80/index.m3u8 61 | 金鹰卡通,http://36.99.132.88:808/hls/91/index.m3u8 62 | 陕西卫视,http://36.99.132.88:808/hls/70/index.m3u8 63 | 青海卫视,http://36.99.132.88:808/hls/90/index.m3u8 64 | 黑龙江卫视,http://36.99.132.88:808/hls/66/index.m3u8 65 | -------------------------------------------------------------------------------- /unicom23_221_5_12.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://221.5.12.130:2223/hls/23/index.m3u8 2 | CCTV10,http://221.5.12.130:2223/hls/56/index.m3u8 3 | CCTV11,http://221.5.12.130:2223/hls/60/index.m3u8 4 | CCTV12,http://221.5.12.130:2223/hls/81/index.m3u8 5 | CCTV13,http://221.5.12.130:2223/hls/65/index.m3u8 6 | CCTV14,http://221.5.12.130:2223/hls/84/index.m3u8 7 | CCTV15,http://221.5.12.130:2223/hls/70/index.m3u8 8 | CCTV3,http://221.5.12.130:2223/hls/24/index.m3u8 9 | CCTV4,http://221.5.12.130:2223/hls/74/index.m3u8 10 | CCTV5+,http://221.5.12.130:2223/hls/91/index.m3u8 11 | CCTV5,http://221.5.12.130:2223/hls/89/index.m3u8 12 | CCTV6,http://221.5.12.130:2223/hls/75/index.m3u8 13 | CCTV7,http://221.5.12.130:2223/hls/79/index.m3u8 14 | CCTV8,http://221.5.12.130:2223/hls/80/index.m3u8 15 | CCTV9,http://221.5.12.130:2223/hls/90/index.m3u8 16 | TVB星河台,http://221.5.12.130:2223/hls/16/index.m3u8 17 | TVS1,http://221.5.12.130:2223/hls/1/index.m3u8 18 | 东南卫视,http://221.5.12.130:2223/hls/37/index.m3u8 19 | 东方卫视,http://221.5.12.130:2223/hls/67/index.m3u8 20 | 东森新闻,http://221.5.12.130:2223/hls/13/index.m3u8 21 | 云南卫视,http://221.5.12.130:2223/hls/55/index.m3u8 22 | 优漫卡通,http://221.5.12.130:2223/hls/77/index.m3u8 23 | 体育,http://221.5.12.130:2223/hls/89/index.m3u8 24 | 内蒙古卫视,http://221.5.12.130:2223/hls/57/index.m3u8 25 | 军事农业,http://221.5.12.130:2223/hls/79/index.m3u8 26 | 凤凰中文,http://221.5.12.130:2223/hls/15/index.m3u8 27 | 凤凰资讯,http://221.5.12.130:2223/hls/12/index.m3u8 28 | 北京卫视,http://221.5.12.130:2223/hls/78/index.m3u8 29 | 南方卫视,http://221.5.12.130:2223/hls/59/index.m3u8 30 | 嘉佳卡通,http://221.5.12.130:2223/hls/72/index.m3u8 31 | 四川卫视,http://221.5.12.130:2223/hls/66/index.m3u8 32 | 国际,http://221.5.12.130:2223/hls/74/index.m3u8 33 | 天津卫视,http://221.5.12.130:2223/hls/92/index.m3u8 34 | 宁夏卫视,http://221.5.12.130:2223/hls/58/index.m3u8 35 | 安徽卫视,http://221.5.12.130:2223/hls/34/index.m3u8 36 | 少儿,http://221.5.12.130:2223/hls/84/index.m3u8 37 | 山东卫视,http://221.5.12.130:2223/hls/88/index.m3u8 38 | 广东体育,http://221.5.12.130:2223/hls/1/index.m3u8 39 | 广东卫视,http://221.5.12.130:2223/hls/14/index.m3u8 40 | 广东影视,http://221.5.12.130:2223/hls/46/index.m3u8 41 | 广东新闻,http://221.5.12.130:2223/hls/5/index.m3u8 42 | 广东珠江,http://221.5.12.130:2223/hls/2/index.m3u8 43 | 揭阳综合,http://221.5.12.130:2223/hls/11/index.m3u8 44 | 新闻,http://221.5.12.130:2223/hls/65/index.m3u8 45 | 普宁台,http://221.5.12.130:2223/hls/12/index.m3u8 46 | 汕头一台,http://221.5.12.130:2223/hls/76/index.m3u8 47 | 汕头三台,http://221.5.12.130:2223/hls/62/index.m3u8 48 | 汕头二台,http://221.5.12.130:2223/hls/69/index.m3u8 49 | 江苏卫视,http://221.5.12.130:2223/hls/71/index.m3u8 50 | 江西卫视,http://221.5.12.130:2223/hls/87/index.m3u8 51 | 河北卫视,http://221.5.12.130:2223/hls/47/index.m3u8 52 | 河南卫视,http://221.5.12.130:2223/hls/64/index.m3u8 53 | 浙江卫视,http://221.5.12.130:2223/hls/29/index.m3u8 54 | 深圳卫视,http://221.5.12.130:2223/hls/82/index.m3u8 55 | 深圳电视剧,http://221.5.12.130:2223/hls/10/index.m3u8 56 | 深圳都市,http://221.5.12.130:2223/hls/61/index.m3u8 57 | 湖北卫视,http://221.5.12.130:2223/hls/68/index.m3u8 58 | 湖南卫视,http://221.5.12.130:2223/hls/63/index.m3u8 59 | 电影,http://221.5.12.130:2223/hls/75/index.m3u8 60 | 电视剧,http://221.5.12.130:2223/hls/80/index.m3u8 61 | 社会与法,http://221.5.12.130:2223/hls/81/index.m3u8 62 | 综合,http://221.5.12.130:2223/hls/23/index.m3u8 63 | 综艺,http://221.5.12.130:2223/hls/24/index.m3u8 64 | 财经,http://221.5.12.130:2223/hls/73/index.m3u8 65 | 重庆卫视,http://221.5.12.130:2223/hls/93/index.m3u8 66 | 金鹰卡通,http://221.5.12.130:2223/hls/83/index.m3u8 67 | 陕西卫视,http://221.5.12.130:2223/hls/54/index.m3u8 68 | 音乐,http://221.5.12.130:2223/hls/70/index.m3u8 69 | 风云足球,http://221.5.12.130:2223/hls/85/index.m3u8 70 | CCTV2,http://221.5.12.130:2223/hls/73/index.m3u8 71 | -------------------------------------------------------------------------------- /ip_head.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import requests 4 | from requests.exceptions import Timeout 5 | 6 | load_urls = [ 7 | "http://mywlkj.ddns.net:754/tv.php?id=63", 8 | ] 9 | file_contents = [] 10 | with open("mywlkj_gt.txt", 'r', encoding='utf-8') as file: 11 | url_list = file.readlines() 12 | 13 | def get_redirected_urls(url_list): 14 | session = requests.Session() 15 | redirected_urls = [] 16 | for line in url_list: 17 | try: 18 | line = line.strip() 19 | count = line.count(',') 20 | if count == 1: 21 | if line: 22 | channel_name, channel_url = line.split(',') 23 | print("==========>>>>>",channel_name, channel_url) 24 | if '#' not in channel_url and 'mp4' not in channel_url: 25 | try: 26 | response = requests.head(channel_url, allow_redirects=False, timeout=1.5) 27 | # 如果初始请求返回200,但之后服务器又发出了302重定向,我们需要处理这种情况 28 | if response.status_code == 200 and 'Location' in response.headers: 29 | redirected_url = response.headers['Location'] 30 | redirected_response = session.head(redirected_url) 31 | new_url = f"{channel_name},{redirected_url}" 32 | print("--------------再次定向------》",redirected_url,redirected_response.url) 33 | redirected_urls.append(new_url) 34 | # 如果初始请求直接返回了重定向,我们直接返回重定向的URL 35 | elif response.status_code in [301, 302, 303, 307, 308]: 36 | print("--------------直接定向------》",response.headers['Location']) 37 | _url = response.headers['Location'] 38 | new_url = f"{channel_name},{_url}" 39 | redirected_urls.append(new_url) 40 | else: 41 | # 如果没有重定向,返回原始URL 42 | new_url = channel_name, channel_url 43 | redirected_urls.append(line) 44 | except Timeout: 45 | new_url = f"timeout_{channel_name}", channel_url 46 | redirected_urls.append(line) 47 | print("请求超时") 48 | except requests.RequestException as e: 49 | new_url = f"error_{channel_name}", channel_url 50 | redirected_urls.append(line) 51 | print(f"请求发生错误: {e}") 52 | else: 53 | # 如果没有重定向,返回原始URL 54 | new_url = channel_name, channel_url 55 | redirected_urls.append(line) 56 | else: 57 | redirected_urls.append(line) 58 | else: 59 | redirected_urls.append(line) 60 | except: 61 | print(url_list) 62 | 63 | return redirected_urls 64 | 65 | # 示例用法 66 | redirected_urls = get_redirected_urls(url_list) 67 | 68 | with open("mywlkj_all_gt.txt", 'w', encoding='utf-8') as file: 69 | for line in redirected_urls: 70 | if len(line) > 0: 71 | name, name_url = line.split(',') 72 | channel_url =(f"{name_url}") 73 | channel_url = channel_url.replace("https://gitee.com/tv2785/tvbox/raw/master/gg.mp4", "https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4") 74 | file.write(f"{name},{channel_url}\n") 75 | print(line) 76 | file.close() 77 | -------------------------------------------------------------------------------- /duliip_113_15_187.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://113.15.187.104:8181/tsfile/live/0001_1.m3u8 2 | CCTV10,http://113.15.187.104:8181/tsfile/live/0010_1.m3u8 3 | CCTV11,http://113.15.187.104:8181/tsfile/live/0011_1.m3u8 4 | CCTV12,http://113.15.187.104:8181/tsfile/live/0012_1.m3u8 5 | CCTV13,http://113.15.187.104:8181/tsfile/live/0013_1.m3u8 6 | CCTV14,http://113.15.187.104:8181/tsfile/live/0014_1.m3u8 7 | CCTV15,http://113.15.187.104:8181/tsfile/live/0015_1.m3u8 8 | CCTV16,http://113.15.187.104:8181/tsfile/live/1021_1.m3u8 9 | CCTV17,http://113.15.187.104:8181/tsfile/live/0019_1.m3u8 10 | CCTV2,http://113.15.187.104:8181/tsfile/live/0002_1.m3u8 11 | CCTV3,http://113.15.187.104:8181/tsfile/live/0003_1.m3u8 12 | CCTV4,http://113.15.187.104:8181/tsfile/live/0004_1.m3u8 13 | CCTV5+,http://113.15.187.104:8181/tsfile/live/0016_1.m3u8 14 | CCTV5,http://113.15.187.104:8181/tsfile/live/0005_1.m3u8 15 | CCTV6,http://113.15.187.104:8181/tsfile/live/0006_1.m3u8 16 | CCTV7,http://113.15.187.104:8181/tsfile/live/0007_1.m3u8 17 | CCTV8,http://113.15.187.104:8181/tsfile/live/0008_1.m3u8 18 | CCTV9,http://113.15.187.104:8181/tsfile/live/0009_1.m3u8 19 | 上海卫视,http://113.15.187.104:8181/tsfile/live/0107_1.m3u8 20 | 东南卫视,http://113.15.187.104:8181/tsfile/live/0137_1.m3u8 21 | 中国气象,http://113.15.187.104:8181/tsfile/live/1015_1.m3u8 22 | 云南卫视,http://113.15.187.104:8181/tsfile/live/0119_1.m3u8 23 | 兵团卫视,http://113.15.187.104:8181/tsfile/live/0115_1.m3u8 24 | 内蒙古卫视,http://113.15.187.104:8181/tsfile/live/0109_1.m3u8 25 | 动作电影,http://113.15.187.104:8181/tsfile/live/1019_1.m3u8 26 | 北京卫视,http://113.15.187.104:8181/tsfile/live/0122_1.m3u8 27 | 南宁公共,http://113.15.187.104:8181/tsfile/live/1014_1.m3u8 28 | 南宁影视,http://113.15.187.104:8181/tsfile/live/1013_1.m3u8 29 | 南宁综合,http://113.15.187.104:8181/tsfile/live/0143_1.m3u8 30 | 吉林卫视,http://113.15.187.104:8181/tsfile/live/0116_1.m3u8 31 | 四川卫视,http://113.15.187.104:8181/tsfile/live/0123_1.m3u8 32 | 天津卫视,http://113.15.187.104:8181/tsfile/live/0135_1.m3u8 33 | 安徽卫视,http://113.15.187.104:8181/tsfile/live/0130_1.m3u8 34 | 家庭影院,http://113.15.187.104:8181/tsfile/live/1018_1.m3u8 35 | 山东卫视,http://113.15.187.104:8181/tsfile/live/0131_1.m3u8 36 | 岭南戏剧,http://113.15.187.104:8181/tsfile/live/1006_1.m3u8 37 | 广东体育,http://113.15.187.104:8181/tsfile/live/1001_1.m3u8 38 | 广东公共,http://113.15.187.104:8181/tsfile/live/1002_1.m3u8 39 | 广东卫视,http://113.15.187.104:8181/tsfile/live/0125_1.m3u8 40 | 广东少儿,http://113.15.187.104:8181/tsfile/live/1005_1.m3u8 41 | 广东影视,http://113.15.187.104:8181/tsfile/live/1004_1.m3u8 42 | 广东新闻,http://113.15.187.104:8181/tsfile/live/1007_1.m3u8 43 | 广东科教,http://113.15.187.104:8181/tsfile/live/1003_1.m3u8 44 | 广西卫视,http://113.15.187.104:8181/tsfile/live/0113_1.m3u8 45 | 广西影视,http://113.15.187.104:8181/tsfile/live/1009_1.m3u8 46 | 广西新闻,http://113.15.187.104:8181/tsfile/live/1012_1.m3u8 47 | 广西综艺,http://113.15.187.104:8181/tsfile/live/1010_1.m3u8 48 | 广西都市,http://113.15.187.104:8181/tsfile/live/1011_1.m3u8 49 | 康巴卫视,http://113.15.187.104:8181/tsfile/live/0134_1.m3u8 50 | 教育一套,http://113.15.187.104:8181/tsfile/live/1017_1.m3u8 51 | 旅游卫视,http://113.15.187.104:8181/tsfile/live/0114_1.m3u8 52 | 江苏卫视,http://113.15.187.104:8181/tsfile/live/0127_1.m3u8 53 | 江西卫视,http://113.15.187.104:8181/tsfile/live/0138_1.m3u8 54 | 河北卫视,http://113.15.187.104:8181/tsfile/live/0117_1.m3u8 55 | 浙江卫视,http://113.15.187.104:8181/tsfile/live/0124_1.m3u8 56 | 深圳卫视,http://113.15.187.104:8181/tsfile/live/0126_1.m3u8 57 | 湖北卫视,http://113.15.187.104:8181/tsfile/live/0132_1.m3u8 58 | 湖南卫视,http://113.15.187.104:8181/tsfile/live/0128_1.m3u8 59 | 珠江台,http://113.15.187.104:8181/tsfile/live/1000_1.m3u8 60 | 甘肃卫视,http://113.15.187.104:8181/tsfile/live/0141_1.m3u8 61 | 电影,http://113.15.187.104:8181/tsfile/live/1020_1.m3u8 62 | 经典电影,http://113.15.187.104:8181/tsfile/live/1008_1.m3u8 63 | 西藏卫视,http://113.15.187.104:8181/tsfile/live/0111_1.m3u8 64 | 贵州卫视,http://113.15.187.104:8181/tsfile/live/0120_1.m3u8 65 | 辽宁卫视,http://113.15.187.104:8181/tsfile/live/0121_1.m3u8 66 | 重庆卫视,http://113.15.187.104:8181/tsfile/live/0142_1.m3u8 67 | 金鹰纪实,http://113.15.187.104:8181/tsfile/live/1016_1.m3u8 68 | 陕西卫视,http://113.15.187.104:8181/tsfile/live/0136_1.m3u8 69 | 青海卫视,http://113.15.187.104:8181/tsfile/live/0140_1.m3u8 70 | 黑龙江卫视+,http://113.15.187.104:8181/tsfile/live/0143_2.m3u8 71 | -------------------------------------------------------------------------------- /duliip_222_218_158.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://222.218.158.31:8181/tsfile/live/0001_1.m3u8 2 | CCTV10,http://222.218.158.31:8181/tsfile/live/0010_1.m3u8 3 | CCTV11,http://222.218.158.31:8181/tsfile/live/0011_1.m3u8 4 | CCTV12,http://222.218.158.31:8181/tsfile/live/0012_1.m3u8 5 | CCTV13,http://222.218.158.31:8181/tsfile/live/0013_1.m3u8 6 | CCTV14,http://222.218.158.31:8181/tsfile/live/0014_1.m3u8 7 | CCTV15,http://222.218.158.31:8181/tsfile/live/0015_1.m3u8 8 | CCTV16,http://222.218.158.31:8181/tsfile/live/1021_1.m3u8 9 | CCTV17,http://222.218.158.31:8181/tsfile/live/0019_1.m3u8 10 | CCTV2,http://222.218.158.31:8181/tsfile/live/0002_1.m3u8 11 | CCTV3,http://222.218.158.31:8181/tsfile/live/0003_1.m3u8 12 | CCTV4,http://222.218.158.31:8181/tsfile/live/0004_1.m3u8 13 | CCTV5+,http://222.218.158.31:8181/tsfile/live/0016_1.m3u8 14 | CCTV5,http://222.218.158.31:8181/tsfile/live/0005_1.m3u8 15 | CCTV6,http://222.218.158.31:8181/tsfile/live/0006_1.m3u8 16 | CCTV7,http://222.218.158.31:8181/tsfile/live/0007_1.m3u8 17 | CCTV8,http://222.218.158.31:8181/tsfile/live/0008_1.m3u8 18 | CCTV9,http://222.218.158.31:8181/tsfile/live/0009_1.m3u8 19 | 上海卫视,http://222.218.158.31:8181/tsfile/live/0107_1.m3u8 20 | 东南卫视,http://222.218.158.31:8181/tsfile/live/0137_1.m3u8 21 | 中国气象,http://222.218.158.31:8181/tsfile/live/1015_1.m3u8 22 | 云南卫视,http://222.218.158.31:8181/tsfile/live/0119_1.m3u8 23 | 兵团卫视,http://222.218.158.31:8181/tsfile/live/0115_1.m3u8 24 | 内蒙古卫视,http://222.218.158.31:8181/tsfile/live/0109_1.m3u8 25 | 动作电影,http://222.218.158.31:8181/tsfile/live/1019_1.m3u8 26 | 北京卫视,http://222.218.158.31:8181/tsfile/live/0122_1.m3u8 27 | 南宁公共,http://222.218.158.31:8181/tsfile/live/1014_1.m3u8 28 | 南宁影视,http://222.218.158.31:8181/tsfile/live/1013_1.m3u8 29 | 南宁综合,http://222.218.158.31:8181/tsfile/live/0143_1.m3u8 30 | 吉林卫视,http://222.218.158.31:8181/tsfile/live/0116_1.m3u8 31 | 四川卫视,http://222.218.158.31:8181/tsfile/live/0123_1.m3u8 32 | 天津卫视,http://222.218.158.31:8181/tsfile/live/0135_1.m3u8 33 | 安徽卫视,http://222.218.158.31:8181/tsfile/live/0130_1.m3u8 34 | 家庭影院,http://222.218.158.31:8181/tsfile/live/1018_1.m3u8 35 | 山东卫视,http://222.218.158.31:8181/tsfile/live/0131_1.m3u8 36 | 岭南戏剧,http://222.218.158.31:8181/tsfile/live/1006_1.m3u8 37 | 广东体育,http://222.218.158.31:8181/tsfile/live/1001_1.m3u8 38 | 广东公共,http://222.218.158.31:8181/tsfile/live/1002_1.m3u8 39 | 广东卫视,http://222.218.158.31:8181/tsfile/live/0125_1.m3u8 40 | 广东少儿,http://222.218.158.31:8181/tsfile/live/1005_1.m3u8 41 | 广东影视,http://222.218.158.31:8181/tsfile/live/1004_1.m3u8 42 | 广东新闻,http://222.218.158.31:8181/tsfile/live/1007_1.m3u8 43 | 广东科教,http://222.218.158.31:8181/tsfile/live/1003_1.m3u8 44 | 广西卫视,http://222.218.158.31:8181/tsfile/live/0113_1.m3u8 45 | 广西影视,http://222.218.158.31:8181/tsfile/live/1009_1.m3u8 46 | 广西新闻,http://222.218.158.31:8181/tsfile/live/1012_1.m3u8 47 | 广西综艺,http://222.218.158.31:8181/tsfile/live/1010_1.m3u8 48 | 广西都市,http://222.218.158.31:8181/tsfile/live/1011_1.m3u8 49 | 康巴卫视,http://222.218.158.31:8181/tsfile/live/0134_1.m3u8 50 | 教育一套,http://222.218.158.31:8181/tsfile/live/1017_1.m3u8 51 | 旅游卫视,http://222.218.158.31:8181/tsfile/live/0114_1.m3u8 52 | 江苏卫视,http://222.218.158.31:8181/tsfile/live/0127_1.m3u8 53 | 江西卫视,http://222.218.158.31:8181/tsfile/live/0138_1.m3u8 54 | 河北卫视,http://222.218.158.31:8181/tsfile/live/0117_1.m3u8 55 | 浙江卫视,http://222.218.158.31:8181/tsfile/live/0124_1.m3u8 56 | 深圳卫视,http://222.218.158.31:8181/tsfile/live/0126_1.m3u8 57 | 湖北卫视,http://222.218.158.31:8181/tsfile/live/0132_1.m3u8 58 | 湖南卫视,http://222.218.158.31:8181/tsfile/live/0128_1.m3u8 59 | 珠江台,http://222.218.158.31:8181/tsfile/live/1000_1.m3u8 60 | 甘肃卫视,http://222.218.158.31:8181/tsfile/live/0141_1.m3u8 61 | 电影,http://222.218.158.31:8181/tsfile/live/1020_1.m3u8 62 | 经典电影,http://222.218.158.31:8181/tsfile/live/1008_1.m3u8 63 | 西藏卫视,http://222.218.158.31:8181/tsfile/live/0111_1.m3u8 64 | 贵州卫视,http://222.218.158.31:8181/tsfile/live/0120_1.m3u8 65 | 辽宁卫视,http://222.218.158.31:8181/tsfile/live/0121_1.m3u8 66 | 重庆卫视,http://222.218.158.31:8181/tsfile/live/0142_1.m3u8 67 | 金鹰纪实,http://222.218.158.31:8181/tsfile/live/1016_1.m3u8 68 | 陕西卫视,http://222.218.158.31:8181/tsfile/live/0136_1.m3u8 69 | 青海卫视,http://222.218.158.31:8181/tsfile/live/0140_1.m3u8 70 | 黑龙江卫视+,http://222.218.158.31:8181/tsfile/live/0143_2.m3u8 71 | -------------------------------------------------------------------------------- /duliip_219_159_194.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://219.159.194.195:8181/tsfile/live/0001_1.m3u8 2 | CCTV10,http://219.159.194.195:8181/tsfile/live/0010_1.m3u8 3 | CCTV11,http://219.159.194.195:8181/tsfile/live/0011_1.m3u8 4 | CCTV12,http://219.159.194.195:8181/tsfile/live/0012_1.m3u8 5 | CCTV13,http://219.159.194.195:8181/tsfile/live/0013_1.m3u8 6 | CCTV14,http://219.159.194.195:8181/tsfile/live/0014_1.m3u8 7 | CCTV15,http://219.159.194.195:8181/tsfile/live/0015_1.m3u8 8 | CCTV16,http://219.159.194.195:8181/tsfile/live/1021_1.m3u8 9 | CCTV17,http://219.159.194.195:8181/tsfile/live/0019_1.m3u8 10 | CCTV2,http://219.159.194.195:8181/tsfile/live/0002_1.m3u8 11 | CCTV3,http://219.159.194.195:8181/tsfile/live/0003_1.m3u8 12 | CCTV4,http://219.159.194.195:8181/tsfile/live/0004_1.m3u8 13 | CCTV5+,http://219.159.194.195:8181/tsfile/live/0016_1.m3u8 14 | CCTV5,http://219.159.194.195:8181/tsfile/live/0005_1.m3u8 15 | CCTV6,http://219.159.194.195:8181/tsfile/live/0006_1.m3u8 16 | CCTV7,http://219.159.194.195:8181/tsfile/live/0007_1.m3u8 17 | CCTV8,http://219.159.194.195:8181/tsfile/live/0008_1.m3u8 18 | CCTV9,http://219.159.194.195:8181/tsfile/live/0009_1.m3u8 19 | 上海卫视,http://219.159.194.195:8181/tsfile/live/0107_1.m3u8 20 | 东南卫视,http://219.159.194.195:8181/tsfile/live/0137_1.m3u8 21 | 中国气象,http://219.159.194.195:8181/tsfile/live/1015_1.m3u8 22 | 云南卫视,http://219.159.194.195:8181/tsfile/live/0119_1.m3u8 23 | 兵团卫视,http://219.159.194.195:8181/tsfile/live/0115_1.m3u8 24 | 内蒙古卫视,http://219.159.194.195:8181/tsfile/live/0109_1.m3u8 25 | 动作电影,http://219.159.194.195:8181/tsfile/live/1019_1.m3u8 26 | 北京卫视,http://219.159.194.195:8181/tsfile/live/0122_1.m3u8 27 | 南宁公共,http://219.159.194.195:8181/tsfile/live/1014_1.m3u8 28 | 南宁影视,http://219.159.194.195:8181/tsfile/live/1013_1.m3u8 29 | 南宁综合,http://219.159.194.195:8181/tsfile/live/0143_1.m3u8 30 | 吉林卫视,http://219.159.194.195:8181/tsfile/live/0116_1.m3u8 31 | 四川卫视,http://219.159.194.195:8181/tsfile/live/0123_1.m3u8 32 | 天津卫视,http://219.159.194.195:8181/tsfile/live/0135_1.m3u8 33 | 安徽卫视,http://219.159.194.195:8181/tsfile/live/0130_1.m3u8 34 | 家庭影院,http://219.159.194.195:8181/tsfile/live/1018_1.m3u8 35 | 山东卫视,http://219.159.194.195:8181/tsfile/live/0131_1.m3u8 36 | 岭南戏剧,http://219.159.194.195:8181/tsfile/live/1006_1.m3u8 37 | 广东体育,http://219.159.194.195:8181/tsfile/live/1001_1.m3u8 38 | 广东公共,http://219.159.194.195:8181/tsfile/live/1002_1.m3u8 39 | 广东卫视,http://219.159.194.195:8181/tsfile/live/0125_1.m3u8 40 | 广东少儿,http://219.159.194.195:8181/tsfile/live/1005_1.m3u8 41 | 广东影视,http://219.159.194.195:8181/tsfile/live/1004_1.m3u8 42 | 广东新闻,http://219.159.194.195:8181/tsfile/live/1007_1.m3u8 43 | 广东科教,http://219.159.194.195:8181/tsfile/live/1003_1.m3u8 44 | 广西卫视,http://219.159.194.195:8181/tsfile/live/0113_1.m3u8 45 | 广西影视,http://219.159.194.195:8181/tsfile/live/1009_1.m3u8 46 | 广西新闻,http://219.159.194.195:8181/tsfile/live/1012_1.m3u8 47 | 广西综艺,http://219.159.194.195:8181/tsfile/live/1010_1.m3u8 48 | 广西都市,http://219.159.194.195:8181/tsfile/live/1011_1.m3u8 49 | 康巴卫视,http://219.159.194.195:8181/tsfile/live/0134_1.m3u8 50 | 教育一套,http://219.159.194.195:8181/tsfile/live/1017_1.m3u8 51 | 旅游卫视,http://219.159.194.195:8181/tsfile/live/0114_1.m3u8 52 | 江苏卫视,http://219.159.194.195:8181/tsfile/live/0127_1.m3u8 53 | 江西卫视,http://219.159.194.195:8181/tsfile/live/0138_1.m3u8 54 | 河北卫视,http://219.159.194.195:8181/tsfile/live/0117_1.m3u8 55 | 浙江卫视,http://219.159.194.195:8181/tsfile/live/0124_1.m3u8 56 | 深圳卫视,http://219.159.194.195:8181/tsfile/live/0126_1.m3u8 57 | 湖北卫视,http://219.159.194.195:8181/tsfile/live/0132_1.m3u8 58 | 湖南卫视,http://219.159.194.195:8181/tsfile/live/0128_1.m3u8 59 | 珠江台,http://219.159.194.195:8181/tsfile/live/1000_1.m3u8 60 | 甘肃卫视,http://219.159.194.195:8181/tsfile/live/0141_1.m3u8 61 | 电影,http://219.159.194.195:8181/tsfile/live/1020_1.m3u8 62 | 经典电影,http://219.159.194.195:8181/tsfile/live/1008_1.m3u8 63 | 西藏卫视,http://219.159.194.195:8181/tsfile/live/0111_1.m3u8 64 | 贵州卫视,http://219.159.194.195:8181/tsfile/live/0120_1.m3u8 65 | 辽宁卫视,http://219.159.194.195:8181/tsfile/live/0121_1.m3u8 66 | 重庆卫视,http://219.159.194.195:8181/tsfile/live/0142_1.m3u8 67 | 金鹰纪实,http://219.159.194.195:8181/tsfile/live/1016_1.m3u8 68 | 陕西卫视,http://219.159.194.195:8181/tsfile/live/0136_1.m3u8 69 | 青海卫视,http://219.159.194.195:8181/tsfile/live/0140_1.m3u8 70 | 黑龙江卫视+,http://219.159.194.195:8181/tsfile/live/0143_2.m3u8 71 | -------------------------------------------------------------------------------- /pindao.py: -------------------------------------------------------------------------------- 1 | import random 2 | import concurrent.futures 3 | from selenium.webdriver.chrome.options import Options 4 | from selenium import webdriver 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support.ui import WebDriverWait 7 | from selenium.webdriver.support import expected_conditions as EC 8 | import time 9 | import os 10 | import re 11 | from bs4 import BeautifulSoup 12 | from queue import Queue 13 | import threading 14 | 15 | lock = threading.Lock() 16 | # 查找所有符合指定格式的网址 17 | infoList = [] 18 | urls_y = [] 19 | resultslist = [] 20 | urls = [ 21 | "http://foodieguide.com/iptvsearch/?page=1&s=%E6%97%A0%E7%BA%BF%E8%B4%A2%E7%BB%8F" 22 | ] 23 | # 初始化计数器为0 24 | counter = -1 25 | 26 | # 每次调用该函数时将计数器加1并返回结果 27 | def increment_counter(): 28 | global counter 29 | counter += 1 30 | return counter 31 | 32 | #判断一个数字是单数还是双数可 33 | def is_odd_or_even(number): 34 | if number % 2 == 0: 35 | return True 36 | else: 37 | return False 38 | 39 | for url in urls: 40 | try: 41 | # 创建一个Chrome WebDriver实例 42 | results = [] 43 | chrome_options = Options() 44 | chrome_options.add_argument('--headless') 45 | chrome_options.add_argument('--no-sandbox') 46 | chrome_options.add_argument('--disable-dev-shm-usage') 47 | chrome_options.add_experimental_option("useAutomationExtension", False) 48 | chrome_options.add_argument("blink-settings=imagesEnabled=false") 49 | driver = webdriver.Chrome(options=chrome_options) 50 | driver.set_page_load_timeout(60) # 10秒后超时 51 | # 设置脚本执行超时 52 | driver.set_script_timeout(50) # 5秒后超时 53 | # 使用WebDriver访问网页 54 | driver.get(url) # 将网址替换为你要访问的网页地址 55 | WebDriverWait(driver, 45).until( 56 | EC.presence_of_element_located( 57 | (By.CSS_SELECTOR, "div.tables") 58 | ) 59 | ) 60 | time.sleep(20) 61 | soup = BeautifulSoup(driver.page_source, "html.parser") 62 | 63 | # 关闭WebDriver 64 | driver.quit() 65 | tables_div = soup.find("div", class_="tables") 66 | results = ( 67 | tables_div.find_all("div", class_="result") 68 | if tables_div 69 | else [] 70 | ) 71 | if not any( 72 | result.find("div", class_="channel") for result in results 73 | ): 74 | #break 75 | print("Err-------------------------------------------------------------------------------------------------------") 76 | for result in results: 77 | print("============================================================================================================") 78 | print(result) 79 | html_txt = f"{result}" 80 | # print(html_txt) 81 | if "result" in html_txt: 82 | m3u8_div = result.find("a") 83 | if m3u8_div: 84 | pattern = r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+" # 设置匹配的格式,如http://8.8.8.8:8888 85 | urls_all = re.findall(pattern, m3u8_div.get('href')) 86 | # print(urls_all) 87 | if len(urls_all) > 0: 88 | ip = urls_all[0] 89 | italic_tags = soup.find_all('i') 90 | # 尝试获取第二个标签 91 | if len(italic_tags) > 1: 92 | second_italic_tag = italic_tags[1] # 索引从0开始,所以第二个标签的索引是1 93 | url_name = second_italic_tag.text 94 | name_html_txt = f"{url_name}" 95 | if "移动" in name_html_txt: 96 | ipname = '移动' 97 | elif "联通" in name_html_txt: 98 | ipname = '联通' 99 | elif "电信" in name_html_txt: 100 | ipname = '电信' 101 | else: 102 | ipname ='其他' 103 | resultslist.append(f"{ipname},{ip}") 104 | except: 105 | print(f"=========================>>> Thread {url} caught error") 106 | 107 | resultslist = set(resultslist) # 去重得到唯一的URL列表 108 | 109 | with open("pingdao.txt", 'w', encoding='utf-8') as file: 110 | for iplist in resultslist: 111 | file.write(iplist + "\n") 112 | print(iplist) 113 | file.close() 114 | sorted_list = sorted(resultslist) 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | 🕙 分享是一种美德,右上随手点个 🌟 Star,谢谢 3 | ``` 4 | 5 | **温馨提醒** 6 | 7 | 1. 本项目仅适用学习交流 8 | 2. 本项目不在任何平台出售,如有发现请积极举报
9 | 3. 为了更好的体验,友情提示此项目是一个全栈项目,认真刻苦的掌握它,熟练掌握后你就比较牛掰了
10 | 4. 不要只是白嫖 ,如果帮到你了麻烦**点个Star**
11 | 5. 发现有问题?添加下方微信客服一起探讨,或者直接提Issues 12 | 13 | ## 在线体验 14 | 15 | - PC地址(点击图片可访问):https://www.baidu.com/ 16 | 17 | 18 | 19 | 20 | 21 | ## 1.项目简介 22 | 23 | **xxx项目是一款智能软件,提供xxxxxxxx等多种功能,为用户提供便捷高效的体验。** 24 | 25 | ### 1.1功能概况 26 | 27 | 1、xxx项目使用xxxxx技术,能快速xxxxxx,可提高工作效率和创造力。
28 | 2、xxx项目能够结合
29 | 3、xxxxxxxxxxxx。 30 | 31 | ### 1.2xxx项目APP下载链接 32 | 33 | **新用户第一次登录即为注册。** 34 | 35 | 如图: 36 | 37 | 38 | 39 | ### 1.3xxx项目前台展示 40 | 41 | APP端前台 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
51 | 52 | #### 1.3.1 xxx项目前台介绍 53 | 54 | ``` 55 | xxx功能是一项非常吸引人和有趣的功能。它使用了xxxxxxx。趁着这个机会来尝试一下xxx项目吧! 56 | ``` 57 | 58 | **xxx项目操作示例图**: 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 | 69 | **xxx项目功能展馆:** 70 | 71 | ``` 72 | P1 功能描述:"~" 73 | ``` 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
87 | 88 | ``` 89 | P2 功能描述:"~" 90 | ``` 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
104 | 105 | 106 | 107 | 108 | 109 | ### 1.4xxx项目后台数据 110 | 111 | 112 | 113 | 114 | 115 |
116 | 117 | ### 1.5xxx项目后台展示 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 |
135 | 136 | ## 2.xxx项目完整运行步骤 137 | 138 | ### 2.1架构图 139 | 140 | 141 | 142 | 143 | 144 |
145 | 146 | 147 | 148 | ### 2.2xxx项目结构 149 | 150 | ``` 151 | 152 | ``` 153 | 154 | ### 2.3xxx项目后端代码运行步骤 155 | 156 | #### 2.3.1环境配置 157 | 158 | **运行环境**: 159 | 160 | **启动中间件:**[Nacos](https://nacos.io/)、[Mysql8.0](http://mysql.p2hp.com/)、[Redis](https://redis.io/)、[Minio](http://www.minio.org.cn/) 161 | 162 | 推荐使用phpStudy简化环境配置:[phpstudy](https://www.xp.cn/) 163 | 164 | #### 2.3.2后端代码运行 165 | 166 | 通过git拉取代码到本地后,项目结构如图: 167 | 168 | 169 | 170 | 171 | 172 |
173 | 174 | 操作步骤: 175 | 176 | 1、xxx 177 | 178 | 2、xxx 179 | 180 | 3、xxx 181 | 182 | 至此,后端代码运行成功! 183 | 184 | ### 2.4xxx项目前端代码运行步骤 185 | 186 | #### 2.4.1项目前端前台代码运行 187 | 188 | **前台运行环境:** 189 | 190 | **开发工具:**HBuilder X 191 | 192 | HBuilder X官方地址:[Windows - HBuilderX 文档 (dcloud.net.cn)](https://hx.dcloud.net.cn/Tutorial/install/windows) 193 | 194 | 195 | 196 | 操作步骤: 197 | 198 | 1、xxx 199 | 200 | 2、xxx 201 | 202 | 3、xxx 203 | 204 | 至此,前台代码运行成功! 205 | 206 | #### 2.4.2项目前端后台代码运行 207 | 208 | **后台运行环境:** 209 | 210 | **开发工具:** 211 | 212 | 操作步骤: 213 | 214 | 1、xxx 215 | 216 | 2、xxx 217 | 218 | 3、xxx 219 | 220 | 至此,后台代码运行成功! 221 | 222 | ## 添加客服微信 223 | 224 |
225 | 226 | 227 |
228 | -------------------------------------------------------------------------------- /xiangang.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | 20 | with open("itv.txt", 'r', encoding='utf-8') as file: 21 | lines = file.readlines() 22 | for line in lines: 23 | line = line.strip() 24 | count = line.count(',') 25 | if count == 1: 26 | if line: 27 | channel_name, channel_url = line.split(',') 28 | if '凤凰' in channel_name or 'CN_' in channel_name: 29 | channels.append((channel_name, channel_url)) 30 | file.close() 31 | # 定义工作线程函数 32 | def worker(): 33 | while True: 34 | # 从队列中获取一个任务 35 | channel_name, channel_url = task_queue.get() 36 | try: 37 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 38 | lines = requests.get(channel_url, timeout=3).text.strip().split('\n') # 获取m3u8文件内容 39 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 40 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 41 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 42 | 43 | # 多获取的视频数据进行5秒钟限制 44 | with eventlet.Timeout(4, False): 45 | start_time = time.time() 46 | content = requests.get(ts_url, timeout=4).content 47 | end_time = time.time() 48 | response_time = (end_time - start_time) * 1 49 | 50 | if content: 51 | with open(ts_lists_0, 'ab') as f: 52 | f.write(content) # 写入文件 53 | file_size = len(content) 54 | # print(f"文件大小:{file_size} 字节") 55 | download_speed = file_size / response_time / 1024 56 | # print(f"下载速度:{download_speed:.3f} kB/s") 57 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 58 | #print(f"标准化后的速率:{normalized_speed:.3f} MB/s") 59 | 60 | # 删除下载的文件 61 | os.remove(ts_lists_0) 62 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 63 | results.append(result) 64 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 65 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 66 | except: 67 | error_channel = channel_name, channel_url 68 | error_channels.append(error_channel) 69 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 70 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 71 | 72 | # 减少CPU占用 73 | time.sleep(0) 74 | # 标记任务完成 75 | task_queue.task_done() 76 | 77 | 78 | # 创建多个工作线程 79 | num_threads = 10 80 | for _ in range(num_threads): 81 | t = threading.Thread(target=worker, daemon=True) 82 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 83 | t.start() 84 | #event.set() 85 | 86 | # 添加下载任务到队列 87 | for channel in channels: 88 | task_queue.put(channel) 89 | 90 | # 等待所有任务完成 91 | task_queue.join() 92 | 93 | 94 | def channel_key(channel_name): 95 | match = re.search(r'\d+', channel_name) 96 | if match: 97 | return int(match.group()) 98 | else: 99 | return float('inf') # 返回一个无穷大的数字作为关键字 100 | 101 | # 对频道进行排序 102 | results.sort(key=lambda x: (x[0], -float(x[2].split()[0]))) 103 | #results.sort(key=lambda x: channel_key(x[0])) 104 | now_today = datetime.date.today() 105 | # 将结果写入文件 106 | 107 | result_counter = 8 # 每个频道需要的个数 108 | 109 | with open("xiangang.txt", 'w', encoding='utf-8') as file: 110 | channel_counters = {} 111 | file.write('【 港澳台频道 】,#genre#\n') 112 | for result in results: 113 | channel_name, channel_url, speed = result 114 | if '凤凰' in channel_name or 'CN_' in channel_name: 115 | if channel_name in channel_counters: 116 | if channel_counters[channel_name] >= result_counter: 117 | continue 118 | else: 119 | file.write(f"{channel_name},{channel_url}\n") 120 | channel_counters[channel_name] += 1 121 | else: 122 | file.write(f"{channel_name},{channel_url}\n") 123 | channel_counters[channel_name] = 1 124 | file.close() 125 | -------------------------------------------------------------------------------- /duliip_119_54_9.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://119.54.9.138:9999/hls/1/index.m3u8 2 | CCTV10,http://119.54.9.138:9999/hls/10/index.m3u8 3 | CCTV11,http://119.54.9.138:9999/hls/11/index.m3u8 4 | CCTV12,http://119.54.9.138:9999/hls/12/index.m3u8 5 | CCTV13,http://119.54.9.138:9999/hls/13/index.m3u8 6 | CCTV14,http://119.54.9.138:9999/hls/14/index.m3u8 7 | CCTV15,http://119.54.9.138:9999/hls/15/index.m3u8 8 | CCTV16,http://119.54.9.138:9999/hls/16/index.m3u8 9 | CCTV164k,http://119.54.9.138:9999/hls/29/index.m3u8 10 | CCTV17,http://119.54.9.138:9999/hls/17/index.m3u8 11 | CCTV2,http://119.54.9.138:9999/hls/2/index.m3u8 12 | CCTV3,http://119.54.9.138:9999/hls/3/index.m3u8 13 | CCTV4,http://119.54.9.138:9999/hls/4/index.m3u8 14 | CCTV5,http://119.54.9.138:9999/hls/5/index.m3u8 15 | CCTV6,http://119.54.9.138:9999/hls/6/index.m3u8 16 | CCTV7,http://119.54.9.138:9999/hls/7/index.m3u8 17 | CCTV8,http://119.54.9.138:9999/hls/8/index.m3u8 18 | CCTV9,http://119.54.9.138:9999/hls/9/index.m3u8 19 | CCTV台球,http://119.54.9.138:9999/hls/78/index.m3u8 20 | CCTV文化精品,http://119.54.9.138:9999/hls/81/index.m3u8 21 | CETV1,http://119.54.9.138:9999/hls/70/index.m3u8 22 | CETV2,http://119.54.9.138:9999/hls/71/index.m3u8 23 | CETV4,http://119.54.9.138:9999/hls/72/index.m3u8 24 | 三沙卫视,http://119.54.9.138:9999/hls/62/index.m3u8 25 | 世界地理,http://119.54.9.138:9999/hls/76/index.m3u8 26 | 东北戏曲,http://119.54.9.138:9999/hls/25/index.m3u8 27 | 东南卫视,http://119.54.9.138:9999/hls/44/index.m3u8 28 | 东方卫视,http://119.54.9.138:9999/hls/31/index.m3u8 29 | 中国交通,http://119.54.9.138:9999/hls/69/index.m3u8 30 | 乐游,http://119.54.9.138:9999/hls/93/index.m3u8 31 | 云南卫视,http://119.54.9.138:9999/hls/47/index.m3u8 32 | 佳佳卡通,http://119.54.9.138:9999/hls/65/index.m3u8 33 | 兵器科技,http://119.54.9.138:9999/hls/82/index.m3u8 34 | 兵团卫视,http://119.54.9.138:9999/hls/58/index.m3u8 35 | 内蒙古卫视,http://119.54.9.138:9999/hls/53/index.m3u8 36 | 动作电影,http://119.54.9.138:9999/hls/90/index.m3u8 37 | 动漫秀场,http://119.54.9.138:9999/hls/98/index.m3u8 38 | 北京卡酷,http://119.54.9.138:9999/hls/63/index.m3u8 39 | 北京卫视,http://119.54.9.138:9999/hls/30/index.m3u8 40 | 卫生健康,http://119.54.9.138:9999/hls/88/index.m3u8 41 | 吉林乡村,http://119.54.9.138:9999/hls/22/index.m3u8 42 | 吉林公共,http://119.54.9.138:9999/hls/23/index.m3u8 43 | 吉林卫视,http://119.54.9.138:9999/hls/18/index.m3u8 44 | 吉林影视,http://119.54.9.138:9999/hls/21/index.m3u8 45 | 吉林教育,http://119.54.9.138:9999/hls/27/index.m3u8 46 | 吉林生活,http://119.54.9.138:9999/hls/20/index.m3u8 47 | 吉林综艺,http://119.54.9.138:9999/hls/24/index.m3u8 48 | 吉林都视,http://119.54.9.138:9999/hls/19/index.m3u8 49 | 哈哈炫动,http://119.54.9.138:9999/hls/66/index.m3u8 50 | 四川卫视,http://119.54.9.138:9999/hls/57/index.m3u8 51 | 国学,http://119.54.9.138:9999/hls/85/index.m3u8 52 | 天津卫视,http://119.54.9.138:9999/hls/36/index.m3u8 53 | 女性时尚,http://119.54.9.138:9999/hls/73/index.m3u8 54 | 宁夏卫视,http://119.54.9.138:9999/hls/61/index.m3u8 55 | 安徽卫视,http://119.54.9.138:9999/hls/38/index.m3u8 56 | 家庭影院,http://119.54.9.138:9999/hls/92/index.m3u8 57 | 山东卫视,http://119.54.9.138:9999/hls/40/index.m3u8 58 | 山西卫视,http://119.54.9.138:9999/hls/52/index.m3u8 59 | 广东卫视,http://119.54.9.138:9999/hls/39/index.m3u8 60 | 广西卫视,http://119.54.9.138:9999/hls/55/index.m3u8 61 | 延边卫视,http://119.54.9.138:9999/hls/26/index.m3u8 62 | 快乐垂钓,http://119.54.9.138:9999/hls/100/index.m3u8 63 | 怀旧剧场,http://119.54.9.138:9999/hls/80/index.m3u8 64 | 新疆卫视,http://119.54.9.138:9999/hls/60/index.m3u8 65 | 江苏卫视,http://119.54.9.138:9999/hls/32/index.m3u8 66 | 江西卫视,http://119.54.9.138:9999/hls/54/index.m3u8 67 | 汽摩,http://119.54.9.138:9999/hls/84/index.m3u8 68 | 河北卫视,http://119.54.9.138:9999/hls/43/index.m3u8 69 | 河南卫视,http://119.54.9.138:9999/hls/51/index.m3u8 70 | 法治天地,http://119.54.9.138:9999/hls/94/index.m3u8 71 | 浙江卫视,http://119.54.9.138:9999/hls/33/index.m3u8 72 | 海南卫视,http://119.54.9.138:9999/hls/48/index.m3u8 73 | 深圳卫视,http://119.54.9.138:9999/hls/37/index.m3u8 74 | 游戏风云,http://119.54.9.138:9999/hls/99/index.m3u8 75 | 湖北卫视,http://119.54.9.138:9999/hls/45/index.m3u8 76 | 湖南卫视,http://119.54.9.138:9999/hls/34/index.m3u8 77 | 环球奇观,http://119.54.9.138:9999/hls/74/index.m3u8 78 | 甘肃卫视,http://119.54.9.138:9999/hls/59/index.m3u8 79 | 生活时尚,http://119.54.9.138:9999/hls/96/index.m3u8 80 | 电影,http://119.54.9.138:9999/hls/91/index.m3u8 81 | 电视指南,http://119.54.9.138:9999/hls/87/index.m3u8 82 | 第一剧场,http://119.54.9.138:9999/hls/75/index.m3u8 83 | 纪实人文,http://119.54.9.138:9999/hls/67/index.m3u8 84 | 茶,http://119.54.9.138:9999/hls/101/index.m3u8 85 | 西藏卫视,http://119.54.9.138:9999/hls/56/index.m3u8 86 | 贵州卫视,http://119.54.9.138:9999/hls/41/index.m3u8 87 | 辽宁卫视,http://119.54.9.138:9999/hls/35/index.m3u8 88 | 都市剧场,http://119.54.9.138:9999/hls/97/index.m3u8 89 | 重庆卫视,http://119.54.9.138:9999/hls/46/index.m3u8 90 | 金色学堂,http://119.54.9.138:9999/hls/95/index.m3u8 91 | 金鹰卡通,http://119.54.9.138:9999/hls/64/index.m3u8 92 | 金鹰纪实,http://119.54.9.138:9999/hls/68/index.m3u8 93 | 长影,http://119.54.9.138:9999/hls/28/index.m3u8 94 | 陕西卫视,http://119.54.9.138:9999/hls/49/index.m3u8 95 | 青海卫视,http://119.54.9.138:9999/hls/50/index.m3u8 96 | 靓装,http://119.54.9.138:9999/hls/83/index.m3u8 97 | 风云剧场,http://119.54.9.138:9999/hls/86/index.m3u8 98 | 风云足球,http://119.54.9.138:9999/hls/77/index.m3u8 99 | 风云音乐,http://119.54.9.138:9999/hls/79/index.m3u8 100 | 高尔夫,http://119.54.9.138:9999/hls/89/index.m3u8 101 | 黑龙江卫视,http://119.54.9.138:9999/hls/42/index.m3u8 102 | -------------------------------------------------------------------------------- /seektv.py: -------------------------------------------------------------------------------- 1 | import concurrent.futures 2 | import requests 3 | import time 4 | import threading 5 | 6 | # 自定义请求重试次数 7 | RETRIES = 3 8 | 9 | # 自定义请求超时时间(秒) 10 | TIMEOUT = 5 11 | 12 | # 自定义User-Agent标识 13 | USER_AGENT = 'okhttp/3.12.11 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' 14 | 15 | # 重试逻辑函数 16 | def retry_request(url, session, retries=RETRIES, backoff_factor=0.3, timeout=TIMEOUT): 17 | for _ in range(retries): 18 | try: 19 | response = session.get(url, timeout=timeout) 20 | response.raise_for_status() # 检查请求是否成功 21 | return response.text # 返回网页文本 22 | except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e: 23 | print(f"Request to {url} failed: {e}") 24 | if _ < retries - 1: # 如果不是最后一次重试,则等待一段时间后重试 25 | time.sleep(backoff_factor * (2 ** _)) # 指数退避策略 26 | else: 27 | print(f"Failed to retrieve URL {url} after {retries} retries") 28 | return None 29 | 30 | # 并发获取网页文本的函数 31 | def concurrent_get_text(urls, max_workers=10): 32 | with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor: 33 | # 创建requests会话并设置User-Agent 34 | session = requests.Session() 35 | session.headers['User-Agent'] = USER_AGENT 36 | 37 | futures = {executor.submit(retry_request, url, session) for url in urls} 38 | results = [] 39 | 40 | for future in concurrent.futures.as_completed(futures): 41 | try: 42 | page_text = future.result() 43 | if page_text: 44 | results.append(page_text) 45 | except Exception as e: 46 | print(f"An error occurred while processing a request: {e}") 47 | 48 | return results 49 | 50 | # 示例URL列表 51 | urls = [ 52 | "http://mywlkj.ddns.net:754/tv.php" 53 | ] 54 | # "https://raw.gitcode.com/lionzang/TV/raw/main/channel.txt" 55 | # "http://tvbox.nx66.bf:99/tvbox/zhibo.php", 56 | # "http://api.mcqq.cn/tvbox/zhibo.php", 57 | # "https://raw.githubusercontent.com/taijichadao/tv/main/itvlist.txt", 58 | # 并发获取网页文本 59 | texts = concurrent_get_text(urls, max_workers=10) 60 | all_lines = [] 61 | for text in texts: 62 | lines = text.splitlines() 63 | all_lines.extend(lines) 64 | 65 | # 去除重复项 66 | unique_urls = list(set(all_lines)) 67 | 68 | # 去除空格 69 | cleaned_urls = [url.strip() for url in all_lines] 70 | # 打印获取到的网页文本 71 | for cleaned_url in cleaned_urls: 72 | print(cleaned_url) 73 | # 定义执行GET请求的函数 74 | def get_with_retries(url, USER_AGENT, timeout=10, retries=3): 75 | headers = {'User-Agent': USER_AGENT} 76 | session = requests.Session() 77 | print(f'传入测试的参数 t\t{url}') 78 | line = url.strip() 79 | count = line.count(',') 80 | if count == 1: 81 | channel_name, channel_url = line.split(',') 82 | if "http" in channel_url and "[" not in channel_url: 83 | if line: 84 | print(f'进行测试是否有重定向 t\t{channel_name},{channel_url}') 85 | for _ in range(retries): 86 | try: 87 | response = session.get(channel_url, allow_redirects=True, headers=headers, timeout=timeout) 88 | if response.status_code == 302: 89 | next_url = response.url 90 | new_url = f"{channel_name},{next_url}" 91 | return new_url # 返回重定向后的URL 92 | else: 93 | response.raise_for_status() # 如果HTTP请求返回了不成功的状态码,将引发HTTPError异常 94 | except (requests.exceptions.RequestException, requests.exceptions.HTTPError) as e: 95 | print(f"Error occurred for URL {channel_url}: {e}") 96 | if retries > 1: # 如果还有重试次数,则等待后重试 97 | time.sleep(1) # 等待1秒后再重试 98 | else: 99 | print(f"No more retries for URL {channel_url}") 100 | return "None,None" # 没有更多重试,返回None 101 | session.close() # 关闭session 102 | return "None,None" 103 | else: 104 | return "None,None" 105 | else: 106 | # session.close() # 关闭session 107 | return "None,None" 108 | else: 109 | # session.close() # 关闭session 110 | return "None,None" 111 | 112 | # 主函数,用于并发执行GET请求 113 | def concurrent_get_with_retries(urls, user_agent, max_workers, timeout=10, retries=2): 114 | threads = [] 115 | results = [] 116 | 117 | # 创建线程池 118 | for url in urls: 119 | thread = threading.Thread(target=get_with_retries, args=(url, user_agent, timeout, retries)) 120 | thread.start() 121 | threads.append(thread) 122 | 123 | # 当线程数量达到最大工作线程数时,等待一个线程完成 124 | if len(threads) >= max_workers: 125 | for thread in threads: 126 | thread.join() 127 | threads = [] 128 | 129 | # 等待所有剩余的线程完成 130 | for thread in threads: 131 | thread.join() 132 | 133 | return results 134 | 135 | # 设置URL列表和User-Agent 136 | max_workers = 5 # 设置线程数量 137 | 138 | # 调用并发函数并打印结果 139 | results = concurrent_get_with_retries(cleaned_urls, USER_AGENT, max_workers) 140 | print("======================================================================================================") 141 | for url, redirected_url in zip(cleaned_urls, results): 142 | print(f"Original URL: {url}, Redirected URL: {redirected_url} if any") 143 | -------------------------------------------------------------------------------- /duliip_sx.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://1.70.32.95:8085/udp/239.1.1.7:8007 2 | CCTV10,http://1.70.32.95:8085/udp/239.1.1.17:8017 3 | CCTV11,http://1.70.32.95:8085/udp/239.1.1.18:8018 4 | CCTV12,http://1.70.32.95:8085/udp/239.1.1.19:8019 5 | CCTV13,http://1.70.32.95:8085/udp/239.1.1.20:8020 6 | CCTV14,http://1.70.32.95:8085/udp/239.1.1.21:8021 7 | CCTV15,http://1.70.32.95:8085/udp/239.1.1.22:8022 8 | CCTV16,http://1.70.32.95:8085/udp/239.1.1.122:8122 9 | CCTV17,http://1.70.32.95:8085/udp/239.1.1.23:8023 10 | CCTV2,http://1.70.32.95:8085/udp/239.1.1.8:8008 11 | CCTV3,http://1.70.32.95:8085/udp/239.1.1.9:8009 12 | CCTV4,http://1.70.32.95:8085/udp/239.1.1.10:8010 13 | CCTV5+,http://1.70.32.95:8085/udp/239.1.1.12:8012 14 | CCTV5,http://1.70.32.95:8085/udp/239.1.1.11:8011 15 | CCTV6,http://1.70.32.95:8085/udp/239.1.1.13:8013 16 | CCTV7,http://1.70.32.95:8085/udp/239.1.1.14:8014 17 | CCTV8,http://1.70.32.95:8085/udp/239.1.1.15:8015 18 | CCTV9,http://1.70.32.95:8085/udp/239.1.1.16:8016 19 | CCTV世界地理,http://1.70.32.95:8085/udp/239.1.1.99:8099 20 | CCTV兵器科技,http://1.70.32.95:8085/udp/239.1.1.97:8097 21 | CCTV台球,http://1.70.32.95:8085/udp/239.1.1.100:8100 22 | CCTV女性时尚,http://1.70.32.95:8085/udp/239.1.1.89:8089 23 | CCTV怀旧剧场高请,http://1.70.32.95:8085/udp/239.1.1.95:8095 24 | CCTV文化精品,http://1.70.32.95:8085/udp/239.1.1.91:8091 25 | CCTV电视指南,http://1.70.32.95:8085/udp/239.1.1.90:8090 26 | CCTV第一剧场,http://1.70.32.95:8085/udp/239.1.1.94:8094 27 | CCTV风云剧场,http://1.70.32.95:8085/udp/239.1.1.93:8093 28 | CCTV风云足球,http://1.70.32.95:8085/udp/239.1.1.101:8101 29 | CCTV风云音乐高请,http://1.70.32.95:8085/udp/239.1.1.96:8096 30 | CCTV高尔夫网球,http://1.70.32.95:8085/udp/239.1.1.102:8102 31 | 三沙卫视,http://1.70.32.95:8085/udp/239.1.1.70:8070 32 | 上海卫视,http://1.70.32.95:8085/udp/239.1.1.31:8031 33 | 东南卫视,http://1.70.32.95:8085/udp/239.1.1.33:8033 34 | 东方财经,http://1.70.32.95:8085/udp/239.1.1.85:8085 35 | 中华特产,http://1.70.32.95:8085/udp/239.1.1.106:8106 36 | 中国天气,http://1.70.32.95:8085/udp/239.1.1.107:8107 37 | 中国教育电视台1,http://1.70.32.95:8085/udp/239.1.1.65:8065 38 | 中国教育电视台2,http://1.70.32.95:8085/udp/239.1.1.66:8066 39 | 中国教育电视台4,http://1.70.32.95:8085/udp/239.1.1.67:8067 40 | 中学生,http://1.70.32.95:8085/udp/239.1.1.104:8104 41 | 乐游,http://1.70.32.95:8085/udp/239.1.1.84:8084 42 | 书画,http://1.70.32.95:8085/udp/239.1.1.88:8088 43 | 云南卫视,http://1.70.32.95:8085/udp/239.1.1.54:8054 44 | 优优宝贝,http://1.70.32.95:8085/udp/239.1.1.114:8114 45 | 优漫卡通,http://1.70.32.95:8085/udp/239.1.1.72:8072 46 | 优购物,http://1.70.32.95:8085/udp/239.1.1.115:8115 47 | 兵团卫视,http://1.70.32.95:8085/udp/239.1.1.58:8058 48 | 内蒙古卫视,http://1.70.32.95:8085/udp/239.1.1.60:8060 49 | 农林卫视,http://1.70.32.95:8085/udp/239.1.1.73:8073 50 | 动漫秀场,http://1.70.32.95:8085/udp/239.1.1.80:8080 51 | 北京卫视,http://1.70.32.95:8085/udp/239.1.1.41:8041 52 | 卡酷少儿,http://1.70.32.95:8085/udp/239.1.1.62:8062 53 | 厦门卫视,http://1.70.32.95:8085/udp/239.1.1.71:8071 54 | 发现之旅,http://1.70.32.95:8085/udp/239.1.1.103:8103 55 | 吉林卫视,http://1.70.32.95:8085/udp/239.1.1.30:8030 56 | 哈哈炫动,http://1.70.32.95:8085/udp/239.1.1.64:8064 57 | 嘉佳卡通,http://1.70.32.95:8085/udp/239.1.1.68:8068 58 | 四川卫视,http://1.70.32.95:8085/udp/239.1.1.29:8029 59 | 四海钓鱼,http://1.70.32.95:8085/udp/239.1.1.111:8111 60 | 大湾区卫视,http://1.70.32.95:8085/udp/239.1.1.69:8069 61 | 天津卫视,http://1.70.32.95:8085/udp/239.1.1.46:8046 62 | 宁夏卫视,http://1.70.32.95:8085/udp/239.1.1.56:8056 63 | 安徽卫视,http://1.70.32.95:8085/udp/239.1.1.44:8044 64 | 家庭理财,http://1.70.32.95:8085/udp/239.1.1.112:8112 65 | 山东卫视,http://1.70.32.95:8085/udp/239.1.1.47:8047 66 | 山东教育卫视,http://1.70.32.95:8085/udp/239.1.1.74:8074 67 | 山西卫视,http://1.70.32.95:8085/udp/239.1.1.1:8001 68 | 山西影视,http://1.70.32.95:8085/udp/239.1.1.4:8004 69 | 山西文体生活,http://1.70.32.95:8085/udp/239.1.1.6:8006 70 | 山西社会与法治,http://1.70.32.95:8085/udp/239.1.1.5:8005 71 | 山西经济与科技,http://1.70.32.95:8085/udp/239.1.1.3:8003 72 | 广东卫视,http://1.70.32.95:8085/udp/239.1.1.49:8049 73 | 广西卫视,http://1.70.32.95:8085/udp/239.1.1.40:8040 74 | 快乐垂钓,http://1.70.32.95:8085/udp/239.1.1.86:8086 75 | 新疆卫视,http://1.70.32.95:8085/udp/239.1.1.59:8059 76 | 晋中公共,http://1.70.32.95:8085/udp/239.1.1.121:8121 77 | 晋中综合,http://1.70.32.95:8085/udp/239.1.1.120:8120 78 | 江苏卫视,http://1.70.32.95:8085/udp/239.1.1.35:8035 79 | 江西卫视,http://1.70.32.95:8085/udp/239.1.1.52:8052 80 | 汽摩,http://1.70.32.95:8085/udp/239.1.1.92:8092 81 | 河北卫视,http://1.70.32.95:8085/udp/239.1.1.48:8048 82 | 河南卫视,http://1.70.32.95:8085/udp/239.1.1.34:8034 83 | 法治天地,http://1.70.32.95:8085/udp/239.1.1.79:8079 84 | 浙江卫视,http://1.70.32.95:8085/udp/239.1.1.38:8038 85 | 海南卫视,http://1.70.32.95:8085/udp/239.1.1.55:8055 86 | 深圳卫视,http://1.70.32.95:8085/udp/239.1.1.39:8039 87 | 游戏风云,http://1.70.32.95:8085/udp/239.1.1.83:8083 88 | 湖北卫视,http://1.70.32.95:8085/udp/239.1.1.32:8032 89 | 湖南卫视,http://1.70.32.95:8085/udp/239.1.1.28:8028 90 | 环球奇观,http://1.70.32.95:8085/udp/239.1.1.98:8098 91 | 环球旅游,http://1.70.32.95:8085/udp/239.1.1.116:8116 92 | 甘肃卫视,http://1.70.32.95:8085/udp/239.1.1.51:8051 93 | 生态环境,http://1.70.32.95:8085/udp/239.1.1.110:8110 94 | 生活时尚,http://1.70.32.95:8085/udp/239.1.1.76:8076 95 | 百姓健康,http://1.70.32.95:8085/udp/239.1.1.105:8105 96 | 盐湖,http://1.70.32.95:8085/udp/239.1.1.125:8125 97 | 纪实人文,http://1.70.32.95:8085/udp/239.1.1.45:8045 98 | 老故事,http://1.70.32.95:8085/udp/239.1.1.87:8087 99 | 茶,http://1.70.32.95:8085/udp/239.1.1.77:8077 100 | 西藏卫视,http://1.70.32.95:8085/udp/239.1.1.57:8057 101 | 证券服务,http://1.70.32.95:8085/udp/239.1.1.108:8108 102 | 财富天下,http://1.70.32.95:8085/udp/239.1.1.113:8113 103 | 贵州卫视,http://1.70.32.95:8085/udp/239.1.1.43:8043 104 | 车迷,http://1.70.32.95:8085/udp/239.1.1.109:8109 105 | 辽宁卫视,http://1.70.32.95:8085/udp/239.1.1.42:8042 106 | 运城1台,http://1.70.32.95:8085/udp/239.1.1.123:8123 107 | 运城2台,http://1.70.32.95:8085/udp/239.1.1.124:8124 108 | 都市剧场,http://1.70.32.95:8085/udp/239.1.1.81:8081 109 | 重庆卫视,http://1.70.32.95:8085/udp/239.1.1.36:8036 110 | 金色学堂,http://1.70.32.95:8085/udp/239.1.1.82:8082 111 | 金鹰卡通,http://1.70.32.95:8085/udp/239.1.1.61:8061 112 | 金鹰纪实,http://1.70.32.95:8085/udp/239.1.1.63:8063 113 | 陕西卫视,http://1.70.32.95:8085/udp/239.1.1.50:8050 114 | 青海卫视,http://1.70.32.95:8085/udp/239.1.1.53:8053 115 | 魅力足球,http://1.70.32.95:8085/udp/239.1.1.75:8075 116 | 黄河电视台,http://1.70.32.95:8085/udp/239.1.1.2:8002 117 | 黑龙江卫视,http://1.70.32.95:8085/udp/239.1.1.37:8037 118 | -------------------------------------------------------------------------------- /mywlkj_gt.txt: -------------------------------------------------------------------------------- 1 | 翡翠台HD,http://jiaojirentv.top/2020/xqtv666.php?id=1 2 | 无线新闻台,http://jiaojirentv.top/2020/xqtv666.php?id=2 3 | 无线新闻台HD,http://jiaojirentv.top/2020/xqtv666.php?id=3 4 | J2,http://jiaojirentv.top/2020/xqtv666.php?id=4 5 | J2,http://jiaojirentv.top/2020/xqtv666.php?id=5 6 | TVB明珠台,http://jiaojirentv.top/2020/xqtv666.php?id=6 7 | TVB财经体育资讯台,http://jiaojirentv.top/2020/xqtv666.php?id=7 8 | MYTV SUPER1,http://jiaojirentv.top/2020/xqtv666.php?id=8 9 | 翡翠台,http://jiaojirentv.top/2020/xqtv666.php?id=9 10 | MYTV SUPER2,http://jiaojirentv.top/2020/xqtv666.php?id=10 11 | MYTV SUPER3,http://jiaojirentv.top/2020/xqtv666.php?id=11 12 | 功夫台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 13 | MYTV SUPER4,http://jiaojirentv.top/2020/xqtv666.php?id=14 14 | MYTV SUPER5,http://jiaojirentv.top/2020/xqtv666.php?id=15 15 | MYTV SUPER6,http://jiaojirentv.top/2020/xqtv666.php?id=16 16 | 18台,http://jiaojirentv.top/2020/xqtv666.php?id=17 17 | MYTV SUPER7,http://jiaojirentv.top/2020/xqtv666.php?id=18 18 | MYTV SUPER8,http://jiaojirentv.top/2020/xqtv666.php?id=19 19 | TVB欢乐新闻台,http://jiaojirentv.top/2020/xqtv666.php?id=20 20 | TVB星河,http://jiaojirentv.top/2020/xqtv666.php?id=21 21 | MYTV SUPER9,http://jiaojirentv.top/2020/xqtv666.php?id=22 22 | VIUTV,http://jiaojirentv.top/2020/xqtv666.php?id=23 23 | 黄金华剧台,http://jiaojirentv.top/2020/xqtv666.php?id=24 24 | 美亚电影台,http://jiaojirentv.top/2020/xqtv666.php?id=25 25 | 美亚电影台,http://jiaojirentv.top/2020/xqtv666.php?id=26 26 | NOW新闻台,http://jiaojirentv.top/2020/xqtv666.php?id=27 27 | NOW财经台,http://jiaojirentv.top/2020/xqtv666.php?id=28 28 | NOW星影台,http://jiaojirentv.top/2020/xqtv666.php?id=29 29 | NOW爆谷台,http://jiaojirentv.top/2020/xqtv666.php?id=30 30 | NOW SPORTS1,http://jiaojirentv.top/2020/xqtv666.php?id=31 31 | ROCK EN,http://jiaojirentv.top/2020/xqtv666.php?id=32 32 | ROCK ACTION,http://jiaojirentv.top/2020/xqtv666.php?id=33 33 | KIX,http://jiaojirentv.top/2020/xqtv666.php?id=34 34 | AXN,http://jiaojirentv.top/2020/xqtv666.php?id=35 35 | fashion box hd,http://jiaojirentv.top/2020/xqtv666.php?id=36 36 | thrill,http://jiaojirentv.top/2020/xqtv666.php?id=37 37 | TVB翡翠台HD,http://jiaojirentv.top/2020/xqtv666.php?id=38 38 | ANIMAX,http://jiaojirentv.top/2020/xqtv666.php?id=39 39 | LOVE NATURE,http://jiaojirentv.top/2020/xqtv666.php?id=40 40 | TVN,http://jiaojirentv.top/2020/xqtv666.php?id=41 41 | LOVE NATURE,http://jiaojirentv.top/2020/xqtv666.php?id=42 42 | 民视HD,http://jiaojirentv.top/2020/xqtv666.php?id=43 43 | 台视HD,http://jiaojirentv.top/2020/xqtv666.php?id=44 44 | 中视HD,http://jiaojirentv.top/2020/xqtv666.php?id=45 45 | 华视HD,http://jiaojirentv.top/2020/xqtv666.php?id=46 46 | 公视,http://jiaojirentv.top/2020/xqtv666.php?id=47 47 | 台视综合HD,http://jiaojirentv.top/2020/xqtv666.php?id=48 48 | 民视台湾台HD,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 49 | 三立综合台,http://jiaojirentv.top/2020/xqtv666.php?id=51 50 | 三立台湾台,http://jiaojirentv.top/2020/xqtv666.php?id=52 51 | 三立都会台,http://jiaojirentv.top/2020/xqtv666.php?id=54 52 | GTV八大综合台HD,http://jiaojirentv.top/2020/xqtv666.php?id=55 53 | ELTA综合HD,http://jiaojirentv.top/2020/xqtv666.php?id=58 54 | 中天亚洲台,http://jiaojirentv.top/2020/xqtv666.php?id=60 55 | 中天综合HD,http://jiaojirentv.top/2020/xqtv666.php?id=61 56 | 中天娱乐HD,http://jiaojirentv.top/2020/xqtv666.php?id=62 57 | EYETV旅游,http://jiaojirentv.top/2020/xqtv666.php?id=63 58 | EYETV剧场,http://jiaojirentv.top/2020/xqtv666.php?id=64 59 | CN卡通频道,http://jiaojirentv.top/2020/xqtv666.php?id=65 60 | EBC东森超视HD,http://jiaojirentv.top/2020/xqtv666.php?id=68 61 | 美食星球,http://jiaojirentv.top/2020/xqtv666.php?id=69 62 | 亚洲旅游台,http://jiaojirentv.top/2020/xqtv666.php?id=71 63 | ELTA体育4台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 64 | WORLD,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 65 | EBC东森新闻HD,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 66 | 寰宇新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=76 67 | TVBS新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=77 68 | TVBS新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=78 69 | 三立新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=79 70 | 中视新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=80 71 | 台视新闻HD,http://jiaojirentv.top/2020/xqtv666.php?id=81 72 | 中天新闻2,http://jiaojirentv.top/2020/xqtv666.php?id=82 73 | 中天新闻2,http://jiaojirentv.top/2020/xqtv666.php?id=83 74 | 民视新闻台HD,http://jiaojirentv.top/2020/xqtv666.php?id=84 75 | LS龙祥时代,http://jiaojirentv.top/2020/xqtv666.php?id=85 76 | EBC东森电影HD,http://jiaojirentv.top/2020/xqtv666.php?id=86 77 | EBC东森洋片HD,http://jiaojirentv.top/2020/xqtv666.php?id=87 78 | 好莱坞HD,http://jiaojirentv.top/2020/xqtv666.php?id=88 79 | 纬来电影HD,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 80 | LTV龙华戏剧,http://jiaojirentv.top/2020/xqtv666.php?id=90 81 | LTV龙华偶像,http://jiaojirentv.top/2020/xqtv666.php?id=91 82 | LTV龙华洋片,http://jiaojirentv.top/2020/xqtv666.php?id=92 83 | LTV龙华电影,http://jiaojirentv.top/2020/xqtv666.php?id=93 84 | 美亚电影台,http://jiaojirentv.top/2020/xqtv666.php?id=94 85 | HBO HITS,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 86 | HBO FAMILY,http://jiaojirentv.top/2020/xqtv666.php?id=97 87 | CINEMAX,http://jiaojirentv.top/2020/xqtv666.php?id=98 88 | AXN,http://jiaojirentv.top/2020/xqtv666.php?id=99 89 | WB TV,http://jiaojirentv.top/2020/xqtv666.php?id=100 90 | STAR MOVIES HD,http://jiaojirentv.top/2020/xqtv666.php?id=102 91 | CCM,http://jiaojirentv.top/2020/xqtv666.php?id=103 92 | 天映频道,http://jiaojirentv.top/2020/xqtv666.php?id=104 93 | ABC NEWS LIVE,http://jiaojirentv.top/2020/xqtv666.php?id=105 94 | CNN,http://jiaojirentv.top/2020/xqtv666.php?id=106 95 | 动物星球,http://jiaojirentv.top/2020/xqtv666.php?id=108 96 | OUTDOOR,http://jiaojirentv.top/2020/xqtv666.php?id=109 97 | WILD HD,http://jiaojirentv.top/2020/xqtv666.php?id=110 98 | BBC EARTH,http://jiaojirentv.top/2020/xqtv666.php?id=111 99 | BBC LIFE,http://jiaojirentv.top/2020/xqtv666.php?id=112 100 | BHO,http://jiaojirentv.top/2020/xqtv666.php?id=114 101 | astro欢喜台,http://jiaojirentv.top/2020/xqtv666.php?id=115 102 | TVB magic,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 103 | TVB千禧经典台,http://jiaojirentv.top/2020/xqtv666.php?id=117 104 | IQIYI,http://jiaojirentv.top/2020/xqtv666.php?id=118 105 | W,http://jiaojirentv.top/2020/xqtv666.php?id=119 106 | ELTA体育3台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 107 | 凤凰中文台HD,http://jiaojirentv.top/2020/xqtv666.php?id=121 108 | 凤凰资讯台HD,http://jiaojirentv.top/2020/xqtv666.php?id=122 109 | 凤凰香港台HD,http://jiaojirentv.top/2020/xqtv666.php?id=123 110 | TVB星河,http://jiaojirentv.top/2020/xqtv666.php?id=124 111 | NOW,http://jiaojirentv.top/2020/xqtv666.php?id=126 112 | -------------------------------------------------------------------------------- /duliip_113_64_145.txt: -------------------------------------------------------------------------------- 1 | CCTV1,http://113.64.145.220:8081/hls/138/index.m3u8 2 | CCTV10,http://113.64.145.220:8081/hls/10/index.m3u8 3 | CCTV10,http://113.64.145.220:8081/hls/133/index.m3u8 4 | CCTV11,http://113.64.145.220:8081/hls/11/index.m3u8 5 | CCTV12,http://113.64.145.220:8081/hls/12/index.m3u8 6 | CCTV12,http://113.64.145.220:8081/hls/134/index.m3u8 7 | CCTV13,http://113.64.145.220:8081/hls/13/index.m3u8 8 | CCTV14,http://113.64.145.220:8081/hls/14/index.m3u8 9 | CCTV15,http://113.64.145.220:8081/hls/15/index.m3u8 10 | CCTV17,http://113.64.145.220:8081/hls/17/index.m3u8 11 | CCTV2,http://113.64.145.220:8081/hls/130/index.m3u8 12 | CCTV2,http://113.64.145.220:8081/hls/2/index.m3u8 13 | CCTV3,http://113.64.145.220:8081/hls/3/index.m3u8 14 | CCTV4,http://113.64.145.220:8081/hls/131/index.m3u8 15 | CCTV4,http://113.64.145.220:8081/hls/4/index.m3u8 16 | CCTV5+,http://113.64.145.220:8081/hls/16/index.m3u8 17 | CCTV5,http://113.64.145.220:8081/hls/5/index.m3u8 18 | CCTV6,http://113.64.145.220:8081/hls/6/index.m3u8 19 | CCTV7,http://113.64.145.220:8081/hls/7/index.m3u8 20 | CCTV8,http://113.64.145.220:8081/hls/8/index.m3u8 21 | CCTV9,http://113.64.145.220:8081/hls/9/index.m3u8 22 | CCTV精品,http://113.64.145.220:8081/hls/116/index.m3u8 23 | DOX电影,http://113.64.145.220:8081/hls/62/index.m3u8 24 | MV音乐,http://113.64.145.220:8081/hls/88/index.m3u8 25 | 上海纪实,http://113.64.145.220:8081/hls/56/index.m3u8 26 | 世界地理,http://113.64.145.220:8081/hls/124/index.m3u8 27 | 东南卫视,http://113.64.145.220:8081/hls/55/index.m3u8 28 | 东南卫视,http://113.64.145.220:8081/hls/74/index.m3u8 29 | 东南卫视,http://113.64.145.220:8081/hls/83/index.m3u8 30 | 东方卫视,http://113.64.145.220:8081/hls/47/index.m3u8 31 | 东方卫视,http://113.64.145.220:8081/hls/86/index.m3u8 32 | 中国教育1,http://113.64.145.220:8081/hls/64/index.m3u8 33 | 中国气象,http://113.64.145.220:8081/hls/33/index.m3u8 34 | 书画,http://113.64.145.220:8081/hls/107/index.m3u8 35 | 云南卫视,http://113.64.145.220:8081/hls/92/index.m3u8 36 | 优漫卡通,http://113.64.145.220:8081/hls/128/index.m3u8 37 | 先锋乒羽,http://113.64.145.220:8081/hls/113/index.m3u8 38 | 兵团卫视,http://113.64.145.220:8081/hls/102/index.m3u8 39 | 内蒙古卫视,http://113.64.145.220:8081/hls/99/index.m3u8 40 | 凤凰卫视,http://113.64.145.220:8081/hls/37/index.m3u8 41 | 凤凰资讯,http://113.64.145.220:8081/hls/36/index.m3u8 42 | 凤凰香港,http://113.64.145.220:8081/hls/38/index.m3u8 43 | 动作电影,http://113.64.145.220:8081/hls/34/index.m3u8 44 | 北京卫视,http://113.64.145.220:8081/hls/45/index.m3u8 45 | 北京卫视,http://113.64.145.220:8081/hls/78/index.m3u8 46 | 南山有线,http://113.64.145.220:8081/hls/18/index.m3u8 47 | 南方卫视,http://113.64.145.220:8081/hls/80/index.m3u8 48 | 南方经济,http://113.64.145.220:8081/hls/66/index.m3u8 49 | 南方购物,http://113.64.145.220:8081/hls/123/index.m3u8 50 | 南方都市,http://113.64.145.220:8081/hls/30/index.m3u8 51 | 吉林卫视,http://113.64.145.220:8081/hls/59/index.m3u8 52 | 嘉佳卡通,http://113.64.145.220:8081/hls/126/index.m3u8 53 | 四川卫视,http://113.64.145.220:8081/hls/52/index.m3u8 54 | 四川卫视,http://113.64.145.220:8081/hls/71/index.m3u8 55 | 天津卫视,http://113.64.145.220:8081/hls/48/index.m3u8 56 | 天津卫视,http://113.64.145.220:8081/hls/79/index.m3u8 57 | 安徽卫视,http://113.64.145.220:8081/hls/49/index.m3u8 58 | 家庭影院,http://113.64.145.220:8081/hls/35/index.m3u8 59 | 家庭理财,http://113.64.145.220:8081/hls/112/index.m3u8 60 | 家庭购物,http://113.64.145.220:8081/hls/114/index.m3u8 61 | 山东卫视,http://113.64.145.220:8081/hls/75/index.m3u8 62 | 山东教育,http://113.64.145.220:8081/hls/72/index.m3u8 63 | 山西卫视,http://113.64.145.220:8081/hls/98/index.m3u8 64 | 岭南戏曲,http://113.64.145.220:8081/hls/108/index.m3u8 65 | 广东体育,http://113.64.145.220:8081/hls/1/index.m3u8 66 | 广东公共,http://113.64.145.220:8081/hls/27/index.m3u8 67 | 广东卫视,http://113.64.145.220:8081/hls/40/index.m3u8 68 | 广东卫视,http://113.64.145.220:8081/hls/91/index.m3u8 69 | 广东少儿,http://113.64.145.220:8081/hls/32/index.m3u8 70 | 广东影视,http://113.64.145.220:8081/hls/31/index.m3u8 71 | 广东新闻,http://113.64.145.220:8081/hls/28/index.m3u8 72 | 广西卫视,http://113.64.145.220:8081/hls/60/index.m3u8 73 | 广西卫视,http://113.64.145.220:8081/hls/90/index.m3u8 74 | 怀旧剧场,http://113.64.145.220:8081/hls/118/index.m3u8 75 | 揭西,http://113.64.145.220:8081/hls/39/index.m3u8 76 | 揭西台,http://113.64.145.220:8081/hls/19/index.m3u8 77 | 揭阳公共,http://113.64.145.220:8081/hls/22/index.m3u8 78 | 揭阳综合,http://113.64.145.220:8081/hls/21/index.m3u8 79 | 新动漫,http://113.64.145.220:8081/hls/115/index.m3u8 80 | 新疆卫视,http://113.64.145.220:8081/hls/104/index.m3u8 81 | 新疆卫视,http://113.64.145.220:8081/hls/82/index.m3u8 82 | 旅游卫视,http://113.64.145.220:8081/hls/100/index.m3u8 83 | 明珠台,http://113.64.145.220:8081/hls/26/index.m3u8 84 | 星空卫视,http://113.64.145.220:8081/hls/87/index.m3u8 85 | 本港台,http://113.64.145.220:8081/hls/135/index.m3u8 86 | 武术世界,http://113.64.145.220:8081/hls/122/index.m3u8 87 | 汕头台,http://113.64.145.220:8081/hls/24/index.m3u8 88 | 江苏卫视,http://113.64.145.220:8081/hls/44/index.m3u8 89 | 江苏卫视,http://113.64.145.220:8081/hls/93/index.m3u8 90 | 江西卫视,http://113.64.145.220:8081/hls/58/index.m3u8 91 | 河北卫视,http://113.64.145.220:8081/hls/57/index.m3u8 92 | 河南卫视,http://113.64.145.220:8081/hls/77/index.m3u8 93 | 河南卫视,http://113.64.145.220:8081/hls/96/index.m3u8 94 | 浙江卫视,http://113.64.145.220:8081/hls/43/index.m3u8 95 | 深圳卫视,http://113.64.145.220:8081/hls/46/index.m3u8 96 | 深圳卫视,http://113.64.145.220:8081/hls/81/index.m3u8 97 | 深圳电视剧,http://113.64.145.220:8081/hls/69/index.m3u8 98 | 深都市,http://113.64.145.220:8081/hls/68/index.m3u8 99 | 湖北卫视,http://113.64.145.220:8081/hls/51/index.m3u8 100 | 湖北卫视,http://113.64.145.220:8081/hls/94/index.m3u8 101 | 湖南卫视,http://113.64.145.220:8081/hls/42/index.m3u8 102 | 湖南卫视,http://113.64.145.220:8081/hls/84/index.m3u8 103 | 潮州综合,http://113.64.145.220:8081/hls/23/index.m3u8 104 | 炫动卡通,http://113.64.145.220:8081/hls/127/index.m3u8 105 | 热播剧场,http://113.64.145.220:8081/hls/63/index.m3u8 106 | 环球奇观,http://113.64.145.220:8081/hls/110/index.m3u8 107 | 现代教育,http://113.64.145.220:8081/hls/109/index.m3u8 108 | 珠江卫视,http://113.64.145.220:8081/hls/41/index.m3u8 109 | 甘肃卫视,http://113.64.145.220:8081/hls/101/index.m3u8 110 | 第一剧场,http://113.64.145.220:8081/hls/121/index.m3u8 111 | 经典电影,http://113.64.145.220:8081/hls/61/index.m3u8 112 | 经济科教,http://113.64.145.220:8081/hls/29/index.m3u8 113 | 网络棋牌,http://113.64.145.220:8081/hls/106/index.m3u8 114 | 翡翠台,http://113.64.145.220:8081/hls/25/index.m3u8 115 | 翡翠台,http://113.64.145.220:8081/hls/67/index.m3u8 116 | 老故事,http://113.64.145.220:8081/hls/125/index.m3u8 117 | 西藏卫视,http://113.64.145.220:8081/hls/103/index.m3u8 118 | 贵州卫视,http://113.64.145.220:8081/hls/53/index.m3u8 119 | 贵州卫视,http://113.64.145.220:8081/hls/85/index.m3u8 120 | 辽宁卫视,http://113.64.145.220:8081/hls/54/index.m3u8 121 | 重庆卫视,http://113.64.145.220:8081/hls/76/index.m3u8 122 | 金鹰卡通,http://113.64.145.220:8081/hls/129/index.m3u8 123 | 陕西卫视,http://113.64.145.220:8081/hls/97/index.m3u8 124 | 青海卫视,http://113.64.145.220:8081/hls/95/index.m3u8 125 | 风云剧场,http://113.64.145.220:8081/hls/120/index.m3u8 126 | 风云足球,http://113.64.145.220:8081/hls/119/index.m3u8 127 | 风云音乐,http://113.64.145.220:8081/hls/117/index.m3u8 128 | 魅力足球,http://113.64.145.220:8081/hls/65/index.m3u8 129 | 黑龙江卫视,http://113.64.145.220:8081/hls/50/index.m3u8 130 | -------------------------------------------------------------------------------- /mywlkj.txt: -------------------------------------------------------------------------------- 1 | HBO_HD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Hbo 2 | HBO_HITS,http://61.158.166.42:1301/haiou.php?key=haiou&id=hbohead_twn 3 | HBOSignatureHD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Hbosignature 4 | HBO温馨家庭,http://61.158.166.42:1301/haiou.php?key=haiou&id=fyi_twn 5 | 华纳电影台,http://61.158.166.42:1301/haiou.php?key=haiou&id=WarnerTV 6 | 惊辣Thrill,http://61.158.166.42:1301/haiou.php?key=haiou&id=Thrill 7 | 8度空间HD,http://61.158.166.42:1301/haiou.php?key=haiou&id=AEC 8 | 欢喜台HD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Huahee 9 | 全佳台HD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Quanjia 10 | 爱奇艺HD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Qiyi 11 | 凤凰香港台,http://61.158.166.42:1301/haiou.php?key=haiou&id=hkphoenix_twn 12 | 凤凰中文台,http://61.158.166.42:1301/haiou.php?key=haiou&id=phoenixtv_hd 13 | 凤凰资讯台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 14 | TVB翡翠台,http://61.158.166.42:1301/haiou.php?key=haiou&id=jade_twn 15 | TVBJ2台,http://61.158.166.42:1301/haiou.php?key=haiou&id=j2_twn 16 | TVB明珠台,http://61.158.166.42:1301/haiou.php?key=haiou&id=pearl_twn 17 | TVB华丽翡翠台,http://61.158.166.42:1301/haiou.php?key=haiou&id=Wlt 18 | TVB星河台(粤),http://61.158.166.42:1301/haiou.php?key=haiou&id=Xinhe 19 | TVB星河台(国),http://61.158.166.42:1301/haiou.php?key=haiou&id=Xinhe_mega 20 | TVB星河台(粤),http://61.158.166.42:1301/haiou.php?key=haiou&id=tvbxinhe_twn 21 | 港台RHK31,http://61.158.166.42:1301/weismt.php?id=rhk31_twn 22 | 港台RHK32,http://61.158.166.42:1301/weismt.php?id=rhk32_twn 23 | VIU TV,http://61.158.166.42:1301/haiou.php?key=haiou&id=viu1_twn 24 | VIU TV6,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 25 | TVB无线新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=inews_twn 26 | TVB财经体育资讯2台,http://61.158.166.42:1301/haiou.php?key=haiou&id=tvbcaijing_twn 27 | 美亚电影台,http://61.158.166.42:1301/haiou.php?key=haiou&id=meiyamovie_twn 28 | 天映经典,http://61.158.166.42:1301/haiou.php?key=haiou&id=Celestial2_mega 29 | 天映频道,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 30 | CINEMAX,http://61.158.166.42:1301/haiou.php?key=haiou&id=cinemax_twn 31 | AXN,http://61.158.166.42:1301/haiou.php?key=haiou&id=axn_twn 32 | tvNMovie,http://61.158.166.42:1301/haiou.php?key=haiou&id=Tvnmovie 33 | 民视,http://104.233.187.235:2082/mqitv?user=tianya666&id=live1050 34 | 台视,http://61.158.166.42:1301/haiou.php?key=haiou&id=ttv_taiwan 35 | 中视,http://61.158.166.42:1301/haiou.php?key=haiou&id=zhongshihd_twn 36 | 华视,http://61.158.166.42:1301/haiou.php?key=haiou&id=ctshd_twn 37 | 公视,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 38 | TVBS,http://61.158.166.42:1301/haiou.php?key=haiou&id=tvbs 39 | 台视综合台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ttvzhonghe 40 | 民视台湾台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 41 | 三立综合台,http://61.158.166.42:1301/haiou.php?key=haiou&id=sanlizhonghe 42 | 三立台湾台,http://104.233.187.235:2082/mqitv?user=tianya666&id=live1021 43 | 三立戏剧台,http://61.158.166.42:1301/haiou.php?key=haiou&id=sanlixiju_twn 44 | 三立都会台,http://61.158.166.42:1301/haiou.php?key=haiou&id=sanlidouhui_twn 45 | 八大综合台,http://61.158.166.42:1301/haiou.php?key=haiou&id=badazhonghe 46 | 八大第一台,http://61.158.166.42:1301/haiou.php?key=haiou&id=badafirst 47 | 八大戏剧台,http://61.158.166.42:1301/haiou.php?key=haiou&id=badadrama 48 | 爱尔达综合,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 49 | 爱尔达影剧,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 50 | 中天亚洲台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 51 | 中天综合台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ctizhonghe 52 | 中天娱乐台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ctient 53 | TVBS欢乐台,http://61.158.166.42:1301/haiou.php?key=haiou&id=tvbshuanle_twn 54 | 龙详时代台,http://61.158.166.42:1301/haiou.php?key=haiou&id=lungxiangtime_twn 55 | 东森电影台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ettvmovie 56 | 东森洋片台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ettvwestern 57 | 东森综合台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 58 | 东森戏剧台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 59 | 东森超视台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ettvsuper 60 | 好莱坞电影台,http://61.158.166.42:1301/haiou.php?key=haiou&id=hollywoodmovies_twn 61 | 緯來電影台,http://61.158.166.42:1301/haiou.php?key=haiou&id=videolandmovie 62 | 卫视洋片台,http://61.158.166.42:1301/haiou.php?key=haiou&id=starmovies_raj 63 | 龙华戏剧台,http://61.158.166.42:1301/haiou.php?key=haiou&id=lunghuaxiju_twn 64 | 龙华偶像台,http://61.158.166.42:1301/haiou.php?key=haiou&id=lunghuaidol_twn 65 | 龙华洋片台,http://61.158.166.42:1301/haiou.php?key=haiou&id=lunghuawestern_twn 66 | 龙华电影台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 67 | TVBS新闻台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 68 | 中天新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ctinews 69 | 台视新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ttvnews_twn 70 | 中视新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=zhongshinews_twn 71 | 民视新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ftvnew_taiwan 72 | 东森新闻台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 73 | 东森财经台,http://61.158.166.42:1301/haiou.php?key=haiou&id=ettvcaijing_twn 74 | 寰宇新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=huanyuxinwen_twn 75 | 非凡新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=feifannews_twn 76 | 年代新闻台,http://61.158.166.42:1301/haiou.php?key=haiou&id=niandainews_twn 77 | WWEHD,http://61.158.166.42:1301/haiou.php?key=haiou&id=Wwe 78 | 爱尔达体育2台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 79 | 博斯运动1,http://61.158.166.42:1301/haiou.php?key=haiou&id=bosisport1_twn 80 | 博斯运动2,http://61.158.166.42:1301/haiou.php?key=haiou&id=bosisport2_twn 81 | 博斯高球台,http://61.158.166.42:1301/haiou.php?key=haiou&id=bosigolf2_twn 82 | 博斯网球台,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 83 | Supersports1,http://61.158.166.42:1301/haiou.php?key=haiou&id=Assp1 84 | Supersports4,http://61.158.166.42:1301/haiou.php?key=haiou&id=Assp4 85 | SonyTen1,https://gitee.com/guoqi8899/ipvideo/raw/master/gg.mp4 86 | SonyTen2,http://61.158.166.42:1301/haiou.php?key=haiou&id=ten2_raj 87 | SonyTen3,http://61.158.166.42:1301/haiou.php?key=haiou&id=ten3_raj 88 | 纬来体育台,http://61.158.166.42:1301/haiou.php?key=haiou&id=videolandsport 89 | 纬来日本台,http://61.158.166.42:1301/haiou.php?key=haiou&id=videolandjapan 90 | EYETV旅游,http://61.158.166.42:1301/haiou.php?key=haiou&id=eyetvtravel_twn 91 | EYETV戏剧,http://61.158.166.42:1301/haiou.php?key=haiou&id=eyetvxiju_twn 92 | Momo综合,http://61.158.166.42:1301/haiou.php?key=haiou&id=momo1_twn 93 | 靖天国际台,http://61.158.166.42:1301/haiou.php?key=haiou&id=jingtianintl_twn 94 | 靖天卡通台,http://61.158.166.42:1301/haiou.php?key=haiou&id=jingtiancartoon_twn 95 | 大爱电视台,http://61.158.166.42:1301/haiou.php?key=haiou&id=daai_twn 96 | 美食星球台,http://61.158.166.42:1301/haiou.php?key=haiou&id=foodplanet_twn 97 | 亚洲旅游台,http://61.158.166.42:1301/haiou.php?key=haiou&id=asiatravel_twn 98 | TLC旅游台,http://61.158.166.42:1301/haiou.php?key=haiou&id=tlc_twn 99 | 国家地理野生,http://61.158.166.42:1301/haiou.php?key=haiou&id=natgeowild_twn 100 | 国家地理台湾,http://61.158.166.42:1301/haiou.php?key=haiou&id=natgeohd_twn 101 | DiscoveryAsia,http://61.158.166.42:1301/haiou.php?key=haiou&id=discoverytwn_twn 102 | DiscoveryHD,http://61.158.166.42:1301/haiou.php?key=haiou&id=discoveryhd_twn 103 | -------------------------------------------------------------------------------- /ip_check.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | lock = threading.Lock() 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | headers={'User-Agent': 'okhttp/3.12.10(Linux;Android9;V2049ABuild/TP1A.220624.014;wv)AppleWebKit/537.36(KHTML,likeGecko)Version/4.0Chrome/116.0.0.0MobileSafari/537.36'} 20 | se=requests.Session() 21 | 22 | with open("cfg_ip.txt", 'r', encoding='utf-8') as file: 23 | lines = file.readlines() 24 | for line in lines: 25 | line = line.strip() 26 | count = line.count(',') 27 | if count == 1: 28 | if line: 29 | channel_name, channel_url = line.split(',') 30 | if 'http' in channel_url: 31 | channels.append((channel_name, channel_url)) 32 | 33 | file.close() 34 | channels = set(channels) 35 | # 定义工作线程函数 36 | def worker(): 37 | while True: 38 | # 从队列中获取一个任务 39 | channel_name, channel_url = task_queue.get() 40 | if ".m3u8" in channel_url or ".flv" in channel_url or ".mp4" in channel_url: 41 | try: 42 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 43 | lines = requests.get(channel_url,headers=headers, timeout=3, stream=True).text.strip().split('\n') # 获取m3u8文件内容 44 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 45 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 46 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 47 | 48 | # 多获取的视频数据进行5秒钟限制 49 | with eventlet.Timeout(5, False): 50 | start_time = time.time() 51 | content = requests.get(ts_url,headers=headers, timeout=(1,4), stream=True).content 52 | end_time = time.time() 53 | response_time = (end_time - start_time) * 1 54 | if content: 55 | with open(ts_lists_0, 'ab') as f: 56 | f.write(content) # 写入文件 57 | file_size = len(content) 58 | # print(f"文件大小:{file_size} 字节") 59 | download_speed = file_size / response_time / 1024 60 | # print(f"下载速度:{download_speed:.3f} kB/s") 61 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 62 | #print(f'{channel_url}') 63 | print(f"m3u8 标准化后的速率:{normalized_speed:.3f} MB/s {channel_url}") 64 | 65 | # 删除下载的文件 66 | os.remove(ts_lists_0) 67 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 68 | # 获取锁 69 | lock.acquire() 70 | if normalized_speed > 0.001: 71 | results.append(result) 72 | else: 73 | error_channel = channel_name, channel_url 74 | error_channels.append(error_channel) 75 | # 释放锁 76 | lock.release() 77 | 78 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 79 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 80 | except: 81 | error_channel = channel_name, channel_url 82 | # 获取锁 83 | lock.acquire() 84 | error_channels.append(error_channel) 85 | # 释放锁 86 | lock.release() 87 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 88 | else: 89 | try: 90 | now=time.time() 91 | res=se.get(channel_url,headers=headers,timeout=5,stream=True) 92 | if res.status_code==200: 93 | for k in res.iter_content(chunk_size=2097152): 94 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 95 | # 如果能获取视频流,则输出读取的时间以及链接 96 | if time.time()-now > 60: 97 | res.close() 98 | print(f'Time out\t{channel_url}') 99 | error_channel = channel_name, channel_url 100 | # 获取锁 101 | lock.acquire() 102 | error_channels.append(error_channel) 103 | # 释放锁 104 | lock.release() 105 | break 106 | else: 107 | if k: # 检查是否有内容 108 | print(f'{time.time()-now:.2f}\t{channel_url}') 109 | response_time = (time.time()-now) * 1 110 | download_speed = 2097152 / response_time / 1024 111 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) 112 | if response_time > 1: 113 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 114 | # 获取锁 115 | lock.acquire() 116 | results.append(result) 117 | # 释放锁 118 | lock.release() 119 | else: 120 | print(f'X\t{channel_url}') 121 | 122 | break 123 | except: 124 | error_channel = channel_name, channel_url 125 | # 获取锁 126 | lock.acquire() 127 | error_channels.append(error_channel) 128 | # 释放锁 129 | lock.release() 130 | # 无法连接并超时的情况下输出“X” 131 | print(f'X\t{channel_url}') 132 | 133 | # 减少CPU占用 134 | time.sleep(0) 135 | # 标记任务完成 136 | task_queue.task_done() 137 | 138 | # 创建多个工作线程 139 | num_threads = 40 140 | for _ in range(num_threads): 141 | t = threading.Thread(target=worker, daemon=True) 142 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 143 | t.start() 144 | #event.set() 145 | 146 | # 添加下载任务到队列 147 | for channel in channels: 148 | task_queue.put(channel) 149 | 150 | # 等待所有任务完成 151 | task_queue.join() 152 | 153 | now_today = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 154 | 155 | # 将结果写入文件 156 | with open("cfg_ip.txt", 'w', encoding='utf-8') as file: 157 | file.write('失效连接,#genre#\n') 158 | for result in error_channels: 159 | channel_name, channel_url = result 160 | file.write(f"{channel_name},{channel_url}\n") 161 | 162 | file.write('有效连接,#genre#\n') 163 | for result in results: 164 | channel_name, channel_url, speed = result 165 | file.write(f"{channel_name},{channel_url}\n") 166 | file.write(f"测试完成时间,{now_today}\n") 167 | file.close() 168 | -------------------------------------------------------------------------------- /weishi.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | lock = threading.Lock() 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | headers={'User-Agent': 'okhttp/3.15 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} 20 | se=requests.Session() 21 | 22 | with open("itv.txt", 'r', encoding='utf-8') as file: 23 | lines = file.readlines() 24 | for line in lines: 25 | line = line.strip() 26 | count = line.count(',') 27 | if count == 1: 28 | if line: 29 | channel_name, channel_url = line.split(',') 30 | if '卫视' in channel_name: 31 | channels.append((channel_name, channel_url)) 32 | file.close() 33 | 34 | # 定义工作线程函数 35 | def worker(): 36 | while True: 37 | # 从队列中获取一个任务 38 | channel_name, channel_url = task_queue.get() 39 | if ".m3u8" in channel_url or ".flv" in channel_url or ".mp4" in channel_url: 40 | try: 41 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 42 | lines = requests.get(channel_url,headers=headers, timeout=3, stream=True).text.strip().split('\n') # 获取m3u8文件内容 43 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 44 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 45 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 46 | 47 | # 多获取的视频数据进行5秒钟限制 48 | with eventlet.Timeout(5, False): 49 | start_time = time.time() 50 | content = requests.get(ts_url,headers=headers, timeout=(2,5), stream=True).content 51 | end_time = time.time() 52 | response_time = (end_time - start_time) * 1 53 | 54 | if content: 55 | with open(ts_lists_0, 'ab') as f: 56 | f.write(content) # 写入文件 57 | file_size = len(content) 58 | # print(f"文件大小:{file_size} 字节") 59 | download_speed = file_size / response_time / 1024 60 | # print(f"下载速度:{download_speed:.3f} kB/s") 61 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 62 | #print(f'{channel_url}') 63 | #print(f"m3u8 标准化后的速率:{normalized_speed:.3f} MB/s") 64 | 65 | # 删除下载的文件 66 | os.remove(ts_lists_0) 67 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 68 | # 获取锁 69 | lock.acquire() 70 | results.append(result) 71 | # 释放锁 72 | lock.release() 73 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 74 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 75 | except: 76 | error_channel = channel_name, channel_url 77 | # error_channels.append(error_channel) 78 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 79 | else: 80 | try: 81 | now=time.time() 82 | res=se.get(channel_url,headers=headers,timeout=5,stream=True) 83 | if res.status_code==200: 84 | for k in res.iter_content(chunk_size=2097152): 85 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 86 | # 如果能获取视频流,则输出读取的时间以及链接 87 | if time.time()-now > 15: 88 | res.close() 89 | print(f'Time out\t{channel_url}') 90 | break 91 | else: 92 | if k: 93 | print(f'{time.time()-now:.2f}\t{channel_url}') 94 | response_time = (time.time()-now) * 1 95 | download_speed = 2097152 / response_time / 1024 96 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) 97 | if response_time > 1: 98 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 99 | # 获取锁 100 | lock.acquire() 101 | results.append(result) 102 | # 释放锁 103 | lock.release() 104 | else: 105 | print(f'X\t{channel_url}') 106 | break 107 | except: 108 | # 无法连接并超时的情况下输出“X” 109 | print(f'X\t{channel_url}') 110 | 111 | # 减少CPU占用 112 | time.sleep(0) 113 | # 标记任务完成 114 | task_queue.task_done() 115 | 116 | # 创建多个工作线程 117 | num_threads = 40 118 | for _ in range(num_threads): 119 | t = threading.Thread(target=worker, daemon=True) 120 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 121 | t.start() 122 | #event.set() 123 | 124 | # 添加下载任务到队列 125 | for channel in channels: 126 | task_queue.put(channel) 127 | 128 | # 等待所有任务完成 129 | task_queue.join() 130 | 131 | # 打开移动源文件 132 | with open("chinamobile.txt", 'r', encoding='utf-8') as file: 133 | lines = file.readlines() 134 | for line in lines: 135 | line = line.strip() 136 | count = line.count(',') 137 | if count == 1: 138 | if line: 139 | channel_name, channel_url = line.split(',') 140 | if '卫视' in channel_name: 141 | result = channel_name, channel_url, "0.001 MB/s" 142 | results.append(result) 143 | 144 | def channel_key(channel_name): 145 | match = re.search(r'\d+', channel_name) 146 | if match: 147 | return int(match.group()) 148 | else: 149 | return float('inf') # 返回一个无穷大的数字作为关键字 150 | 151 | # 对频道进行排序 152 | results.sort(key=lambda x: (x[0], -float(x[2].split()[0]))) 153 | #results.sort(key=lambda x: channel_key(x[0])) 154 | now_today = datetime.date.today() 155 | # 将结果写入文件 156 | 157 | result_counter = 15 # 每个频道需要的个数 158 | 159 | with open("weishi.txt", 'w', encoding='utf-8') as file: 160 | channel_counters = {} 161 | file.write('【 卫视频道 】,#genre#\n') 162 | for result in results: 163 | channel_name, channel_url, speed = result 164 | if '卫视' in channel_name and '高清' not in channel_name: 165 | if channel_name in channel_counters: 166 | if channel_counters[channel_name] >= result_counter: 167 | continue 168 | else: 169 | file.write(f"{channel_name},{channel_url}\n") 170 | channel_counters[channel_name] += 1 171 | else: 172 | file.write(f"{channel_name},{channel_url}\n") 173 | channel_counters[channel_name] = 1 174 | 175 | channel_counters = {} 176 | file.write('【 卫视高清频道 】,#genre#\n') 177 | for result in results: 178 | channel_name, channel_url, speed = result 179 | if '卫视' in channel_name and '高清' in channel_name: 180 | if channel_name in channel_counters: 181 | if channel_counters[channel_name] >= result_counter: 182 | continue 183 | else: 184 | file.write(f"{channel_name},{channel_url}\n") 185 | channel_counters[channel_name] += 1 186 | else: 187 | file.write(f"{channel_name},{channel_url}\n") 188 | channel_counters[channel_name] = 1 189 | file.close() 190 | -------------------------------------------------------------------------------- /bywork/weishi.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | lock = threading.Lock() 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | headers={'User-Agent': 'okhttp/3.15 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} 20 | se=requests.Session() 21 | 22 | with open("itv.txt", 'r', encoding='utf-8') as file: 23 | lines = file.readlines() 24 | for line in lines: 25 | line = line.strip() 26 | count = line.count(',') 27 | if count == 1: 28 | if line: 29 | channel_name, channel_url = line.split(',') 30 | if '卫视' in channel_name: 31 | channels.append((channel_name, channel_url)) 32 | file.close() 33 | 34 | # 定义工作线程函数 35 | def worker(): 36 | while True: 37 | # 从队列中获取一个任务 38 | channel_name, channel_url = task_queue.get() 39 | if ".m3u8" in channel_url or ".flv" in channel_url or ".mp4" in channel_url: 40 | try: 41 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 42 | lines = requests.get(channel_url,headers=headers, timeout=3, stream=True).text.strip().split('\n') # 获取m3u8文件内容 43 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 44 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 45 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 46 | 47 | # 多获取的视频数据进行5秒钟限制 48 | with eventlet.Timeout(5, False): 49 | start_time = time.time() 50 | content = requests.get(ts_url,headers=headers, timeout=(2,5), stream=True).content 51 | end_time = time.time() 52 | response_time = (end_time - start_time) * 1 53 | 54 | if content: 55 | with open(ts_lists_0, 'ab') as f: 56 | f.write(content) # 写入文件 57 | file_size = len(content) 58 | # print(f"文件大小:{file_size} 字节") 59 | download_speed = file_size / response_time / 1024 60 | # print(f"下载速度:{download_speed:.3f} kB/s") 61 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 62 | #print(f'{channel_url}') 63 | #print(f"m3u8 标准化后的速率:{normalized_speed:.3f} MB/s") 64 | 65 | # 删除下载的文件 66 | os.remove(ts_lists_0) 67 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 68 | # 获取锁 69 | lock.acquire() 70 | results.append(result) 71 | # 释放锁 72 | lock.release() 73 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 74 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 75 | except: 76 | error_channel = channel_name, channel_url 77 | # error_channels.append(error_channel) 78 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 79 | else: 80 | try: 81 | now=time.time() 82 | res=se.get(channel_url,headers=headers,timeout=5,stream=True) 83 | if res.status_code==200: 84 | for k in res.iter_content(chunk_size=2097152): 85 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 86 | # 如果能获取视频流,则输出读取的时间以及链接 87 | if time.time()-now > 15: 88 | res.close() 89 | print(f'Time out\t{channel_url}') 90 | break 91 | else: 92 | if k: 93 | print(f'{time.time()-now:.2f}\t{channel_url}') 94 | response_time = (time.time()-now) * 1 95 | download_speed = 2097152 / response_time / 1024 96 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) 97 | if response_time > 1: 98 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 99 | # 获取锁 100 | lock.acquire() 101 | results.append(result) 102 | # 释放锁 103 | lock.release() 104 | else: 105 | print(f'X\t{channel_url}') 106 | break 107 | except: 108 | # 无法连接并超时的情况下输出“X” 109 | print(f'X\t{channel_url}') 110 | 111 | # 减少CPU占用 112 | time.sleep(0) 113 | # 标记任务完成 114 | task_queue.task_done() 115 | 116 | # 创建多个工作线程 117 | num_threads = 40 118 | for _ in range(num_threads): 119 | t = threading.Thread(target=worker, daemon=True) 120 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 121 | t.start() 122 | #event.set() 123 | 124 | # 添加下载任务到队列 125 | for channel in channels: 126 | task_queue.put(channel) 127 | 128 | # 等待所有任务完成 129 | task_queue.join() 130 | 131 | # 打开移动源文件 132 | with open("chinamobile.txt", 'r', encoding='utf-8') as file: 133 | lines = file.readlines() 134 | for line in lines: 135 | line = line.strip() 136 | count = line.count(',') 137 | if count == 1: 138 | if line: 139 | channel_name, channel_url = line.split(',') 140 | if '卫视' in channel_name: 141 | result = channel_name, channel_url, "0.001 MB/s" 142 | results.append(result) 143 | 144 | def channel_key(channel_name): 145 | match = re.search(r'\d+', channel_name) 146 | if match: 147 | return int(match.group()) 148 | else: 149 | return float('inf') # 返回一个无穷大的数字作为关键字 150 | 151 | # 对频道进行排序 152 | results.sort(key=lambda x: (x[0], -float(x[2].split()[0]))) 153 | #results.sort(key=lambda x: channel_key(x[0])) 154 | now_today = datetime.date.today() 155 | # 将结果写入文件 156 | 157 | result_counter = 15 # 每个频道需要的个数 158 | 159 | with open("weishi.txt", 'w', encoding='utf-8') as file: 160 | channel_counters = {} 161 | file.write('【 卫视频道 】,#genre#\n') 162 | for result in results: 163 | channel_name, channel_url, speed = result 164 | if '卫视' in channel_name and '高清' not in channel_name: 165 | if channel_name in channel_counters: 166 | if channel_counters[channel_name] >= result_counter: 167 | continue 168 | else: 169 | file.write(f"{channel_name},{channel_url}\n") 170 | channel_counters[channel_name] += 1 171 | else: 172 | file.write(f"{channel_name},{channel_url}\n") 173 | channel_counters[channel_name] = 1 174 | 175 | channel_counters = {} 176 | file.write('【 卫视高清频道 】,#genre#\n') 177 | for result in results: 178 | channel_name, channel_url, speed = result 179 | if '卫视' in channel_name and '高清' in channel_name: 180 | if channel_name in channel_counters: 181 | if channel_counters[channel_name] >= result_counter: 182 | continue 183 | else: 184 | file.write(f"{channel_name},{channel_url}\n") 185 | channel_counters[channel_name] += 1 186 | else: 187 | file.write(f"{channel_name},{channel_url}\n") 188 | channel_counters[channel_name] = 1 189 | file.close() 190 | -------------------------------------------------------------------------------- /iptv.py: -------------------------------------------------------------------------------- 1 | import random 2 | import concurrent.futures 3 | from selenium.webdriver.chrome.options import Options 4 | from selenium import webdriver 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support.ui import WebDriverWait 7 | from selenium.webdriver.support import expected_conditions as EC 8 | import time 9 | import os 10 | import re 11 | from bs4 import BeautifulSoup 12 | from queue import Queue 13 | import threading 14 | 15 | # 判断首位是否为数字,是返回真 16 | def is_first_digit(s): 17 | return s[0].isdigit() if s else False 18 | 19 | lock = threading.Lock() 20 | # 查找所有符合指定格式的网址 21 | infoList = [] 22 | urls_y = [] 23 | resultslist = [] 24 | urls = [ 25 | "https://raw.githubusercontent.com/taijichadao/tv/main/itvlist.txt", 26 | "http://api.mcqq.cn/tvbox/zhibo.php", 27 | "http://tvbox.nx66.bf:99/tvbox/zhibo.php", 28 | "http://mywlkj.ddns.net:754/tv.php", 29 | "https://raw.gitcode.com/lionzang/TV/raw/main/channel.txt" 30 | ] 31 | # 初始化计数器为0 32 | counter = -1 33 | 34 | # 每次调用该函数时将计数器加1并返回结果 35 | def increment_counter(): 36 | global counter 37 | counter += 1 38 | return counter 39 | 40 | #判断一个数字是单数还是双数可 41 | def is_odd_or_even(number): 42 | if number % 2 == 0: 43 | return True 44 | else: 45 | return False 46 | file_contents = [] 47 | for url in urls: 48 | # 创建一个Chrome WebDriver实例 49 | chrome_options = Options() 50 | chrome_options.add_argument('--headless') 51 | chrome_options.add_argument('--no-sandbox') 52 | chrome_options.add_argument('--disable-dev-shm-usage') 53 | chrome_options.add_experimental_option("useAutomationExtension", False) 54 | chrome_options.add_argument("blink-settings=imagesEnabled=false") 55 | driver = webdriver.Chrome(options=chrome_options) 56 | driver.set_page_load_timeout(60) # 10秒后超时 57 | # 设置脚本执行超时 58 | driver.set_script_timeout(50) # 5秒后超时 59 | # 使用WebDriver访问网页 60 | driver.get(url) # 将网址替换为你要访问的网页地址 61 | time.sleep(5) 62 | # 获取网页内容 63 | page_content = driver.page_source 64 | 65 | # 关闭WebDriver 66 | driver.quit() 67 | # print(page_content) #方便看看是否有执行啊 68 | file_contents.append(page_content) 69 | 70 | with open("iptv_all.txt", "w", encoding="utf-8") as output: 71 | output.write('\n'.join(file_contents)) 72 | output.close() 73 | print("---------------------------------------------------------") 74 | results = [] 75 | with open("iptv_all.txt", "r", encoding="utf-8") as file: 76 | lines = file.readlines() 77 | for line in lines: 78 | line = line.strip() 79 | count = line.count(',') 80 | if count == 1: 81 | if line: 82 | channel_name, channel_url = line.split(',') 83 | name =(f"{channel_name}") 84 | name = name.replace("「新疆」", "") 85 | name = name.replace("「代理」", "") 86 | name = name.replace("「IPV6」", "") 87 | name = name.replace("「移动」", "") 88 | name = name.replace("「官方」", "") 89 | name = name.replace("「电信」", "") 90 | name = name.replace("「联通」", "") 91 | name = name.replace("「河北有线」", "") 92 | name = name.replace("「北方广电」", "") 93 | name = name.replace("「辽宁联通」", "") 94 | name = name.replace("1920*1080", "") 95 | name = name.replace("_", "") 96 | name = name.replace("[", "") 97 | name = name.replace("]", "") 98 | name = name.replace("HD", "") 99 | name = name.replace("(高清)", "") 100 | name = name.replace("超清", "") 101 | name = name.replace("厦门卫视高清", "厦门卫视") 102 | name = name.replace("吉林卫视高清", "吉林卫视") 103 | name = name.replace("四川卫视高清", "四川卫视") 104 | name = name.replace("天津卫视高清", "天津卫视") 105 | name = name.replace("天津高清", "天津卫视") 106 | name = name.replace("安徽卫视高清", "安徽卫视") 107 | name = name.replace("广东卫视高清", "广东卫视") 108 | name = name.replace("广东高清", "广东卫视") 109 | name = name.replace("江苏卫视高清", "江苏卫视") 110 | name = name.replace("河北卫视高清", "河北卫视") 111 | name = name.replace("浙江卫视高清", "浙江卫视") 112 | name = name.replace("深圳高清", "深圳卫视") 113 | name = name.replace("深圳卫视高清", "深圳卫视") 114 | name = name.replace("湖北卫视高清", "湖北卫视") 115 | name = name.replace("湖北高清", "湖北卫视") 116 | name = name.replace("湖南卫视高清", "湖南卫视") 117 | name = name.replace("湖南高清", "湖南卫视") 118 | name = name.replace("福建东南卫视高清", "福建东南卫视") 119 | name = name.replace("辽宁卫视高清", "辽宁卫视") 120 | name = name.replace("黑龙江卫视高清", "黑龙江卫视") 121 | name = name.replace("山东教育", "山东教育卫视") 122 | name = name.replace("山东高清", "山东卫视") 123 | name = name.replace("广东体育高清", "广东体育卫视") 124 | name = name.replace("广东珠江高清", "广东珠江卫视") 125 | name = name.replace("广东高清", "广东卫视") 126 | name = name.replace("浙江高清", "浙江卫视") 127 | name = name.replace("深圳高清", "深圳卫视") 128 | name = name.replace("湖北高清", "湖北卫视") 129 | name = name.replace("湖南高清", "湖南卫视") 130 | name = name.replace("江苏高清", "江苏卫视") 131 | name = name.replace("北京卫视高清", "北京卫视") 132 | name = name.replace("北京高清", "北京卫视") 133 | name = name.replace("福建东南卫视", "东南卫视") 134 | name = name.replace("汕头综合高清", "汕头综合") 135 | name = name.replace("汕头文旅体育高清", "汕头文旅体育") 136 | name = name.replace("汕头文旅体育高清", "汕头文旅体育") 137 | name = name.replace("高清", "") 138 | name = name.replace("凤凰中文", "凤凰卫视中文") 139 | name = name.replace("凤凰资讯", "凤凰卫视资讯") 140 | name = name.replace("凤凰香港", "凤凰香港卫视") 141 | name = name.replace("本港", "本港卫视") 142 | name = name.replace("香港明珠", "香港明珠卫视") 143 | name = name.replace("香港翡翠", "香港翡翠卫视") 144 | name = name.replace("香港音乐", "香港音乐卫视") 145 | name = name.replace("高请", "") 146 | name = name.replace("超", "") 147 | name = name.replace("CCTVCCTV", "CCTV") 148 | name = name.replace("汕头二台", "汕头经济生活") 149 | name = name.replace("汕头二", "汕头经济生活") 150 | name = name.replace("汕头一台", "汕头综合") 151 | name = name.replace("汕头一", "汕头综合") 152 | name = name.replace("汕头三台", "汕头文旅体育") 153 | name = name.replace("汕头台", "汕头综合") 154 | name = name.replace("汕头生活", "汕头经济生活") 155 | name = name.replace("汕头文化", "汕头文旅体育") 156 | name = name.replace("揭西台", "揭西") 157 | name = name.replace("揭阳台", "揭阳综合") 158 | name = name.replace("风云音乐", "音乐风云") 159 | name = name.replace("东莞综合", "东莞新闻综合") 160 | name = name.replace("东莞资讯", "东莞生活资讯") 161 | name = name.replace("凤凰卫视资讯台", "凤凰卫视资讯") 162 | name = name.replace("山东教育卫视卫视", "山东教育卫视") 163 | name = name.replace("黑龙江卫视清", "黑龙江卫视") 164 | name = name.replace("CCTV4K4K50p", "CCTV4K50p") 165 | name = name.replace("CCTV4K4K", "CCTV4K") 166 | name = name.replace("BRTV北京卫视", "北京卫视") 167 | print(f"{name},{channel_url}") 168 | urlright = channel_url[:4] 169 | if urlright == 'http': 170 | if "[" not in channel_url: 171 | if '画中画' not in channel_name and '单音' not in channel_name and '直播' not in channel_name and '测试' not in channel_name and '主视' not in channel_name: 172 | check_name = f"{name}" 173 | if not is_first_digit(check_name): 174 | results.append(f"{name},{channel_url}") 175 | 176 | results = set(results) # 去重得到唯一的URL列表 177 | results = sorted(results) 178 | with open("iptv_new_all.txt", 'w', encoding='utf-8') as file: 179 | for result in results: 180 | file.write(result + "\n") 181 | # print(result) 182 | file.close() 183 | -------------------------------------------------------------------------------- /temp/ip_head.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | def get_redirected_urls(url_list): 4 | session = requests.Session() 5 | redirected_urls = [] 6 | for line in url_list: 7 | line = line.strip() 8 | count = line.count(',') 9 | if count == 1: 10 | if line: 11 | channel_name, channel_url = line.split(',') 12 | if 'http' in channel_url: 13 | response = requests.head(channel_url, allow_redirects=False) 14 | print(response) 15 | # 如果初始请求返回200,但之后服务器又发出了302重定向,我们需要处理这种情况 16 | if response.status_code == 200 and 'Location' in response.headers: 17 | redirected_url = response.headers['Location'] 18 | redirected_response = session.head(redirected_url) 19 | new_url = channel_name, redirected_response.url 20 | redirected_urls.append(new_url) 21 | # 如果初始请求直接返回了重定向,我们直接返回重定向的URL 22 | elif response.status_code in [301, 302, 303, 307, 308]: 23 | print("--------------------",response.headers['Location']) 24 | new_url = channel_name, response.headers['Location'] 25 | redirected_urls.append(new_url) 26 | else: 27 | # 如果没有重定向,返回原始URL 28 | new_url = channel_name, channel_url 29 | redirected_urls.append(new_url) 30 | else: 31 | redirected_urls.append(line) 32 | else: 33 | redirected_urls.append(line) 34 | 35 | return redirected_urls 36 | 37 | # 示例用法 38 | url_list = [ 39 | "HBO_HD,http://mywlkj.ddns.net:754/tv/haiou.php?id=1", 40 | "HBO_HITS,http://mywlkj.ddns.net:754/tv/haiou.php?id=2", 41 | "HBOSignatureHD,http://mywlkj.ddns.net:754/tv/haiou.php?id=3", 42 | "HBO温馨家庭,http://mywlkj.ddns.net:754/tv/haiou.php?id=4", 43 | "华纳电影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=5", 44 | "惊辣Thrill,http://mywlkj.ddns.net:754/tv/haiou.php?id=6", 45 | "8度空间HD,http://mywlkj.ddns.net:754/tv/haiou.php?id=7", 46 | "欢喜台HD,http://mywlkj.ddns.net:754/tv/haiou.php?id=8", 47 | "全佳台HD,http://mywlkj.ddns.net:754/tv/haiou.php?id=9", 48 | "爱奇艺HD,http://mywlkj.ddns.net:754/tv/haiou.php?id=10", 49 | "凤凰香港台,http://mywlkj.ddns.net:754/tv/haiou.php?id=11", 50 | "凤凰中文台,http://mywlkj.ddns.net:754/tv/haiou.php?id=12", 51 | "凤凰资讯台,http://mywlkj.ddns.net:754/tv/haiou.php?id=13", 52 | "TVB翡翠台,http://mywlkj.ddns.net:754/tv/haiou.php?id=14", 53 | "TVBJ2台,http://mywlkj.ddns.net:754/tv/haiou.php?id=15", 54 | "TVB明珠台,http://mywlkj.ddns.net:754/tv/haiou.php?id=16", 55 | "TVB华丽翡翠台,http://mywlkj.ddns.net:754/tv/haiou.php?id=17", 56 | "TVB星河台(粤),http://mywlkj.ddns.net:754/tv/haiou.php?id=18", 57 | "TVB星河台(国),http://mywlkj.ddns.net:754/tv/haiou.php?id=19", 58 | "TVB星河台(粤),http://mywlkj.ddns.net:754/tv/haiou.php?id=20", 59 | "港台RHK31,http://mywlkj.ddns.net:754/tv/haiou.php?id=21", 60 | "港台RHK32,http://mywlkj.ddns.net:754/tv/haiou.php?id=22", 61 | "VIU TV,http://mywlkj.ddns.net:754/tv/haiou.php?id=23", 62 | "VIU TV6,http://mywlkj.ddns.net:754/tv/haiou.php?id=24", 63 | "TVB无线新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=25", 64 | "TVB财经体育资讯2台,http://mywlkj.ddns.net:754/tv/haiou.php?id=26", 65 | "美亚电影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=27", 66 | "天映经典,http://mywlkj.ddns.net:754/tv/haiou.php?id=28", 67 | "天映频道,http://mywlkj.ddns.net:754/tv/haiou.php?id=29", 68 | "CINEMAX,http://mywlkj.ddns.net:754/tv/haiou.php?id=30", 69 | "AXN,http://mywlkj.ddns.net:754/tv/haiou.php?id=31", 70 | "tvNMovie,http://mywlkj.ddns.net:754/tv/haiou.php?id=32", 71 | "民视,http://mywlkj.ddns.net:754/tv/haiou.php?id=33", 72 | "台视,http://mywlkj.ddns.net:754/tv/haiou.php?id=34", 73 | "中视,http://mywlkj.ddns.net:754/tv/haiou.php?id=35", 74 | "华视,http://mywlkj.ddns.net:754/tv/haiou.php?id=36", 75 | "公视,http://mywlkj.ddns.net:754/tv/haiou.php?id=37", 76 | "TVBS,http://mywlkj.ddns.net:754/tv/haiou.php?id=38", 77 | "台视综合台,http://mywlkj.ddns.net:754/tv/haiou.php?id=39", 78 | "民视台湾台,http://mywlkj.ddns.net:754/tv/haiou.php?id=40", 79 | "三立综合台,http://mywlkj.ddns.net:754/tv/haiou.php?id=41", 80 | "三立台湾台,http://mywlkj.ddns.net:754/tv/haiou.php?id=42", 81 | "三立戏剧台,http://mywlkj.ddns.net:754/tv/haiou.php?id=43", 82 | "三立都会台,http://mywlkj.ddns.net:754/tv/haiou.php?id=44", 83 | "八大综合台,http://mywlkj.ddns.net:754/tv/haiou.php?id=45", 84 | "八大第一台,http://mywlkj.ddns.net:754/tv/haiou.php?id=46", 85 | "八大戏剧台,http://mywlkj.ddns.net:754/tv/haiou.php?id=47", 86 | "爱尔达综合,http://mywlkj.ddns.net:754/tv/haiou.php?id=48", 87 | "爱尔达影剧,http://mywlkj.ddns.net:754/tv/haiou.php?id=49", 88 | "中天亚洲台,http://mywlkj.ddns.net:754/tv/haiou.php?id=50", 89 | "中天综合台,http://mywlkj.ddns.net:754/tv/haiou.php?id=51", 90 | "中天娱乐台,http://mywlkj.ddns.net:754/tv/haiou.php?id=52", 91 | "TVBS欢乐台,http://mywlkj.ddns.net:754/tv/haiou.php?id=53", 92 | "龙详时代台,http://mywlkj.ddns.net:754/tv/haiou.php?id=54", 93 | "东森电影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=55", 94 | "东森洋片台,http://mywlkj.ddns.net:754/tv/haiou.php?id=56", 95 | "东森综合台,http://mywlkj.ddns.net:754/tv/haiou.php?id=57", 96 | "东森戏剧台,http://mywlkj.ddns.net:754/tv/haiou.php?id=58", 97 | "东森超视台,http://mywlkj.ddns.net:754/tv/haiou.php?id=59", 98 | "好莱坞电影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=60", 99 | "緯來電影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=61", 100 | "卫视洋片台,http://mywlkj.ddns.net:754/tv/haiou.php?id=62", 101 | "龙华戏剧台,http://mywlkj.ddns.net:754/tv/haiou.php?id=63", 102 | "龙华偶像台,http://mywlkj.ddns.net:754/tv/haiou.php?id=64", 103 | "龙华洋片台,http://mywlkj.ddns.net:754/tv/haiou.php?id=65", 104 | "龙华电影台,http://mywlkj.ddns.net:754/tv/haiou.php?id=66", 105 | "TVBS新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=67", 106 | "中天新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=68", 107 | "台视新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=69", 108 | "中视新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=70", 109 | "民视新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=71", 110 | "东森新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=72", 111 | "东森财经台,http://mywlkj.ddns.net:754/tv/haiou.php?id=73", 112 | "寰宇新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=74", 113 | "非凡新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=75", 114 | "年代新闻台,http://mywlkj.ddns.net:754/tv/haiou.php?id=76", 115 | "WWEHD,http://mywlkj.ddns.net:754/tv/haiou.php?id=77", 116 | "爱尔达体育2台,http://mywlkj.ddns.net:754/tv/haiou.php?id=78", 117 | "博斯运动1,http://mywlkj.ddns.net:754/tv/haiou.php?id=79", 118 | "博斯运动2,http://mywlkj.ddns.net:754/tv/haiou.php?id=80", 119 | "博斯高球台,http://mywlkj.ddns.net:754/tv/haiou.php?id=81", 120 | "博斯网球台,http://mywlkj.ddns.net:754/tv/haiou.php?id=82", 121 | "Supersports1,http://mywlkj.ddns.net:754/tv/haiou.php?id=83", 122 | "Supersports4,http://mywlkj.ddns.net:754/tv/haiou.php?id=84", 123 | "SonyTen1,http://mywlkj.ddns.net:754/tv/haiou.php?id=85", 124 | "SonyTen2,http://mywlkj.ddns.net:754/tv/haiou.php?id=86", 125 | "SonyTen3,http://mywlkj.ddns.net:754/tv/haiou.php?id=87", 126 | "纬来体育台,http://mywlkj.ddns.net:754/tv/haiou.php?id=88", 127 | "纬来日本台,http://mywlkj.ddns.net:754/tv/haiou.php?id=89", 128 | "EYETV旅游,http://mywlkj.ddns.net:754/tv/haiou.php?id=90", 129 | "EYETV戏剧,http://mywlkj.ddns.net:754/tv/haiou.php?id=91", 130 | "Momo综合,http://mywlkj.ddns.net:754/tv/haiou.php?id=92", 131 | "靖天国际台,http://mywlkj.ddns.net:754/tv/haiou.php?id=93", 132 | "靖天卡通台,http://mywlkj.ddns.net:754/tv/haiou.php?id=94", 133 | "大爱电视台,http://mywlkj.ddns.net:754/tv/haiou.php?id=95", 134 | "美食星球台,http://mywlkj.ddns.net:754/tv/haiou.php?id=96", 135 | "亚洲旅游台,http://mywlkj.ddns.net:754/tv/haiou.php?id=97", 136 | "TLC旅游台,http://mywlkj.ddns.net:754/tv/haiou.php?id=98", 137 | "国家地理野生,http://mywlkj.ddns.net:754/tv/haiou.php?id=99", 138 | "国家地理台湾,http://mywlkj.ddns.net:754/tv/haiou.php?id=100", 139 | "DiscoveryAsia,http://mywlkj.ddns.net:754/tv/haiou.php?id=101", 140 | "DiscoveryHD,http://mywlkj.ddns.net:754/tv/haiou.php?id=102", 141 | ] 142 | 143 | redirected_urls = get_redirected_urls(url_list) 144 | 145 | for line in redirected_urls: 146 | print(line) 147 | -------------------------------------------------------------------------------- /hotel_duli_ip.py: -------------------------------------------------------------------------------- 1 | import random 2 | import concurrent.futures 3 | from selenium.webdriver.chrome.options import Options 4 | from selenium import webdriver 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support.ui import WebDriverWait 7 | from selenium.webdriver.support import expected_conditions as EC 8 | import time 9 | import os 10 | import re 11 | from bs4 import BeautifulSoup 12 | from queue import Queue 13 | import threading 14 | import requests 15 | from requests.exceptions import Timeout 16 | 17 | lock = threading.Lock() 18 | # 查找所有符合指定格式的网址 19 | infoList = [] 20 | urls_y = [] 21 | resultslist = [] 22 | urls = [] 23 | # 初始化计数器为0 24 | counter = -1 25 | 26 | # 每次调用该函数时将计数器加1并返回结果 27 | def increment_counter(): 28 | global counter 29 | counter += 1 30 | return counter 31 | 32 | #判断一个数字是单数还是双数可 33 | def is_odd_or_even(number): 34 | if number % 2 == 0: 35 | return True 36 | else: 37 | return False 38 | 39 | 40 | 41 | sorted_list = [ 42 | "113.64.145.105:8081", 43 | ] 44 | 45 | headers={ 46 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 47 | 'Accept-Encoding': 'gzip, deflate', 48 | 'Accept-Language': 'zh-CN,zh;q=0.9', 49 | 'Cache-Control': 'max-age=0', 50 | 'Connection': 'keep-alive', 51 | 'Content-Length': '72', 52 | 'Content-Type': 'application/x-www-form-urlencoded', 53 | 'Host': 'foodieguide.com', 54 | 'Origin': 'http://foodieguide.com', 55 | 'Referer': 'http://foodieguide.com/iptvsearch/hotellist.html', 56 | 'Upgrade-Insecure-Requests': '1', 57 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', 58 | } 59 | ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.1.0 Safari/537.36" 60 | def worker(thread_url,counter_id): 61 | try: 62 | # 创建一个Chrome WebDriver实例 63 | results = [] 64 | chrome_options = Options() 65 | chrome_options.add_argument(f'user-agent={ua}') 66 | chrome_options.add_argument(f"user-data-dir=selenium{counter_id}") 67 | chrome_options.add_argument('--headless') 68 | chrome_options.add_argument('--no-sandbox') 69 | chrome_options.add_argument('--disable-dev-shm-usage') 70 | chrome_options.add_experimental_option("useAutomationExtension", False) 71 | chrome_options.add_argument("blink-settings=imagesEnabled=false") 72 | 73 | driver = webdriver.Chrome(options=chrome_options) 74 | # 设置页面加载超时 75 | driver.set_page_load_timeout(60) # 10秒后超时 76 | 77 | # 设置脚本执行超时 78 | driver.set_script_timeout(50) # 5秒后超时 79 | # 使用WebDriver访问网页 80 | # page_url= f"http://foodieguide.com/iptvsearch/alllist.php?s={thread_url}" 81 | page_url= f"http://tonkiang.us/alllist.php?s={thread_url}" 82 | print(page_url) 83 | driver.get(page_url) # 将网址替换为你要访问的网页地址 84 | 85 | time.sleep(30) 86 | soup = BeautifulSoup(driver.page_source, "html.parser") 87 | print(soup) 88 | tables_div = soup.find("div", class_="tables") 89 | results = ( 90 | tables_div.find_all("div", class_="result") 91 | if tables_div 92 | else [] 93 | ) 94 | if not any( 95 | result.find("div", class_="m3u8") for result in results 96 | ): 97 | #break 98 | print("Err-------------------------------------------------------------------------------------------------------") 99 | for result in results: 100 | #print(result) 101 | m3u8_div = result.find("div", class_="m3u8") 102 | url_int = m3u8_div.text.strip() if m3u8_div else None 103 | #取频道名称 104 | m3u8_name_div = result.find("div", class_="channel") 105 | url_name = m3u8_name_div.text.strip() if m3u8_div else None 106 | #----- 107 | #print("-------------------------------------------------------------------------------------------------------") 108 | name =f"{url_name}" 109 | if len(name) == 0: 110 | name = "Err画中画" 111 | #print(name) 112 | urlsp =f"{url_int}" 113 | if len(urlsp) == 0: 114 | urlsp = "rtp://127.0.0.1" 115 | print(f"{url_name}\t{url_int}") 116 | #print("-------------------------------------------------------------------------------------------------------") 117 | urlsp = urlsp.replace("http://67.211.73.118:9901", "") 118 | name = name.replace("cctv", "CCTV") 119 | name = name.replace("中央", "CCTV") 120 | name = name.replace("央视", "CCTV") 121 | name = name.replace("高清", "") 122 | name = name.replace("HD", "") 123 | name = name.replace("标清", "") 124 | name = name.replace("频道", "") 125 | name = name.replace("-", "") 126 | name = name.replace(" ", "") 127 | name = name.replace("PLUS", "+") 128 | name = name.replace("+", "+") 129 | name = name.replace("(", "") 130 | name = name.replace(")", "") 131 | name = re.sub(r"CCTV(\d+)台", r"CCTV\1", name) 132 | name = name.replace("CCTV1综合", "CCTV1") 133 | name = name.replace("CCTV2财经", "CCTV2") 134 | name = name.replace("CCTV3综艺", "CCTV3") 135 | name = name.replace("CCTV4国际", "CCTV4") 136 | name = name.replace("CCTV4中文国际", "CCTV4") 137 | name = name.replace("CCTV4欧洲", "CCTV4") 138 | name = name.replace("CCTV5体育", "CCTV5") 139 | name = name.replace("CCTV6电影", "CCTV6") 140 | name = name.replace("CCTV7军事", "CCTV7") 141 | name = name.replace("CCTV7军农", "CCTV7") 142 | name = name.replace("CCTV7农业", "CCTV7") 143 | name = name.replace("CCTV7国防军事", "CCTV7") 144 | name = name.replace("CCTV8电视剧", "CCTV8") 145 | name = name.replace("CCTV9记录", "CCTV9") 146 | name = name.replace("CCTV9纪录", "CCTV9") 147 | name = name.replace("CCTV10科教", "CCTV10") 148 | name = name.replace("CCTV11戏曲", "CCTV11") 149 | name = name.replace("CCTV12社会与法", "CCTV12") 150 | name = name.replace("CCTV13新闻", "CCTV13") 151 | name = name.replace("CCTV新闻", "CCTV13") 152 | name = name.replace("CCTV14少儿", "CCTV14") 153 | name = name.replace("CCTV15音乐", "CCTV15") 154 | name = name.replace("CCTV16奥林匹克", "CCTV16") 155 | name = name.replace("CCTV17农业农村", "CCTV17") 156 | name = name.replace("CCTV17农业", "CCTV17") 157 | name = name.replace("CCTV5+体育赛视", "CCTV5+") 158 | name = name.replace("CCTV5+体育赛事", "CCTV5+") 159 | name = name.replace("CCTV5+体育", "CCTV5+") 160 | name = name.replace("CMIPTV", "") 161 | name = name.replace("内蒙卫视", "内蒙古卫视") 162 | name = name.replace("CCTVCCTV", "CCTV") 163 | if "http" in urlsp: 164 | # 获取锁 165 | lock.acquire() 166 | infoList.append(f"{name},{urlsp}") 167 | # 释放锁 168 | lock.release() 169 | print(f"=========================>>> Thread {thread_url} save ok") 170 | except Exception as e: 171 | print(f"=========================>>> Thread {thread_url} caught an exception: {e}") 172 | finally: 173 | # 确保线程结束时关闭WebDriver实例 174 | driver.quit() 175 | print(f"=========================>>> Thread {thread_url} quiting") 176 | # 标记任务完成 177 | time.sleep(0) 178 | 179 | # 创建一个线程池,限制最大线程数为3 180 | with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor: 181 | # 提交任务到线程池,并传入参数 182 | counter = increment_counter() 183 | for i in sorted_list: # 假设有5个任务需要执行 184 | executor.submit(worker, i ,counter) 185 | 186 | infoList = set(infoList) # 去重得到唯一的URL列表 187 | infoList = sorted(infoList) 188 | 189 | with open("unicom24-113-64-145-105.txt", 'w', encoding='utf-8') as file: 190 | for info in infoList: 191 | file.write(info + "\n") 192 | print(info) 193 | file.close() 194 | -------------------------------------------------------------------------------- /nanxun_tv.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import requests 5 | from requests.exceptions import Timeout 6 | import chardet 7 | 8 | now_today = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 9 | load_urls = [ 10 | "http://tvbox.nx66.bf:99/tvbox/zhibo.php", 11 | "http://api.mcqq.cn/tvbox/zhibo.php", 12 | "http://39.101.135.137:8081/ls.txt", 13 | "https://raw.gitcode.com/lionzang/TV/raw/main/channel.txt", 14 | "https://gitee.com/chuangxin-chuang_0/cysmlzx/raw/master/iptv.txt", 15 | "http://107.174.127.132:2082/getplaylist?user=tianya666&type=txt" 16 | ] 17 | file_contents = [] 18 | results = [] 19 | for url in load_urls: 20 | try: 21 | response = requests.get(url, allow_redirects=True, timeout=10) 22 | if response.status_code == 200: 23 | file_contents.append(f"//地址:{url}\n") 24 | # print(response.text) 25 | detected_encoding = chardet.detect(response.content)['encoding'] 26 | if detected_encoding is not None: 27 | content = response.content.decode(detected_encoding, errors='ignore') 28 | else: 29 | # 你可以选择一个默认的编码,或者记录一个错误,或者采取其他措施 30 | content = response.content.decode('utf-8', errors='ignore') 31 | file_contents.append(content) 32 | except: 33 | print(f"=============Errot============={url}") 34 | url_list = [line for line_str in file_contents for line in line_str.split('\n')] 35 | def text_name(put_name): 36 | name =(f"{put_name}") 37 | name = name.replace("cctv", "CCTV") 38 | name = name.replace("中央", "CCTV") 39 | name = name.replace("央视", "CCTV") 40 | name = name.replace("高清", "") 41 | name = name.replace("超高", "") 42 | name = name.replace("HD", "") 43 | name = name.replace("标清", "") 44 | name = name.replace("频道", "") 45 | name = name.replace("-", "") 46 | name = name.replace("·", "") 47 | name = name.replace(" ", "") 48 | name = name.replace("PLUS", "+") 49 | name = name.replace("+", "+") 50 | name = name.replace("(", "") 51 | name = name.replace(")", "") 52 | name = re.sub(r"CCTV(\d+)台", r"CCTV\1", name) 53 | name = name.replace("CCTV1综合", "CCTV1") 54 | name = name.replace("CCTV2财经", "CCTV2") 55 | name = name.replace("CCTV3综艺", "CCTV3") 56 | name = name.replace("CCTV4国际", "CCTV4") 57 | name = name.replace("CCTV4中文国际", "CCTV4") 58 | name = name.replace("CCTV4欧洲", "CCTV4") 59 | name = name.replace("CCTV5体育", "CCTV5") 60 | name = name.replace("CCTV6电影", "CCTV6") 61 | name = name.replace("CCTV7军事", "CCTV7") 62 | name = name.replace("CCTV7军农", "CCTV7") 63 | name = name.replace("CCTV7农业", "CCTV7") 64 | name = name.replace("CCTV7国防军事", "CCTV7") 65 | name = name.replace("CCTV8电视剧", "CCTV8") 66 | name = name.replace("CCTV9记录", "CCTV9") 67 | name = name.replace("CCTV9纪录", "CCTV9") 68 | name = name.replace("CCTV10科教", "CCTV10") 69 | name = name.replace("CCTV11戏曲", "CCTV11") 70 | name = name.replace("CCTV12社会与法", "CCTV12") 71 | name = name.replace("CCTV13新闻", "CCTV13") 72 | name = name.replace("CCTV新闻", "CCTV13") 73 | name = name.replace("CCTV14少儿", "CCTV14") 74 | name = name.replace("CCTV15音乐", "CCTV15") 75 | name = name.replace("CCTV16奥林匹克", "CCTV16") 76 | name = name.replace("CCTV17农业农村", "CCTV17") 77 | name = name.replace("CCTV17农业", "CCTV17") 78 | name = name.replace("CCTV5+体育赛视", "CCTV5+") 79 | name = name.replace("CCTV5+体育赛事", "CCTV5+") 80 | name = name.replace("CCTV5+体育", "CCTV5+") 81 | name = name.replace("CMIPTV", "") 82 | name = name.replace("[", "") 83 | name = name.replace("]", "") 84 | name = name.replace("HD", "") 85 | name = name.replace("(", "") 86 | name = name.replace(")", "") 87 | name = name.replace("天津高清", "天津卫视高清") 88 | name = name.replace("广东高清", "广东卫视高清") 89 | name = name.replace("深圳高清", "深圳卫视高清") 90 | name = name.replace("湖北高清", "湖北卫视高清") 91 | name = name.replace("湖南高清", "湖南卫视高清") 92 | name = name.replace("福建东南卫视高清", "东南卫视高清") 93 | name = name.replace("山东教育", "山东教育卫视") 94 | name = name.replace("山东高清", "山东卫视高清") 95 | name = name.replace("广东体育高清", "广东体育卫视高清") 96 | name = name.replace("广东珠江高清", "广东珠江卫视高清") 97 | name = name.replace("广东高清", "广东卫视高清") 98 | name = name.replace("浙江高清", "浙江卫视高清") 99 | name = name.replace("深圳高清", "深圳卫视高清") 100 | name = name.replace("湖北高清", "湖北卫视高清") 101 | name = name.replace("湖南高清", "湖南卫视高清") 102 | name = name.replace("江苏高清", "江苏卫视高清") 103 | name = name.replace("北京卫视高清", "北京卫视高清") 104 | name = name.replace("北京高清", "北京卫视高清") 105 | name = name.replace("福建东南卫视", "东南卫视") 106 | name = name.replace("凤凰中文", "凤凰卫视中文") 107 | name = name.replace("凤凰资讯", "凤凰卫视资讯") 108 | name = name.replace("凤凰香港", "凤凰香港卫视") 109 | name = name.replace("本港", "本港卫视") 110 | name = name.replace("香港明珠", "香港明珠卫视") 111 | name = name.replace("香港翡翠", "香港翡翠卫视") 112 | name = name.replace("香港音乐", "香港音乐卫视") 113 | name = name.replace("高请", "高清") 114 | name = name.replace("CCTVCCTV", "CCTV") 115 | name = name.replace("汕头二台", "汕头经济生活") 116 | name = name.replace("汕头二", "汕头经济生活") 117 | name = name.replace("汕头一台", "汕头综合") 118 | name = name.replace("汕头一", "汕头综合") 119 | name = name.replace("汕头三台", "汕头文旅体育") 120 | name = name.replace("汕头台", "汕头综合") 121 | name = name.replace("汕头生活", "汕头经济生活") 122 | name = name.replace("汕头文化", "汕头文旅体育") 123 | name = name.replace("揭西台", "揭西") 124 | name = name.replace("揭阳台", "揭阳综合") 125 | name = name.replace("风云音乐", "音乐风云") 126 | name = name.replace("东莞综合", "东莞新闻综合") 127 | name = name.replace("东莞资讯", "东莞生活资讯") 128 | name = name.replace("凤凰卫视资讯台", "凤凰卫视资讯") 129 | name = name.replace("山东教育卫视卫视", "山东教育卫视") 130 | name = name.replace("CCTV4K4K50p", "CCTV4K50p") 131 | name = name.replace("CCTV4K4K", "CCTV4K") 132 | name = name.replace("BRTV北京卫视", "北京卫视") 133 | return name 134 | 135 | def text_list(list_str): 136 | if len(list_str) > 0: 137 | if '#genre#' in list_str: 138 | results.append(list_str) 139 | elif '#' in list_str: 140 | part_before_comma = list_str.split(',')[0] 141 | part_before_comma = text_name(part_before_comma) 142 | parts = list(filter(None, list_str.split("#"))) 143 | for line in parts: 144 | print(line) 145 | count = line.count(',') 146 | if count == 0: 147 | results.append(f"{part_before_comma},{line.strip()}") 148 | else: 149 | count = line.count(',') 150 | if count == 1: 151 | channel_name, channel_url = line.strip().split(',') 152 | name = text_name(channel_name) 153 | results.append(f"{name},{channel_url}") 154 | else: 155 | results.append(line.strip()) 156 | else: 157 | count = list_str.count(',') 158 | if count == 1: 159 | channel_name, channel_url = list_str.strip().split(',') 160 | name = text_name(channel_name) 161 | results.append(f"{name},{channel_url}") 162 | else: 163 | results.append(list_str.strip()) 164 | 165 | for result in url_list: 166 | text_list(result) 167 | # print(result) 168 | 169 | # 将结果写入文件 170 | with open("nanxun_tv.txt", 'w', encoding='utf-8') as file: 171 | for result in results: 172 | # print(result) 173 | file.write(f"{result}\n") 174 | file.write(f"更新时间:{now_today}\n") 175 | file.close() 176 | 177 | results_list = set(results) 178 | results_set = sorted(results_list) 179 | # 分离出移动源 180 | with open("chinamobile.txt", 'w', encoding='utf-8') as file: 181 | for result in results_set: 182 | if 'http://ottrrs.hl.chinamobile.com' in result or '/dbiptv.sn.chinamobile.com/' in result: 183 | if '://[' not in result: 184 | line = result.strip() 185 | count = line.count(',') 186 | if count == 1: 187 | if line: 188 | channel_name, channel_url = line.split(',') 189 | name =(f"{channel_name}") 190 | file.write(f"{name}_移动,{channel_url}\n") 191 | print(f"{name},{channel_url}") 192 | file.write(f"更新时间:{now_today}\n") 193 | file.close() 194 | -------------------------------------------------------------------------------- /itv.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import concurrent.futures 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.options import Options 6 | import requests 7 | import re 8 | 9 | urls = [ 10 | "https://fofa.info/result?qbase64=Ym9keT0iZGJpcHR2LnNuLmNoaW5hbW9iaWxlLmNvbSIgJiYgY291bnRyeT0iQ04i" #湖南 11 | ] 12 | 13 | def modify_urls(url): 14 | modified_urls = [] 15 | ip_start_index = url.find("//") + 2 16 | ip_end_index = url.find(":", ip_start_index) 17 | base_url = url[:ip_start_index] # http:// or https:// 18 | ip_address = url[ip_start_index:ip_end_index] 19 | port = url[ip_end_index:] 20 | ip_end = "/iptv/live/1000.json?key=txiptv" 21 | for i in range(1, 256): 22 | modified_ip = f"{ip_address[:-1]}{i}" 23 | modified_url = f"{base_url}{modified_ip}{port}{ip_end}" 24 | modified_urls.append(modified_url) 25 | 26 | return modified_urls 27 | 28 | 29 | def is_url_accessible(url): 30 | try: 31 | response = requests.get(url, timeout=0.4) 32 | if response.status_code == 200: 33 | return url 34 | except requests.exceptions.RequestException: 35 | pass 36 | return None 37 | 38 | 39 | results = [] 40 | 41 | for url in urls: 42 | # 创建一个Chrome WebDriver实例 43 | chrome_options = Options() 44 | chrome_options.add_argument('--headless') 45 | chrome_options.add_argument('--no-sandbox') 46 | chrome_options.add_argument('--disable-dev-shm-usage') 47 | chrome_options.add_experimental_option("useAutomationExtension", False) 48 | chrome_options.add_argument("blink-settings=imagesEnabled=false") 49 | driver = webdriver.Chrome(options=chrome_options) 50 | # 使用WebDriver访问网页 51 | driver.get(url) # 将网址替换为你要访问的网页地址 52 | time.sleep(6) 53 | # 获取网页内容 54 | page_content = driver.page_source 55 | 56 | # 关闭WebDriver 57 | driver.quit() 58 | 59 | # 查找所有符合指定格式的网址 60 | pattern = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+" # 设置匹配的格式,如http://8.8.8.8:8888 61 | urls_all = re.findall(pattern, page_content) 62 | # urls = list(set(urls_all)) # 去重得到唯一的URL列表 63 | urls = set(urls_all) # 去重得到唯一的URL列表 64 | x_urls = [] 65 | for url in urls: # 对urls进行处理,ip第四位修改为1,并去重 66 | url = url.strip() 67 | ip_start_index = url.find("//") + 2 68 | ip_end_index = url.find(":", ip_start_index) 69 | ip_dot_start = url.find(".") + 1 70 | ip_dot_second = url.find(".", ip_dot_start) + 1 71 | ip_dot_three = url.find(".", ip_dot_second) + 1 72 | base_url = url[:ip_start_index] # http:// or https:// 73 | ip_address = url[ip_start_index:ip_dot_three] 74 | port = url[ip_end_index:] 75 | ip_end = "1" 76 | modified_ip = f"{ip_address}{ip_end}" 77 | x_url = f"{base_url}{modified_ip}{port}" 78 | x_urls.append(x_url) 79 | urls = set(x_urls) # 去重得到唯一的URL列表 80 | 81 | valid_urls = [] 82 | # 多线程获取可用url 83 | with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor: 84 | futures = [] 85 | for url in urls: 86 | url = url.strip() 87 | modified_urls = modify_urls(url) 88 | for modified_url in modified_urls: 89 | futures.append(executor.submit(is_url_accessible, modified_url)) 90 | 91 | for future in concurrent.futures.as_completed(futures): 92 | result = future.result() 93 | if result: 94 | valid_urls.append(result) 95 | 96 | # for url in valid_urls: 97 | # print(url) 98 | # 遍历网址列表,获取JSON文件并解析 99 | for url in valid_urls: 100 | print(url) 101 | try: 102 | # 发送GET请求获取JSON文件,设置超时时间为0.5秒 103 | ip_start_index = url.find("//") + 2 104 | ip_dot_start = url.find(".") + 1 105 | ip_index_second = url.find("/", ip_dot_start) 106 | base_url = url[:ip_start_index] # http:// or https:// 107 | ip_address = url[ip_start_index:ip_index_second] 108 | url_x = f"{base_url}{ip_address}" 109 | 110 | json_url = f"{url}" 111 | response = requests.get(json_url, timeout=1) 112 | json_data = response.json() 113 | 114 | try: 115 | # 解析JSON文件,获取name和url字段 116 | for item in json_data['data']: 117 | if isinstance(item, dict): 118 | name = item.get('name') 119 | urlx = item.get('url') 120 | if ',' in urlx: 121 | urlx=f"aaaaaaaa" 122 | 123 | #if 'http' in urlx or 'udp' in urlx or 'rtp' in urlx: 124 | if 'http' in urlx: 125 | urld = f"{urlx}" 126 | else: 127 | urld = f"{url_x}{urlx}" 128 | 129 | if name and urld: 130 | # 删除特定文字 131 | name = name.replace("cctv", "CCTV") 132 | name = name.replace("中央", "CCTV") 133 | name = name.replace("央视", "CCTV") 134 | name = name.replace("高清", "") 135 | name = name.replace("超高", "") 136 | name = name.replace("HD", "") 137 | name = name.replace("标清", "") 138 | name = name.replace("频道", "") 139 | name = name.replace("-", "") 140 | name = name.replace(" ", "") 141 | name = name.replace("PLUS", "+") 142 | name = name.replace("+", "+") 143 | name = name.replace("(", "") 144 | name = name.replace(")", "") 145 | name = re.sub(r"CCTV(\d+)台", r"CCTV\1", name) 146 | name = name.replace("CCTV1综合", "CCTV1") 147 | name = name.replace("CCTV2财经", "CCTV2") 148 | name = name.replace("CCTV3综艺", "CCTV3") 149 | name = name.replace("CCTV4国际", "CCTV4") 150 | name = name.replace("CCTV4中文国际", "CCTV4") 151 | name = name.replace("CCTV4欧洲", "CCTV4") 152 | name = name.replace("CCTV5体育", "CCTV5") 153 | name = name.replace("CCTV6电影", "CCTV6") 154 | name = name.replace("CCTV7军事", "CCTV7") 155 | name = name.replace("CCTV7军农", "CCTV7") 156 | name = name.replace("CCTV7农业", "CCTV7") 157 | name = name.replace("CCTV7国防军事", "CCTV7") 158 | name = name.replace("CCTV8电视剧", "CCTV8") 159 | name = name.replace("CCTV9记录", "CCTV9") 160 | name = name.replace("CCTV9纪录", "CCTV9") 161 | name = name.replace("CCTV10科教", "CCTV10") 162 | name = name.replace("CCTV11戏曲", "CCTV11") 163 | name = name.replace("CCTV12社会与法", "CCTV12") 164 | name = name.replace("CCTV13新闻", "CCTV13") 165 | name = name.replace("CCTV新闻", "CCTV13") 166 | name = name.replace("CCTV14少儿", "CCTV14") 167 | name = name.replace("CCTV15音乐", "CCTV15") 168 | name = name.replace("CCTV16奥林匹克", "CCTV16") 169 | name = name.replace("CCTV17农业农村", "CCTV17") 170 | name = name.replace("CCTV17农业", "CCTV17") 171 | name = name.replace("CCTV5+体育赛视", "CCTV5+") 172 | name = name.replace("CCTV5+体育赛事", "CCTV5+") 173 | name = name.replace("CCTV5+体育", "CCTV5+") 174 | name = name.replace("CMIPTV", "") 175 | name = name.replace("台", "") 176 | if 'udp' not in urld or 'rtp' not in urld: 177 | results.append(f"{name},{urld}") 178 | except: 179 | continue 180 | except: 181 | continue 182 | 183 | 184 | results = set(results) # 去重得到唯一的URL列表 185 | results = sorted(results) 186 | with open("itv.txt", 'w', encoding='utf-8') as file: 187 | for result in results: 188 | file.write(result + "\n") 189 | print(result) 190 | -------------------------------------------------------------------------------- /ktpd.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | lock = threading.Lock() 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | headers={'User-Agent': 'okhttp/3.15 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} 20 | se=requests.Session() 21 | 22 | with open("itv.txt", 'r', encoding='utf-8') as file: 23 | lines = file.readlines() 24 | for line in lines: 25 | line = line.strip() 26 | count = line.count(',') 27 | if count == 1: 28 | if line: 29 | channel_name, channel_url = line.split(',') 30 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 31 | channels.append((channel_name, channel_url)) 32 | file.close() 33 | 34 | # 定义工作线程函数 35 | def worker(): 36 | while True: 37 | # 从队列中获取一个任务 38 | channel_name, channel_url = task_queue.get() 39 | if ".m3u8" in channel_url or ".flv" in channel_url or ".mp4" in channel_url: 40 | try: 41 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 42 | lines = requests.get(channel_url,headers=headers, timeout=3, stream=True).text.strip().split('\n') # 获取m3u8文件内容 43 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 44 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 45 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 46 | 47 | # 多获取的视频数据进行5秒钟限制 48 | with eventlet.Timeout(5, False): 49 | start_time = time.time() 50 | content = requests.get(ts_url,headers=headers, timeout=(2,5), stream=True).content 51 | end_time = time.time() 52 | response_time = (end_time - start_time) * 1 53 | 54 | if content: 55 | with open(ts_lists_0, 'ab') as f: 56 | f.write(content) # 写入文件 57 | file_size = len(content) 58 | # print(f"文件大小:{file_size} 字节") 59 | download_speed = file_size / response_time / 1024 60 | # print(f"下载速度:{download_speed:.3f} kB/s") 61 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 62 | #print(f'{channel_url}') 63 | #print(f"m3u8 标准化后的速率:{normalized_speed:.3f} MB/s") 64 | 65 | # 删除下载的文件 66 | os.remove(ts_lists_0) 67 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 68 | # 获取锁 69 | lock.acquire() 70 | results.append(result) 71 | # 释放锁 72 | lock.release() 73 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 74 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 75 | except: 76 | error_channel = channel_name, channel_url 77 | # error_channels.append(error_channel) 78 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 79 | else: 80 | try: 81 | now=time.time() 82 | res=se.get(channel_url,headers=headers,timeout=5,stream=True) 83 | if res.status_code==200: 84 | for k in res.iter_content(chunk_size=2097152): 85 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 86 | # 如果能获取视频流,则输出读取的时间以及链接 87 | if time.time()-now > 15: 88 | res.close() 89 | print(f'Time out\t{channel_url}') 90 | break 91 | else: 92 | if k: # 检查是否有内容 93 | print(f'{time.time()-now:.2f}\t{channel_url}') 94 | response_time = (time.time()-now) * 1 95 | download_speed = 2097152 / response_time / 1024 96 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) 97 | if response_time > 1: 98 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 99 | # 获取锁 100 | lock.acquire() 101 | results.append(result) 102 | # 释放锁 103 | lock.release() 104 | else: 105 | print(f'X\t{channel_url}') 106 | 107 | break 108 | except: 109 | # 无法连接并超时的情况下输出“X” 110 | print(f'X\t{channel_url}') 111 | 112 | # 减少CPU占用 113 | time.sleep(0) 114 | # 标记任务完成 115 | task_queue.task_done() 116 | 117 | # 创建多个工作线程 118 | num_threads = 40 119 | for _ in range(num_threads): 120 | t = threading.Thread(target=worker, daemon=True) 121 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 122 | t.start() 123 | #event.set() 124 | 125 | # 添加下载任务到队列 126 | for channel in channels: 127 | task_queue.put(channel) 128 | 129 | # 等待所有任务完成 130 | task_queue.join() 131 | 132 | # 打开移动源文件 133 | with open("chinamobile.txt", 'r', encoding='utf-8') as file: 134 | lines = file.readlines() 135 | for line in lines: 136 | line = line.strip() 137 | count = line.count(',') 138 | if count == 1: 139 | if line: 140 | channel_name, channel_url = line.split(',') 141 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 142 | result = channel_name, channel_url, "0.001 MB/s" 143 | results.append(result) 144 | 145 | def channel_key(channel_name): 146 | match = re.search(r'\d+', channel_name) 147 | if match: 148 | return int(match.group()) 149 | else: 150 | return float('inf') # 返回一个无穷大的数字作为关键字 151 | 152 | # 对频道进行排序 153 | results.sort(key=lambda x: (x[0], -float(x[2].split()[0]))) 154 | #results.sort(key=lambda x: channel_key(x[0])) 155 | now_today = datetime.date.today() 156 | # 将结果写入文件 157 | 158 | result_counter = 16 # 每个频道需要的个数 159 | 160 | with open("ktpd.txt", 'w', encoding='utf-8') as file: 161 | channel_counters = {} 162 | file.write('【 卡通频道 】,#genre#\n') 163 | for result in results: 164 | channel_name, channel_url, speed = result 165 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 166 | if '高清' not in channel_name: 167 | if channel_name in channel_counters: 168 | if channel_counters[channel_name] >= result_counter: 169 | continue 170 | else: 171 | file.write(f"{channel_name},{channel_url}\n") 172 | channel_counters[channel_name] += 1 173 | else: 174 | file.write(f"{channel_name},{channel_url}\n") 175 | channel_counters[channel_name] = 1 176 | 177 | channel_counters = {} 178 | file.write('【 卡通高清频道 】,#genre#\n') 179 | for result in results: 180 | channel_name, channel_url, speed = result 181 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 182 | if '高清' in channel_name: 183 | if channel_name in channel_counters: 184 | if channel_counters[channel_name] >= result_counter: 185 | continue 186 | else: 187 | file.write(f"{channel_name},{channel_url}\n") 188 | channel_counters[channel_name] += 1 189 | else: 190 | file.write(f"{channel_name},{channel_url}\n") 191 | channel_counters[channel_name] = 1 192 | file.close() 193 | -------------------------------------------------------------------------------- /bywork/ktpd.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | import datetime 5 | import threading 6 | from queue import Queue 7 | import requests 8 | import eventlet 9 | eventlet.monkey_patch() 10 | 11 | # 线程安全的队列,用于存储下载任务 12 | task_queue = Queue() 13 | lock = threading.Lock() 14 | # 线程安全的列表,用于存储结果 15 | results = [] 16 | 17 | channels = [] 18 | error_channels = [] 19 | headers={'User-Agent': 'okhttp/3.15 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} 20 | se=requests.Session() 21 | 22 | with open("itv.txt", 'r', encoding='utf-8') as file: 23 | lines = file.readlines() 24 | for line in lines: 25 | line = line.strip() 26 | count = line.count(',') 27 | if count == 1: 28 | if line: 29 | channel_name, channel_url = line.split(',') 30 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 31 | channels.append((channel_name, channel_url)) 32 | file.close() 33 | 34 | # 定义工作线程函数 35 | def worker(): 36 | while True: 37 | # 从队列中获取一个任务 38 | channel_name, channel_url = task_queue.get() 39 | if ".m3u8" in channel_url or ".flv" in channel_url or ".mp4" in channel_url: 40 | try: 41 | channel_url_t = channel_url.rstrip(channel_url.split('/')[-1]) # m3u8链接前缀 42 | lines = requests.get(channel_url,headers=headers, timeout=3, stream=True).text.strip().split('\n') # 获取m3u8文件内容 43 | ts_lists = [line.split('/')[-1] for line in lines if line.startswith('#') == False] # 获取m3u8文件下视频流后缀 44 | ts_lists_0 = ts_lists[0].rstrip(ts_lists[0].split('.ts')[-1]) # m3u8链接前缀 45 | ts_url = channel_url_t + ts_lists[0] # 拼接单个视频片段下载链接 46 | 47 | # 多获取的视频数据进行5秒钟限制 48 | with eventlet.Timeout(5, False): 49 | start_time = time.time() 50 | content = requests.get(ts_url,headers=headers, timeout=(2,5), stream=True).content 51 | end_time = time.time() 52 | response_time = (end_time - start_time) * 1 53 | 54 | if content: 55 | with open(ts_lists_0, 'ab') as f: 56 | f.write(content) # 写入文件 57 | file_size = len(content) 58 | # print(f"文件大小:{file_size} 字节") 59 | download_speed = file_size / response_time / 1024 60 | # print(f"下载速度:{download_speed:.3f} kB/s") 61 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) # 将速率从kB/s转换为MB/s并限制在1~100之间 62 | #print(f'{channel_url}') 63 | #print(f"m3u8 标准化后的速率:{normalized_speed:.3f} MB/s") 64 | 65 | # 删除下载的文件 66 | os.remove(ts_lists_0) 67 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 68 | # 获取锁 69 | lock.acquire() 70 | results.append(result) 71 | # 释放锁 72 | lock.release() 73 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 74 | # print(f"可用频道:{len(results)} 个 , 不可用频道:{len(error_channels)} 个 , 总频道:{len(channels)} 个 ,总进度:{numberx:.2f} %。") 75 | except: 76 | error_channel = channel_name, channel_url 77 | # error_channels.append(error_channel) 78 | numberx = (len(results) + len(error_channels)) / len(channels) * 100 79 | else: 80 | try: 81 | now=time.time() 82 | res=se.get(channel_url,headers=headers,timeout=5,stream=True) 83 | if res.status_code==200: 84 | for k in res.iter_content(chunk_size=2097152): 85 | # 这里的chunk_size是1MB,每次读取1MB测试视频流 86 | # 如果能获取视频流,则输出读取的时间以及链接 87 | if time.time()-now > 15: 88 | res.close() 89 | print(f'Time out\t{channel_url}') 90 | break 91 | else: 92 | if k: # 检查是否有内容 93 | print(f'{time.time()-now:.2f}\t{channel_url}') 94 | response_time = (time.time()-now) * 1 95 | download_speed = 2097152 / response_time / 1024 96 | normalized_speed = min(max(download_speed / 1024, 0.001), 100) 97 | if response_time > 1: 98 | result = channel_name, channel_url, f"{normalized_speed:.3f} MB/s" 99 | # 获取锁 100 | lock.acquire() 101 | results.append(result) 102 | # 释放锁 103 | lock.release() 104 | else: 105 | print(f'X\t{channel_url}') 106 | 107 | break 108 | except: 109 | # 无法连接并超时的情况下输出“X” 110 | print(f'X\t{channel_url}') 111 | 112 | # 减少CPU占用 113 | time.sleep(0) 114 | # 标记任务完成 115 | task_queue.task_done() 116 | 117 | # 创建多个工作线程 118 | num_threads = 40 119 | for _ in range(num_threads): 120 | t = threading.Thread(target=worker, daemon=True) 121 | #t = threading.Thread(target=worker, args=(event,len(channels))) # 将工作线程设置为守护线程 122 | t.start() 123 | #event.set() 124 | 125 | # 添加下载任务到队列 126 | for channel in channels: 127 | task_queue.put(channel) 128 | 129 | # 等待所有任务完成 130 | task_queue.join() 131 | 132 | # 打开移动源文件 133 | with open("chinamobile.txt", 'r', encoding='utf-8') as file: 134 | lines = file.readlines() 135 | for line in lines: 136 | line = line.strip() 137 | count = line.count(',') 138 | if count == 1: 139 | if line: 140 | channel_name, channel_url = line.split(',') 141 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 142 | result = channel_name, channel_url, "0.001 MB/s" 143 | results.append(result) 144 | 145 | def channel_key(channel_name): 146 | match = re.search(r'\d+', channel_name) 147 | if match: 148 | return int(match.group()) 149 | else: 150 | return float('inf') # 返回一个无穷大的数字作为关键字 151 | 152 | # 对频道进行排序 153 | results.sort(key=lambda x: (x[0], -float(x[2].split()[0]))) 154 | #results.sort(key=lambda x: channel_key(x[0])) 155 | now_today = datetime.date.today() 156 | # 将结果写入文件 157 | 158 | result_counter = 16 # 每个频道需要的个数 159 | 160 | with open("ktpd.txt", 'w', encoding='utf-8') as file: 161 | channel_counters = {} 162 | file.write('【 卡通频道 】,#genre#\n') 163 | for result in results: 164 | channel_name, channel_url, speed = result 165 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 166 | if '高清' not in channel_name: 167 | if channel_name in channel_counters: 168 | if channel_counters[channel_name] >= result_counter: 169 | continue 170 | else: 171 | file.write(f"{channel_name},{channel_url}\n") 172 | channel_counters[channel_name] += 1 173 | else: 174 | file.write(f"{channel_name},{channel_url}\n") 175 | channel_counters[channel_name] = 1 176 | 177 | channel_counters = {} 178 | file.write('【 卡通高清频道 】,#genre#\n') 179 | for result in results: 180 | channel_name, channel_url, speed = result 181 | if '卡通' in channel_name or '动漫' in channel_name or '动画' in channel_name or '少儿' in channel_name: 182 | if '高清' in channel_name: 183 | if channel_name in channel_counters: 184 | if channel_counters[channel_name] >= result_counter: 185 | continue 186 | else: 187 | file.write(f"{channel_name},{channel_url}\n") 188 | channel_counters[channel_name] += 1 189 | else: 190 | file.write(f"{channel_name},{channel_url}\n") 191 | channel_counters[channel_name] = 1 192 | file.close() 193 | --------------------------------------------------------------------------------