diff --git a/9918.json b/9918.json index fe6dfd59..b4393c0e 100644 --- a/9918.json +++ b/9918.json @@ -18,8 +18,6 @@ {"key":"泥巴","name":"泥巴","type":3,"api":"csp_NiNi","searchable":1,"ext":"1;socks5://192.168.1.9:4592"}, {"key":"量子","name":"量子","type":0,"api":"http://127.0.0.1:10079/?thread=0&proxy=socks5://192.168.1.9:4592&url=https://cj.lziapi.com/api.php/provide/vod/at/xml/","playUrl": "json:http://127.0.0.1:10079/parse/?thread=0&proxy=socks5://192.168.1.9:4592&url=","searchable":1,"changeable":1,"categories":["伦理片"]}, {"key":"非凡","name":"非凡","type":0,"api":"http://127.0.0.1:10079/?thread=0&proxy=socks5://192.168.1.9:4592&url=http://cj.ffzyapi.com/api.php/provide/vod/at/xml/","playUrl": "json:http://127.0.0.1:10079/parse/?thread=0&proxy=socks5://192.168.1.9:4592&url=","searchable":1,"changeable":1,"categories":["伦理片"]}, -{"key":"磁力转点播","name":"磁力转点播","type":3,"api":"./lib/live2cms1.js","searchable":2,"quickSearch":0,"timeout":60,"filterable":0,"ext":"./js/live2cms.json"}, -{"key":"直播转点播","name":"直播转点播","type":3,"api":"./lib/live2cms1.js","searchable":2,"quickSearch":0,"timeout":60,"filterable":0,"ext":"./js/live2mv_data1.json"}, {"key":"csp_JavBus","name":"JavBus","type":3,"api":"csp_JavBus","searchable":1,"quickSearch":1,"filterable":1,"changeable":0,"style":{"type":"rect","ratio":1.77},"ext":"$$$socks5://192.168.1.9:4592","timeout":60}, {"key":"csp_JavDb","name":"JavDb","type":3,"api":"csp_JavDb","searchable":1,"quickSearch":1,"filterable":1,"changeable":0,"style":{"type":"rect","ratio":1.77},"ext":"$$$socks5://192.168.1.9:4592","timeout":60}, {"key":"玩偶","name":"玩偶","type":3,"api":"csp_Doll","searchable":1,"style":{"type":"rect","ratio":1.309},"ext":"$$$socks5://192.168.1.9:4592"}, diff --git a/js/live2cms.json b/js/live2cms.json deleted file mode 100644 index 093c6bbe..00000000 --- a/js/live2cms.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "name": "AV", - "type": 0, - "url": "https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/json/AV.txt" - } -] \ No newline at end of file diff --git a/js/live2mv_data.json b/js/live2mv_data.json index f27b9794..7fa390a5 100644 --- a/js/live2mv_data.json +++ b/js/live2mv_data.json @@ -1,5 +1,5 @@ [ -{"name":"初秋语•综合","url":"../list.txt"}, +{"name":"初秋语•综合","url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/list.txt"}, {"name":"YanG•综合","url":"https://ghproxy.com/https://raw.githubusercontent.com/YanG-1989/m3u/main/Gather.m3u"}, {"name":"范明明•综合","url":"https://ghproxy.com/https://raw.githubusercontent.com/fanmingming/live/main/tv/m3u/global.m3u"}, {"name":"YueChan•综合","url":"https://ghproxy.com/https://raw.githubusercontent.com/YueChan/Live/main/IPTV.m3u"}, @@ -7,13 +7,11 @@ {"name":"饭太硬•综合","url":"https://agit.ai/fantaiying/0/raw/branch/main/tvlive.txt"}, {"name":"Ray•综合","url":"https://xhdwc.tk/tvlive.txt"}, {"name":"俊于•综合","url":"http://home.jundie.top:81/Cat/tv/live.txt"}, -{"name":"初秋语•电台","url":"../radio.txt"}, +{"name":"初秋语•电台","url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/radio.txt"}, {"name":"范明明•电台","url":"https://ghproxy.com/https://raw.githubusercontent.com/fanmingming/live/main/radio/m3u/index.m3u"}, -{"name":"YanG•斗鱼","url":"https://ghproxy.com/https://raw.githubusercontent.com/YanG-1989/m3u/main/yu.m3u"}, -{"name":"YanG•虎牙","url":"https://ghproxy.com/https://raw.githubusercontent.com/YanG-1989/m3u/main/ya.m3u"}, {"name":"肥羊•斗鱼","url":"https://ghproxy.com/https://raw.githubusercontent.com/Ftindy/IPTV-URL/main/douyuyqk.m3u"}, {"name":"肥羊•虎牙","url":"https://ghproxy.com/https://raw.githubusercontent.com/Ftindy/IPTV-URL/main/huyayqk.m3u"}, {"name":"肥羊•YY","url":"https://ghproxy.com/https://raw.githubusercontent.com/Ftindy/IPTV-URL/main/yylunbo.m3u"}, -{"name":"初秋语•哔哩","url":"../bili.m3u"}, +{"name":"初秋语•哔哩","url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/bili.m3u"}, {"name":"YuanHsing•油管","url":"https://ghproxy.com/https://raw.githubusercontent.com/YuanHsing/YouTube_to_m3u/main/youtube.m3u"} ] \ No newline at end of file diff --git a/js/live2mv_data1.json b/js/live2mv_data1.json deleted file mode 100644 index 4d6c9d14..00000000 --- a/js/live2mv_data1.json +++ /dev/null @@ -1,7 +0,0 @@ -[ -{"name":"初秋语","type": 0,"url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/list.txt"}, -{"name":"YanG","type": 0,"url":"https://ghproxy.com/https://raw.githubusercontent.com/YanG-1989/m3u/main/Adult.m3u"}, -{"name":"atsushi","type": 1,"url":"https://ghproxy.com/https://raw.githubusercontent.com/atsushi444/iptv-epg/main/Adult.m3u"}, -{"name":"AV集","type": 1,"url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/livex.txt"}, -{"name":"磁力AV","type": 0,"url":"https://ghproxy.com/https:/raw.githubusercontent.com/gaotianliuyun/gao/master/json/AV.txt"} -] \ No newline at end of file diff --git a/lib/live2cms.js b/lib/live2cms.js index 48606d03..c3e46640 100644 --- a/lib/live2cms.js +++ b/lib/live2cms.js @@ -25,7 +25,7 @@ const VERSION = 'live2cms 20230619'; const UA = 'Mozilla/5.0'; //默认请求ua const __ext = {data_dict:{}}; const tips = `\n道长直播转点播js-当前版本${VERSION}`; -const def_pic = 'https://avatars.githubusercontent.com/u/97389433?s=120&v=4'; +const def_pic = 'https://avatars.githubusercontent.com/u/58679624?s=96&v=4'; /** * 存在数据库配置表里, key字段对应值value,没有就新增,有就更新,调用此方法会清除key对应的内存缓存 diff --git a/lib/live2cms1.js b/lib/live2cms1.js deleted file mode 100644 index 58181e46..00000000 --- a/lib/live2cms1.js +++ /dev/null @@ -1,309 +0,0 @@ -/** - * live2cms.js - * 配置设置 {"key":"Live2CMS","name":"磁力直播转点播V2","type":3,"api":"{{host}}/libs/live2cms.js","searchable":2,"quickSearch":0,"filterable":0,"ext":"{{host}}/txt/json/live2mv_data.json"} - * live2mv_data.json -[ -{"name": "甜蜜", "url": "./40136.txt"}, -{"name": "巧计", "url": "./40144.txt"}, -{"name": "星辰", "url": "./40152.txt"}, -{"name": "俊于", "url": "./40160.txt"}, -{"name": "多多", "url": "./40168.txt"}, -{"name": "菜妮丝", "url": "./40176.txt"}, -{"name": "乱世", "url": "./40184.txt"}, -{"name": "吾爱", "url": "./40192.txt"}, -{"name": "饭太硬", "url": "./40200.txt"} -] - - * 提示 ext文件格式为json列表,name,url参数 - * 取消加密,减少性能问题 - */ -String.prototype.rstrip = function (chars) { - let regex = new RegExp(chars + "$"); - return this.replace(regex, ""); -}; -const request_timeout = 5000; -const VERSION = '影视天下第一'; -const UA = 'Mozilla/5.0'; //默认请求ua -const __ext = {data_dict:{}}; -const tips = `\n蜂蜜🍯大屌-${VERSION}`; -const def_pic = 'https://avatars.githubusercontent.com/u/97389433?s=120&v=4'; -/** - * 打印日志 - * @param any 任意变量 - */ -function print(any){ - any = any||''; - if(typeof(any)=='object'&&Object.keys(any).length>0){ - try { - any = JSON.stringify(any); - console.log(any); - }catch (e) { - // console.log('print:'+e.message); - console.log(typeof(any)+':'+any.length); - } - }else if(typeof(any)=='object'&&Object.keys(any).length<1){ - console.log('null object'); - }else{ - console.log(any); - } -} - -/*** js自封装的方法 ***/ - -/** - * 获取链接的host(带http协议的完整链接) - * @param url 任意一个正常完整的Url,自动提取根 - * @returns {string} - */ -function getHome(url){ - if(!url){ - return '' - } - let tmp = url.split('//'); - url = tmp[0] + '//' + tmp[1].split('/')[0]; - try { - url = decodeURIComponent(url); - }catch (e) {} - return url -} - -const http = function (url, options = {}) { - if(options.method ==='POST' && options.data){ - options.body = JSON.stringify(options.data); - options.headers = Object.assign({'content-type':'application/json'}, options.headers); - } - options.timeout = request_timeout; - if(!options.headers){ - options.headers = {}; - } - let keys = Object.keys(options.headers).map(it=>it.toLowerCase()); - if(!keys.includes('referer')){ - options.headers['Referer'] = getHome(url); - } - if(!keys.includes('user-agent')){ - options.headers['User-Agent'] = UA; - } - console.log(JSON.stringify(options.headers)); - try { - const res = req(url, options); - // if(options.headers['Authorization']){ - // console.log(res.content); - // } - res.json = () => res&&res.content ? JSON.parse(res.content) : null; - res.text = () => res&&res.content ? res.content:''; - return res - }catch (e) { - return { - json() { - return null - }, text() { - return '' - } - } - } -}; -["get", "post"].forEach(method => { - http[method] = function (url, options = {}) { - return http(url, Object.assign(options, {method: method.toUpperCase()})); - } -}); - -function init(ext) { - console.log("当前版本号:"+VERSION); - let data; - if (typeof ext == 'object'){ - data = ext; - print('live ext:object'); - } else if (typeof ext == 'string') { - if (ext.startsWith('http')) { - let ext_paramas = ext.split(';'); - let data_url = ext_paramas[0]; - print(data_url); - data = http.get(data_url).json(); - } - } - print(data); - __ext.data = data; - print('init执行完毕'); -} - -function home(filter) { - let classes = __ext.data.map(it => ({ - type_id: it.url, - type_name: it.name, - })); - print("----home----"); - print(classes); - return JSON.stringify({ 'class': classes}); -} - -function homeVod(params) { - let _get_url = __ext.data[0].url; - let html = http.get(_get_url).text(); - let arr = html.match(/.*?,#[\s\S].*?#/g); - let _list = []; - try { - arr.forEach(it=>{ - _list.push({ - vod_name:it.split(',')[0], - vod_id:_get_url+'$'+it.split(',')[0], - vod_pic:def_pic, - vod_remarks:it.split(',')[1], - }); - }); - }catch (e) { - print('Live2cms获取首页推荐发送错误:'+e.message); - } - return JSON.stringify({ 'list': _list }); -} - -function category(tid, pg, filter, extend) { - let _get_url = tid; - let html; - if(__ext.data_dict[_get_url]){ - html = __ext.data_dict[_get_url]; - }else{ - html = http.get(_get_url).text(); - __ext.data_dict[_get_url] = html; - } - let arr = html.match(/.*?,#[\s\S].*?#/g); - let _list = []; - try { - arr.forEach(it=>{ - _list.push({ - vod_name:it.split(',')[0], - vod_id:_get_url+'$'+it.split(',')[0], - vod_pic:def_pic, - vod_remarks:it.split(',')[1], - }); - }); - }catch (e) { - print('Live2cms获取一级分类页发生错误:'+e.message); - } - - return JSON.stringify({ - 'page': 1, - 'pagecount': 1, - 'limit': _list.length, - 'total': _list.length, - 'list': _list, - }); -} - -function detail(tid) { // ⛵ 港•澳•台 - let _get_url = tid.split('$')[0]; - let _tab = tid.split('$')[1]; - if(tid.includes('#search#')){ - let vod_play_url = _tab.replace('#search#','')+'$'+_get_url; - print(vod_play_url); - return JSON.stringify({ - list: [{ - vod_id: tid, - vod_name: '搜索:'+_tab.replace('#search#',''), - type_name: "屌咔咪-失效不补-爱用不用。", - vod_pic: def_pic, - vod_content: tid, - vod_play_from: '来自搜索', - vod_play_url: vod_play_url, - vod_director: tips, - vod_remarks: `蜂蜜🍯大屌-${VERSION}`, - }] - }); - } - let html; - if(__ext.data_dict[_get_url]){ - html = __ext.data_dict[_get_url]; - }else{ - html = http.get(_get_url).text(); - __ext.data_dict[_get_url] = html; - } - let a = new RegExp(`.*?${_tab},#[\\s\\S].*?#`); - let b = html.match(a)[0]; - let c = html.split(b)[1]; - if(c.match(/.*?,#[\s\S].*?#/)){ - let d = c.match(/.*?,#[\s\S].*?#/)[0]; - c = c.split(d)[0]; - } - let arr = c.trim().split('\n'); - let _list = []; - arr.forEach((it)=>{ - if(it.trim()){ - let t = it.trim().split(',')[0]; - let u = it.trim().split(',')[1]; - _list.push(t+'$'+u); - } - }); - let vod_name = __ext.data.find(x=>x.url===_get_url).name; - let vod_play_url = _list.join('#'); - - let vod = { - vod_id: tid, - vod_name: vod_name+'|'+_tab, - type_name: "屌咔咪-失效不补-爱用不用。", - vod_pic: def_pic, - vod_content: tid, - vod_play_from: vod_name, - vod_play_url: vod_play_url, - vod_director: tips, - vod_remarks: `蜂蜜🍯大屌-${VERSION}`, - }; - - return JSON.stringify({ - list: [vod] - }); -} - -function play(flag, id, flags) { - let vod = { - 'parse': /m3u8/.test(id)?0:1, - 'playUrl': '', - 'url': id - }; - print(vod); - return JSON.stringify(vod); -} - -function search(wd, quick) { - let _get_url = __ext.data[0].url; - let html; - if(__ext.data_dict[_get_url]){ - html = __ext.data_dict[_get_url]; - }else{ - html = http.get(_get_url).text(); - __ext.data_dict[_get_url] = html; - } - let str=''; - Object.keys(__ext.data_dict).forEach(()=>{ - str+=__ext.data_dict[_get_url]; - }); - let links = str.split('\n').filter(it=>it.trim() && it.includes(',')); - links = links.map(it=>it.trim()); - let plays = Array.from(new Set(links)); - print('搜索关键词:'+wd); - print('过滤前:'+plays.length); - plays = plays.filter(it=>it.includes(wd)); - print('过滤后:'+plays.length); - print(plays); - let _list = []; - plays.forEach((it)=>{ - _list.push({ - 'vod_name':it.split(',')[0], - 'vod_id':it.split(',')[1].trim()+'$'+it.split(',')[0].trim()+'#search#', - 'vod_pic':def_pic, - }) - }); - return JSON.stringify({ - 'list': _list - }); -} - -// 导出函数对象 -export default { - init: init, - home: home, - homeVod: homeVod, - category: category, - detail: detail, - play: play, - search: search -} \ No newline at end of file