diff --git a/base/custom.conf b/base/custom.conf index ce6fb1b..36d4e04 100644 --- a/base/custom.conf +++ b/base/custom.conf @@ -19,9 +19,9 @@ "quickSearch":0, "filterable":0 }, - { - "key":"hipy_t4_base", - "name":"base(hipy_t4)", + { + "key":"hipy_t4_base_spider", + "name":"base_spider(hipy_t4)", "type":4, "api":"http://192.168.31.49:5707/api/v1/vod/base_spider", "searchable":1, @@ -30,8 +30,8 @@ "ext":"base_spider" }, { - "key": "hipy_t3_base", - "name": "base(hipy_t3)", + "key": "hipy_t3_base_spider", + "name": "base_spider(hipy_t3)", "type": 3, "api": "{{host}}/txt/hipy/base_spider.py", "searchable": 1, @@ -40,26 +40,46 @@ "ext": "{{host}}/txt/hipy/base_spider.json" }, { - "key":"hipy_t4_cctv", - "name":"cctv(hipy_t4)", + "key":"hipy_t4_cntv央视", + "name":"cntv央视(hipy_t4)", "type":4, - "api":"http://192.168.31.49:5707/api/v1/vod/cctv_spider?api_ext={{host}}/txt/hipy/cctv_spider.json", + "api":"http://192.168.31.49:5707/api/v1/vod/cntv央视?api_ext={{host}}/txt/hipy/cntv央视.json", "searchable":1, "quickSearch":0, "filterable":1, - "ext":"cctv_spider", - }, - { - "key": "hipy_t3_cctv", - "name": "cctv(hipy_t3)", + "ext":"cntv央视" + }, + { + "key": "hipy_t3_cntv央视", + "name": "cntv央视(hipy_t3)", "type": 3, - "api": "{{host}}/txt/hipy/cctv_spider.py", + "api": "{{host}}/txt/hipy/cntv央视.py", "searchable": 1, "quickSearch": 0, "filterable": 1, - "ext": "{{host}}/txt/hipy/cctv_spider.json" + "ext": "{{host}}/txt/hipy/cntv央视.json" + }, + { + "key":"hipy_t4_两个BT", + "name":"两个BT(hipy_t4)", + "type":4, + "api":"http://192.168.31.49:5707/api/v1/vod/两个BT?api_ext={{host}}/txt/hipy/两个BT.json", + "searchable":1, + "quickSearch":0, + "filterable":1, + "ext":"两个BT" }, { + "key": "hipy_t3_两个BT", + "name": "两个BT(hipy_t3)", + "type": 3, + "api": "{{host}}/txt/hipy/两个BT.py", + "searchable": 1, + "quickSearch": 0, + "filterable": 1, + "ext": "{{host}}/txt/hipy/两个BT.json" + }, + { "key":"hipy_t4_樱花动漫", "name":"樱花动漫(hipy_t4)", "type":4, @@ -79,16 +99,6 @@ "filterable": 1, "ext": "https://jihulab.com/qiaoji/open/-/raw/main/yinghua" }, - { - "key":"hipy_t4_两个BT", - "name":"两个BT(hipy_t4)", - "type":4, - "api":"http://192.168.31.49:5707/api/v1/vod/两个BT?api_ext={{host}}/txt/hipy/两个BT.json", - "searchable":1, - "quickSearch":0, - "filterable":1, - "ext":"两个BT" - }, {"key":"Test_jsapi","name":"Test_jsapi(drpy)","type":3,"api":"{{host}}/libs/drpy2.min.js","searchable":2,"quickSearch":0,"filterable":0,"ext":"{{host}}/js/jsapi.js","jar":"{{host}}/libs/jar/custom_jsapi.jar"}, # 缓存js diff --git a/base/rules.db b/base/rules.db index b5032f1..0d52779 100644 Binary files a/base/rules.db and b/base/rules.db differ diff --git a/base/直播.txt b/base/直播.txt index 154cff7..affd91f 100644 --- a/base/直播.txt +++ b/base/直播.txt @@ -1,58 +1,64 @@ -📺|定期维护,#genre# -2023-11-22,https://vdse.bdstatic.com//13da18e12728e9d7849f6589a3070b4c.mp4 -海阔道长,https://vd2.bdstatic.com/mda-mhhf5mr00yyhpfjs/1080p/cae_h264/1629284581057661229/mda-mhhf5mr00yyhpfjs.mp4 -🌏|电视频道,#genre# -CCTV1,http://cfss.cc/api/ysp/cctv1.m3u8 -CCTV2,http://cfss.cc/api/ysp/cctv2.m3u8 -CCTV3,http://cfss.cc/api/ysp/cctv3.m3u8 -CCTV4,http://58.220.219.14:9901/tsfile/live/0004_1.m3u8?key=txiptv -CCTV4K,http://cfss.cc/api/ysp/cctv4k.m3u8 -CCTV5,https://node1.olelive.com:6443/live/CCTV5HD/hls.m3u8 -CCTV6,http://cfss.cc/api/ysp/cctv6.m3u8 -CCTV7,https://node1.olelive.com:6443/live/CCTV7HD/hls.m3u8 -CCTV8,http://cfss.cc/api/ysp/cctv8.m3u8 -CCTV9,http://cfss.cc/api/ysp/cctv9.m3u8 -CCTV10,https://node1.olelive.com:6443/live/CCTV10HD/hls.m3u8 -CCTV11,https://iptv.luas.edu.cn/liverespath/3d0aa0f1604f13f0ae90c2dc0590ca22a1bcaaa2/646e868153-0-0-a53121a1df5b93a74d1980270e652878/index.m3u8 -CCTV13,https://live-play.cctvnews.cctv.com/cctv/merge_cctv13.m3u8 -CCTV14,http://cyz32.livehbindex.hbcatv.cn/live/8a22035194884b1eb5515aac434c313c.m3u8?bitrate=2300&pt=5 -CCTV15,http://gxdl-lhs.8866.org:85/tsfile/live/1025_1.m3u8?key=txiptv&playlive=1&authid=0 -CCTV16,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226825/1.m3u8 -CCTV17,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226660/1.m3u8 -CCTV娱乐,http://line.premiumpowers.net/play/live.php?mac=00:1A:79:73:45:10&extension=ts&stream=156405 -CCTV戏曲,http://line.premiumpowers.net/play/live.php?mac=00:1A:79:73:45:10&extension=ts&stream=156406 -TVB,http://38.64.72.148/hls/modn/list/4005/chunklist1.m3u8 -北京卫视,http://angtv.cc/test/lngd.php?id=083 -黑龙江卫视,http://122.224.153.162:9901/tsfile/live/0143_1.m3u8?key=txiptv -吉林卫视,http://jltpc.x3322.net:9901/tsfile/live/0116_1.m3u8?key=txiptv -辽宁卫视,http://angtv.cc/test/lngd.php?id=058 -河北卫视,http://jltpc.x3322.net:9901/tsfile/live/0117_1.m3u8?key=txiptv -山东卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001028/index.m3u8 -山西卫视,http://jltpc.x3322.net:9901/tsfile/live/0118_1.m3u8?key=txiptv -天津卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001036/index.m3u8 -江苏卫视,http://cfss.cc/api/ysp/jsws.m3u8 -安徽卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001037/index.m3u8 -江西卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001034/index.m3u8 -浙江卫视,http://hw-m-l.cztv.com/channels/lantian/channel01/1080p.m3u8 -东方卫视,http://cfss.cc/api/ysp/dfws.m3u8 -河南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001222/index.m3u8 -湖北卫视,https://iptv.luas.edu.cn/liverespath/a8e4cf2bade25844b998d7743d83331412ea841f/09ef2cf7aa-0-0-41178ff5e45faa352937baadccc115df/index.m3u8 -湖南卫视,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226698/1.m3u8 -东南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001201/index.m3u8 -广东卫视,http://cfss.cc/api/ysp/gdws.m3u8 -广西卫视,http://live.gxrb.com.cn/tv/gxtvlive03/index.m3u8 -海南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001183/index.m3u8 -云南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001223/index.m3u8 -贵州卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001184/index.m3u8 -重庆卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001129/index.m3u8 -四川卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001130/index.m3u8 -西藏卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001072/index.m3u8 -青海卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001082/index.m3u8 -新疆卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001065/index.m3u8 -甘肃卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001298/index.m3u8 -宁夏卫视,http://hls.live.cqccn.com/__cl/cg:live/__c/ningxia/__op/default/__f/index.m3u8 -陕西卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001067/index.m3u8 -内蒙古卫视,http://222.175.159.226:808/hls/202366/index.m3u8 -凤凰卫视,http://113.117.74.28:8081/hls/37/index.m3u8 -凤凰资讯,http://[2409:8087:2001:20:2800:0:df6e:eb27]:80/wh7f454c46tw1890984412_1778241929/ott.mobaibox.com/PLTV/3/224/3221228524/index.m3u8?icpid=3&RTS=1674373416&from=40&popid=40&hms_devid=2293&prioritypopid=40&vqe=3 +📺|定期维护,#genre# +2023-11-23,https://vdse.bdstatic.com//13da18e12728e9d7849f6589a3070b4c.mp4 +海阔道长,https://vd2.bdstatic.com/mda-mhhf5mr00yyhpfjs/1080p/cae_h264/1629284581057661229/mda-mhhf5mr00yyhpfjs.mp4 +🌏|电视频道,#genre# +CCTV1,http://angtv.cc/test/lngd.php?id=488 +CCTV2,https://node1.olelive.com:6443/live/CCTV2HD/hls.m3u8 +CCTV3,https://iptv.luas.edu.cn/liverespath/f76f9947c68be18d7a456e25aa59a08c5747e6a5/0df24da9ec-0-0-dca40ddadd2a051ce1a83536d9310820/index.m3u8 +CCTV4,http://cfss.cc/api/ysp/cctv4.m3u8 +CCTV4K,http://cfss.cc/api/ysp/cctv4k.m3u8 +CCTV5,https://node1.olelive.com:6443/live/CCTV5HD/hls.m3u8 +CCTV6,http://cfss.cc/api/ysp/cctv6.m3u8 +CCTV7,http://49.235.110.121:9090/898/peda/bestv.php?id=cctv7hd8m/8000000 +CCTV8,https://node1.olelive.com:6443/live/CCTV8HD/hls.m3u8 +CCTV9,http://cfss.cc/api/ysp/cctv9.m3u8 +CCTV10,http://cfss.cc/api/ysp/cctv10.m3u8 +CCTV11,http://cfss.cc/api/ysp/cctv11.m3u8 +CCTV12,http://cfss.cc/ds/bst.php?id=Cf-13 +CCTV13,https://live-play.cctvnews.cctv.com/cctv/merge_cctv13.m3u8 +CCTV14,http://cyz32.livehbindex.hbcatv.cn/live/8a22035194884b1eb5515aac434c313c.m3u8?bitrate=2300&pt=5 +CCTV15,http://cfss.cc/api/ysp/cctv15.m3u8 +CCTV16,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226825/1.m3u8 +CCTV17,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226727/1.m3u8 +CCTV娱乐,http://line.premiumpowers.net/play/live.php?mac=00:1A:79:73:45:10&extension=ts&stream=156405 +CCTV戏曲,http://line.premiumpowers.net/play/live.php?mac=00:1A:79:73:45:10&extension=ts&stream=156406 +TVB,http://38.64.72.148:80/hls/modn/list/4005/chunklist0.m3u8 +五星体育,https://live.goodiptv.club/api/bestv.php?id=wxtyhd8m/8000000 +咪咕体育,http://[2409:8087:1a01:df::4077]/PLTV/88888888/224/3221225895/index.m3u8 +纬来体育,http://198.16.100.90:8278/videolandsport/playlist.m3u8?tid=MA6A1192684511926845&ct=19226&tsum=0b7ca9a61e7371df68108a27dc358c68 +超级体育,http://[2409:8087:1a01:df::7005]:80/ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221225715/index.m3u8 +精品体育,http://[2409:8087:2001:20:2800:0:df6e:eb1b]:80/wh7f454c46tw2797725038_-2054878207/ott.mobaibox.com/PLTV/3/224/3221227615/index.m3u8 +北京卫视,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226719/1.m3u8 +黑龙江卫视,http://122.224.153.162:9901/tsfile/live/0143_1.m3u8?key=txiptv +吉林卫视,http://jltpc.x3322.net:9901/tsfile/live/0116_1.m3u8?key=txiptv +辽宁卫视,https://iptv.luas.edu.cn/liverespath/73aedb8ffd21b3b8afe4664591d4cb3a5cced827/bdc834c533-0-0-aefef0ed39d19073554f1c7e80a25cbc/index.m3u8 +河北卫视,http://jltpc.x3322.net:9901/tsfile/live/0117_1.m3u8?key=txiptv +山东卫视,https://iptv.luas.edu.cn/liverespath/8b205af319dcc92c60a69a96423af21b24a29ca0/dd6f0a43db-0-0-63f6f29dcc6843fd6b50323d4bfc8b09/index.m3u8 +山西卫视,http://218.17.196.234:9901/tsfile/live/0118_1.m3u8 +天津卫视,http://120.196.232.124:8088/rrs03.hw.gmcc.net/PLTV/651/224/3221226686/1.m3u8 +江苏卫视,https://iptv.luas.edu.cn/liverespath/0be64515076e489456de2f33e7b58ff1b392d3b3/8c0352e42d-0-0-2529f61c8f420136013f1ab8a93169c3/index.m3u8 +安徽卫视,https://iptv.luas.edu.cn/liverespath/6e91e17de838dbf7c77f9ed8e41726bd4a1516f5/494a63d492-0-0-94541fa104bd30ce82410455ab950402/index.m3u8 +江西卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001034/index.m3u8 +浙江卫视,http://hw-m-l.cztv.com/channels/lantian/channel01/1080p.m3u8 +东方卫视,https://iptv.luas.edu.cn/liverespath/4015e6015b3b818a4cbc2247960b8536a3cd0153/0bc51b40df-0-0-23a64a0dc546104d1ba498a41ff49540/index.m3u8 +河南卫视,http://angtv.cc/test/lngd.php?id=339 +湖北卫视,http://113.100.193.10:9901/tsfile/live/0132_1.m3u8 +湖南卫视,http://jltpc.x3322.net:9901/tsfile/live/0117_2.m3u8?key=txiptv +东南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001201/index.m3u8 +广东卫视,https://iptv.luas.edu.cn/liverespath/57e80ee85ec1f4e523e1bca55f5a676abd292db8/0ff9a42344-0-0-0eb4f8fe53cdbc02d1db696ecc425752/index.m3u8 +广东体育,http://gxdl-lhs.8866.org:85/tsfile/live/1001_1.m3u8?key=txiptv&playlive=1&authid=0 +广西卫视,http://live.gxrb.com.cn/tv/gxtvlive03/index.m3u8 +海南卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001183/index.m3u8 +云南卫视,https://iptv.luas.edu.cn/liverespath/d45a277ca433670e3f463b497783af19bb2c63f8/3f1dcf4cf3-0-0-3f0618b5bab73c0ebb1be6c66ccbf65d/index.m3u8 +贵州卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001184/index.m3u8 +重庆卫视,https://iptv.luas.edu.cn/liverespath/b14734af7f740eb61419248c57e25551a7d1093f/5255a86445-0-0-4ce4f2e82145e9bc39b5b4ccd7cce4a0/index.m3u8 +四川卫视,https://iptv.luas.edu.cn/liverespath/ca3f021632b48e6960797776657926074723d276/027c826f0e-0-0-4caf8e44f0157ea591d8857569b9a2c3/index.m3u8 +西藏卫视,http://zteres.sn.chinamobile.com:6060/000000001000/1000000002000015894/1.m3u8?channel-id=ystenlive&Contentid=1000000002000015894&livemode=1&stbId=3 +青海卫视,http://stream.qhbtv.com/qhws/playlist.m3u8 +新疆卫视,http://zteres.sn.chinamobile.com:6060/000000001000/1000000002000029441/1.m3u8?channel-id=ystenlive&Contentid=1000000002000029441&livemode=1&stbId=3 +甘肃卫视,https://iptv.luas.edu.cn/liverespath/975463fd39229112f75925af024d6ed11de84a0e/d46f4f77ca-0-0-3b64a6fd708d6eeeb0e60461ad736b78/index.m3u8 +宁夏卫视,http://[2409:8087:1e03:21::2]:6060/cms001/ch00000090990000001074/index.m3u8 +陕西卫视,https://iptv.luas.edu.cn/liverespath/ebc9ec3e297c071df95d759b6313b9d9dbc3dbda/ef6e859417-0-0-62a8314666ead4b1cf49536375036d60/index.m3u8 +内蒙古卫视,http://222.175.159.226:808/hls/202366/index.m3u8 +凤凰资讯,http://50.7.238.114:8278/phoenixinfo_hd/playlist.m3u8?tid=m7f4a830029be&ct=18336&tsum=74f57bddc0725f74838380086dce3e44 翡翠台,https://sc2022.stream-link.org/tv2306.php?id=h02&checkedby:iptvcat.com \ No newline at end of file diff --git a/js/version.txt b/js/version.txt index 71953ca..857a649 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.49beta18 \ No newline at end of file +3.9.49beta19 \ No newline at end of file diff --git a/txt/hipy/base_spider.py b/txt/hipy/base_spider.py index ca6dec5..83ea4ee 100644 --- a/txt/hipy/base_spider.py +++ b/txt/hipy/base_spider.py @@ -28,22 +28,22 @@ from urllib.parse import quote t4的配置里ext节点会自动变成api对应query参数extend,但t4的ext字符串不支持路径格式,比如./开头或者.json结尾 api里会自动含有ext参数是base64编码后的选中的筛选条件 { - "key":"hipy_t4_base", - "name":"base(hipy_t4)", + "key":"hipy_t4_base_spider", + "name":"base_spider(hipy_t4)", "type":4, "api":"http://192.168.31.49:5707/api/v1/vod/base_spider", "searchable":1, - "quickSearch":1, + "quickSearch":0, "filterable":1, "ext":"base_spider" }, { - "key": "hipy_t3_base", - "name": "base(hipy_t3)", + "key": "hipy_t3_base_spider", + "name": "base_spider(hipy_t3)", "type": 3, "api": "{{host}}/txt/hipy/base_spider.py", "searchable": 1, - "quickSearch": 1, + "quickSearch": 0, "filterable": 1, "ext": "{{host}}/txt/hipy/base_spider.json" }, @@ -379,6 +379,7 @@ class Spider(BaseSpider): # 元类 默认的元类 type if __name__ == '__main__': spider = Spider() spider.init() - spider.init_api_ext_file() # 生成筛选对应的json文件 - - spider.searchContent('斗罗大陆') + # spider.init_api_ext_file() # 生成筛选对应的json文件 + spider.log({'key': 'value'}) + spider.log('====文本内容====') + # spider.searchContent('斗罗大陆') diff --git a/txt/hipy/cctv_spider.json b/txt/hipy/cntv央视.json similarity index 100% rename from txt/hipy/cctv_spider.json rename to txt/hipy/cntv央视.json diff --git a/txt/hipy/cctv_spider.py b/txt/hipy/cntv央视.py similarity index 92% rename from txt/hipy/cctv_spider.py rename to txt/hipy/cntv央视.py index 3271902..2962172 100644 --- a/txt/hipy/cctv_spider.py +++ b/txt/hipy/cntv央视.py @@ -25,37 +25,36 @@ api里会自动含有ext参数是base64编码后的选中的筛选条件 错误示例,ext含有json: { - "key":"hipy_cctv", - "name":"hipy_cctv", + "key":"hipy_cntv央视", + "name":"cntv央视(hipy_t4)", "type":4, - "api":"http://192.168.31.49:5707/api/v1/vod/cctv_spider?api_ext={{host}}/txt/hipy/cctv_spider.json", + "api":"http://192.168.31.49:5707/api/v1/vod/cntv央视?api_ext={{host}}/txt/hipy/cntv央视.json", "searchable":1, "quickSearch":1, - "filterable":1, - "ext":"cctv_spider.json" + "filterable":0, + "ext":"cntv央视.json" } 正确示例。同时存在ext和api_ext会优先取ext作为extend加载init { - "key":"hipy_t4_cctv", - "name":"cctv(hipy_t4)", + "key":"hipy_t4_cntv央视", + "name":"cntv央视(hipy_t4)", "type":4, - "api":"http://192.168.31.49:5707/api/v1/vod/cctv_spider?api_ext={{host}}/txt/hipy/cctv_spider.json", + "api":"http://192.168.31.49:5707/api/v1/vod/cntv央视?api_ext={{host}}/txt/hipy/cntv央视.json", "searchable":1, - "quickSearch":1, + "quickSearch":0, "filterable":1, - "ext":"cctv_spider" - } - + "ext":"cntv央视" + }, { - "key": "hipy_t3_cctv", - "name": "cctv(hipy_t3)", + "key": "hipy_t3_cntv央视", + "name": "cntv央视(hipy_t3)", "type": 3, - "api": "{{host}}/txt/hipy/cctv_spider.py", + "api": "{{host}}/txt/hipy/cntv央视.py", "searchable": 1, - "quickSearch": 1, + "quickSearch": 0, "filterable": 1, - "ext": "{{host}}/txt/hipy/cctv_spider.json" -} + "ext": "{{host}}/txt/hipy/cntv央视.json" +}, """ @@ -246,6 +245,7 @@ class Spider(BaseSpider): # 元类 默认的元类 type def homeContent(self, filter): result = {} cateManual = { + "4K专区": "4K专区", "栏目大全": "栏目大全", "特别节目": "特别节目", "纪录片": "纪录片", @@ -335,6 +335,11 @@ class Spider(BaseSpider): # 元类 默认的元类 type url = 'https://api.cntv.cn/lanmu/columnSearch?&fl={0}&fc={1}&cid={2}&p={3}&n=20&serviceId=tvcctv&t=json&cb=ko'.format( fl, fc, cid, pg) pagecount = 20 + elif tid == '4K专区': + cid = 'CHAL1558416868484111' + url = 'https://api.cntv.cn/NewVideo/getLastVideoList4K?serviceId=cctv4k&cid={0}&p={1}&n={2}&t=json&cb=ko'.format( + cid,pg,pagecount + ) else: url = 'https://tv.cctv.com/epg/index.shtml' @@ -345,6 +350,12 @@ class Spider(BaseSpider): # 元类 默认的元类 type if index > -1: htmlText = htmlText[3:index] videos = self.get_list1(html=htmlText, tid=tid) + elif tid == '4K专区': + index = htmlText.rfind(');') + if index > -1: + htmlText = htmlText[3:index] + videos = self.get_list_4k(html=htmlText, tid=tid) + else: videos = self.get_list(html=htmlText, tid=tid) # print(videos) @@ -378,6 +389,9 @@ class Spider(BaseSpider): # 元类 默认的元类 type topicId) # htmlTxt = self.webReadFile(urlStr=Url, header=self.header) htmlTxt = self.fetch(Url).text + elif tid == "4K专区": + Url = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id={0}&serviceId=cctv4k&p=1&n=100&mode=0&pub=1'.format(id) + print(Url) else: Url = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id={0}&serviceId=tvcctv&p=1&n=100&mode=0&pub=1'.format( id) @@ -397,7 +411,7 @@ class Spider(BaseSpider): # 元类 默认的元类 type if len(videoList) < 1: # htmlTxt = self.webReadFile(urlStr=lastVideo, header=self.header) htmlTxt = self.fetch(lastVideo).text - if tid == "电视剧" or tid == "纪录片": + if tid == "电视剧" or tid == "纪录片" or tid == "4K专区": patternTxt = r"'title':\s*'(?P.+?)',\n{0,1}\s*'brief':\s*'(.+?)',\n{0,1}\s*'img':\s*'(.+?)',\n{0,1}\s*'url':\s*'(?P<url>.+?)'" elif tid == "特别节目": patternTxt = r'class="tp1"><a\s*href="(?P<url>https://.+?)"\s*target="_blank"\s*title="(?P<title>.+?)"></a></div>' @@ -747,22 +761,26 @@ class Spider(BaseSpider): # 元类 默认的元类 type htmlTxt = self.fetch(url).text jo = json.loads(htmlTxt) link = jo['hls_url'].strip() - html = self.webReadFile(urlStr=link, header=self.header) + # 获取域名前缀 + urlPrefix = self.get_RegexGetText(Text=link, RegexText='(http[s]?://[a-zA-z0-9.]+)/', Index=1) + # 域名前缀指定替换,然后可以获取到更高质量的视频列表 + new_link = link.replace(f'{urlPrefix}/asp/hls/', 'https://dh5.cntv.qcloudcdn.com/asp/h5e/hls/').split('?')[0] + html = self.webReadFile(urlStr=new_link, header=self.header) content = html.strip() arr = content.split('\n') - urlPrefix = self.get_RegexGetText(Text=link, RegexText='(http[s]?://[a-zA-z0-9.]+)/', Index=1) subUrl = arr[-1].split('/') - # subUrl[3] = '1200' - subUrl[3] = '2000' - # subUrl[-1] = '1200.m3u8' - subUrl[-1] = '2000.m3u8' - hdUrl = urlPrefix + '/'.join(subUrl) - - url = urlPrefix + arr[-1] + # hdUrl = urlPrefix + arr[-1] + # subUrl[3] = '2000' + # subUrl[-1] = '2000.m3u8' + # hdUrl = urlPrefix + '/'.join(subUrl) + maxVideo = subUrl[-1].replace('.m3u8', '') + hdUrl = link.replace('main', maxVideo) + hdUrl = hdUrl.replace(urlPrefix, 'https://newcntv.qcloudcdn.com') hdRsp = self.TestWebPage(urlStr=hdUrl, header=self.header) if hdRsp == 200: - url = hdUrl + url = hdUrl.split('?')[0] + self.log(f'视频链接: {url}') else: url = '' return url @@ -859,11 +877,45 @@ class Spider(BaseSpider): # 元类 默认的元类 type }) return videos + # 4k分类取结果 + def get_list_4k(self, html, tid): + jRoot = json.loads(html) + videos = [] + data = jRoot['data'] + if data is None: + return [] + jsonList = data['list'] + for vod in jsonList: + vod_remarks = vod['title'] + id = vod['id'] + vod = vod['last_video'] + img = vod['image'] + url = vod['url'] + title = vod['title'] + brief = vod.get('brief') or '' + year = vod.get('year') or '' + actors = vod.get('actors') or '' + if len(url) == 0: + continue + guids = [tid, title, url, img, id, year, actors, brief] + guid = "||".join(guids) + # print(vod_id) + videos.append({ + "vod_id": guid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": vod_remarks + }) + return videos + if __name__ == '__main__': + from t4.core.loader import t4_spider_init + spider = Spider() - spider.init() - spider.init_api_ext_file() + t4_spider_init(spider) + print(spider.homeVideoContent()) + # spider.init_api_ext_file() # url = 'https://api.cntv.cn/lanmu/columnSearch?&fl=&fc=%E6%96%B0%E9%97%BB&cid=&p=1&n=20&serviceId=tvcctv&t=jsonp&cb=Callback' # url = 'https://api.cntv.cn/lanmu/columnSearch?&fl=&fc=&cid=&p=1&n=20&serviceId=tvcctv&t=json&cb=ko' # r = spider.fetch(url) diff --git a/txt/hipy/两个BT.py b/txt/hipy/两个BT.py index e4dde6f..d5ac8a8 100644 --- a/txt/hipy/两个BT.py +++ b/txt/hipy/两个BT.py @@ -496,8 +496,9 @@ class Spider(BaseSpider): # 元类 默认的元类 type if __name__ == '__main__': + from t4.core.loader import t4_spider_init spider = Spider() - spider.init() + t4_spider_init(spider) spider.init_api_ext_file() # 生成筛选对应的json文件 # print(spider.homeVideoContent()) diff --git a/txt/hipy/新浪资源.py b/txt/hipy/新浪资源.py new file mode 100644 index 0000000..b91bba0 --- /dev/null +++ b/txt/hipy/新浪资源.py @@ -0,0 +1,411 @@ +# coding=utf-8 +# !/usr/bin/python +import sys + +sys.path.append('..') +try: + # from base.spider import Spider as BaseSpider + from base.spider import BaseSpider +except ImportError: + from t4.base.spider import BaseSpider +import time +import re +from urllib import request, parse +import urllib +import urllib.request +from xml.etree.ElementTree import fromstring, ElementTree as et + +""" +配置示例: +t4的配置里ext节点会自动变成api对应query参数extend,但t4的ext字符串不支持路径格式,比如./开头或者.json结尾 +api里会自动含有ext参数是base64编码后的选中的筛选条件 + { + "key":"hipy_t4_新浪资源", + "name":"新浪资源(hipy_t4)", + "type":4, + "api":"http://192.168.31.49:5707/api/v1/vod/新浪资源", + "searchable":1, + "quickSearch":0, + "filterable":1, + "ext":"" +}, +{ + "key": "hipy_t3_新浪资源", + "name": "新浪资源(hipy_t3)", + "type": 3, + "api": "{{host}}/txt/hipy/新浪资源.py", + "searchable": 1, + "quickSearch": 0, + "filterable": 1, + "ext": "" +}, +""" + + +class Spider(BaseSpider): # 元类 默认的元类 type + def getName(self): + return "新浪资源" # 除去少儿不宜的内容 + + filterate = False + + def init(self, extend=""): + print("============{0}============".format(extend)) + pass + + def isVideoFormat(self, url): + pass + + def manualVideoCheck(self): + pass + + def homeContent(self, filter): + result = {} + timeClass = time.localtime(time.time()) + cateManual = { + '动漫': '3', + '动漫电影': '17', + '综艺': '4', + '纪录片': '5', + '动作片': '6', + '爱情片': '7', + '科幻片': '8', + '战争片': '9', + '剧情片': '10', + '恐怖片': '11', + '喜剧片': '12', + '大陆剧': '13', + '港澳剧': '14', + '台湾剧': '15', + '欧美剧': '16', + '韩剧': '18', + '日剧': '20', + '泰剧': '21', + '体育': '23' + } + # if timeClass.tm_hour>22: + # cateManual['伦理片']='22' + # self.filterate=False + classes = [] + for k in cateManual: + classes.append({ + 'type_name': k, + 'type_id': cateManual[k] + }) + result['class'] = classes + if (filter): + result['filters'] = self.config['filter'] + return result + + def homeVideoContent(self): + xmlTxt = self.custom_webReadFile( + urlStr='https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/?ac=list&h=24') + tree = et(fromstring(xmlTxt)) + root = tree.getroot() + listXml = root.iter('list') + videos = self.custom_list(html=listXml) + result = { + 'list': videos + } + return result + + def categoryContent(self, tid, pg, filter, extend): + result = {} + videos = [] + pagecount = 1 + limit = 20 + total = 9999 + Url = 'https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/?ac=list&t={0}&pg={1}'.format( + tid, pg) + xmlTxt = self.custom_webReadFile(urlStr=Url) + tree = et(fromstring(xmlTxt)) + root = tree.getroot() + listXml = root.iter('list') + for vod in listXml: + pagecount = vod.attrib['pagecount'] + limit = vod.attrib['pagesize'] + total = vod.attrib['recordcount'] + videos = self.custom_list(html=root.iter('list')) + result['list'] = videos + result['page'] = pg + result['pagecount'] = pagecount + result['limit'] = limit + result['total'] = total + return result + + def detailContent(self, array): + result = {} + aid = array[0].split('###') + id = aid[1] + logo = aid[2] + title = aid[0] + vod_play_from = ['播放线路', ] + vod_year = '' + vod_actor = '' + vod_content = '' + vod_director = '' + type_name = '' + vod_area = '' + vod_lang = '' + vodItems = [] + vod_play_url = [] + try: + url = 'https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/?ac=detail&ids=' + id + xmlTxt = self.custom_webReadFile(urlStr=url) + jRoot = et(fromstring(xmlTxt)) + xmlList = jRoot.iter('list') + for vod in xmlList: + for x in vod: + for v in x: + if v.tag == 'actor': + vod_actor = v.text + if v.tag == 'director': + vod_director = v.text + if v.tag == 'des': + vod_content = v.text + if v.tag == 'area': + vod_area = v.text + if v.tag == 'year': + vod_year = v.text + if v.tag == 'type': + type_name = v.text + if v.tag == 'lang': + vod_lang = v.text + + temporary = self.custom_RegexGetText(Text=xmlTxt, RegexText=r'<dd flag="xlyun">(.+?)</dd>', Index=1) + temporary = temporary.replace('<![CDATA[', '').replace(']]>', '') + vodItems = self.custom_EpisodesList(temporary) + joinStr = "#".join(vodItems) + vod_play_url.append(joinStr) + except: + pass + vod = { + "vod_id": array[0], + "vod_name": title, + "vod_pic": logo, + "type_name": type_name, + "vod_year": vod_year, + "vod_area": vod_area, + "vod_remarks": vod_lang, + "vod_actor": vod_actor, + "vod_director": vod_director, + "vod_content": vod_content + } + vod['vod_play_from'] = "$$$".join(vod_play_from) + vod['vod_play_url'] = "$$$".join(vod_play_url) + result = { + 'list': [ + vod + ] + } + if self.filterate == True and self.custom_RegexGetText(Text=type_name, RegexText=r'(伦理|倫理|福利)', + Index=1) != '': + result = {'list': []} + return result + + def searchContent(self, key, quick, pg=1): + Url = 'https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/?ac=list&wd={0}&pg={1}'.format( + urllib.parse.quote(key), '1') + xmlTxt = self.custom_webReadFile(urlStr=Url) + tree = et(fromstring(xmlTxt)) + root = tree.getroot() + listXml = root.iter('list') + videos = self.custom_list(html=listXml) + result = { + 'list': videos + } + return result + + def playerContent(self, flag, id, vipFlags): + result = {} + parse = 1 + url = id + htmlTxt = self.custom_webReadFile(urlStr=url, header=self.header) + url = self.custom_RegexGetText(Text=htmlTxt, RegexText=r'(https{0,1}://.+?\.m3u8)', Index=1) + if url.find('.m3u8') < 1: + url = id + parse = 0 + result["parse"] = parse # 0=直接播放、1=嗅探 + result["playUrl"] = '' + result["url"] = url + result['jx'] = 0 # VIP解析,0=不解析、1=解析 + result["header"] = '' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self, param): + return [200, "video/MP2T", action, ""] + + # -----------------------------------------------自定义函数----------------------------------------------- + # 正则取文本 + def custom_RegexGetText(self, Text, RegexText, Index): + returnTxt = "" + Regex = re.search(RegexText, Text, re.M | re.S) + if Regex is None: + returnTxt = "" + else: + returnTxt = Regex.group(Index) + return returnTxt + + # 分类取结果 + def custom_list(self, html): + ListRe = html + videos = [] + temporary = [] + for vod in ListRe: + for value in vod: + for x in value: + + if x.tag == 'name': + title = x.text + if x.tag == 'id': + id = x.text + if x.tag == 'type': + tid = x.text + if x.tag == 'last': + last = x.text + temporary.append({ + "name": title, + "id": id, + "last": last + }) + + if len(temporary) > 0: + idTxt = '' + for vod in temporary: + idTxt = idTxt + vod['id'] + ',' + if len(idTxt) > 1: + idTxt = idTxt[0:-1] + url = 'https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/?ac=detail&ids=' + idTxt + xmlTxt = self.custom_webReadFile(urlStr=url) + jRoot = et(fromstring(xmlTxt)) + xmlList = jRoot.iter('list') + for vod in xmlList: + for x in vod: + for v in x: + if v.tag == 'name': + title = v.text + if v.tag == 'id': + vod_id = v.text + if v.tag == 'pic': + img = v.text + if v.tag == 'note': + remarks = v.text + if v.tag == 'year': + vod_year = v.text + if v.tag == 'type': + type_name = v.text + if self.filterate == True and self.custom_RegexGetText(Text=type_name, + RegexText=r'(伦理|倫理|福利)', + Index=1) != '': + continue + vod_id = '{0}###{1}###{2}'.format(title, vod_id, img) + # vod_id='{0}###{1}###{2}###{3}###{4}###{5}###{6}###{7}###{8}###{9}###{10}'.format(title,vod_id,img,vod_actor,vod_director,'/'.join(type_name),'/'.join(vod_time),'/'.join(vod_area),vod_lang,vod_content,vod_play_url) + # print(vod_id) + videos.append({ + "vod_id": vod_id, + "vod_name": title, + "vod_pic": img, + "vod_year": vod_year, + "vod_remarks": remarks + }) + return videos + + # 访问网页 + def custom_webReadFile(self, urlStr, header=None, codeName='utf-8'): + html = '' + if header == None: + header = { + "Referer": urlStr, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36', + "Host": self.custom_RegexGetText(Text=urlStr, RegexText='https*://(.*?)(/|$)', Index=1) + } + # import ssl + # ssl._create_default_https_context = ssl._create_unverified_context#全局取消证书验证 + req = urllib.request.Request(url=urlStr, headers=header) # ,headers=header + with urllib.request.urlopen(req) as response: + html = response.read().decode(codeName) + return html + + # 取剧集区 + def custom_lineList(self, Txt, mark, after): + circuit = [] + origin = Txt.find(mark) + while origin > 8: + end = Txt.find(after, origin) + circuit.append(Txt[origin:end]) + origin = Txt.find(mark, end) + return circuit + + # 正则取文本,返回数组 + def custom_RegexGetTextLine(self, Text, RegexText, Index): + returnTxt = [] + pattern = re.compile(RegexText, re.M | re.S) + ListRe = pattern.findall(Text) + if len(ListRe) < 1: + return returnTxt + for value in ListRe: + returnTxt.append(value) + return returnTxt + + # 取集数 + def custom_EpisodesList(self, html): + ListRe = html.split('#') + videos = [] + for vod in ListRe: + t = vod.split('$') + url = t[1] + title = t[0] + if len(url) == 0: + continue + videos.append(title + "$" + url) + return videos + + # 取分类 + def custom_classification(self): + xmlTxt = self.custom_webReadFile( + urlStr='https://api.xinlangapi.com/xinlangapi.php/provide/vod/from/xlyun/at/xml/') + tree = et(fromstring(xmlTxt)) + root = tree.getroot() + classXml = root.iter('class') + temporaryClass = {} + for vod in classXml: + for value in vod: + if self.custom_RegexGetText(Text=value.text, RegexText=r'(福利|倫理片|伦理片)', Index=1) != '': + continue + temporaryClass[value.text] = value.attrib['id'] + print("'{0}':'{1}',".format(value.text, value.attrib['id'])) + return temporaryClass + +if __name__ == '__main__': + from t4.core.loader import t4_spider_init + spider = Spider() + t4_spider_init(spider) + print(spider.homeContent(True)) + print(spider.homeVideoContent()) + +# T=Spider() +# T. homeContent(filter=False) +# T.custom_classification() +# l=T.homeVideoContent() +# l=T.searchContent(key='柯南',quick='') +# l=T.categoryContent(tid='22',pg='1',filter=False,extend={}) +# for x in l['list']: +# print(x['vod_name']) +# mubiao= l['list'][2]['vod_id'] +# # print(mubiao) +# playTabulation=T.detailContent(array=[mubiao,]) +# # print(playTabulation) +# vod_play_from=playTabulation['list'][0]['vod_play_from'] +# vod_play_url=playTabulation['list'][0]['vod_play_url'] +# url=vod_play_url.split('$$$') +# vod_play_from=vod_play_from.split('$$$')[0] +# url=url[0].split('$') +# url=url[1].split('#')[0] +# # print(url) +# m3u8=T.playerContent(flag=vod_play_from,id=url,vipFlags=True) +# print(m3u8) diff --git a/txt/hipy/樱花动漫.py b/txt/hipy/樱花动漫.py index aa88707..32f3a31 100644 --- a/txt/hipy/樱花动漫.py +++ b/txt/hipy/樱花动漫.py @@ -26,7 +26,7 @@ api里会自动含有ext参数是base64编码后的选中的筛选条件 "type":4, "api":"http://192.168.31.49:5707/api/v1/vod/樱花动漫", "searchable":1, - "quickSearch":1, + "quickSearch":0, "filterable":1, "ext":"https://jihulab.com/qiaoji/open/-/raw/main/yinghua" }, @@ -360,15 +360,15 @@ if __name__ == '__main__': # 在线aes测试 https://config.net.cn/tools/AES.html # 分类页:http://60.204.185.245:7090/appto/v1/home/cateData?id=1 # 推荐页:http://60.204.185.245:7090/appto/v1/config/get?p=android + from t4.core.loader import t4_spider_init spider = Spider() - # spider.init('https://jihulab.com/qiaoji/open/-/raw/main/yinghua') - spider.init() + t4_spider_init(spider,'https://jihulab.com/qiaoji/open/-/raw/main/yinghua') # spider.init_api_ext_file() # 生成筛选对应的json文件 # print(spider.homeContent(True)) # print(spider.homeVideoContent()) # print(spider.categoryContent('1', 1, True, {'year': '2024'})) # print(spider.detailContent([110078])) - # print(spider.searchContent('斗罗大陆')) + print(spider.searchContent('斗罗大陆')) # print(spider.playerContent(None, 'f1d7d074f624e993e425f|11d1d091b0b28|31613145e4a7c|518737c8650978', None)) # spider.searchContent('斗罗大陆')