diff --git a/js/4khdr.js b/js/4khdr.js index 2c1da8fc..99159cb5 100644 --- a/js/4khdr.js +++ b/js/4khdr.js @@ -37,76 +37,52 @@ var rule = { tabs:`js: pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; TABS=[] -// log("4khdr 二级 html>>>>>>>>>>" + html); -var d = pdfa(html, 'table.t_table'); -let magnetIndex=0; -let aliIndex=0; +let d = pdfa(html, 'table.t_table'); +let aliIndex=1; d.forEach(function(it) { -let burl = pdfh(it, 'a&&href'); -log("burl >>>>>>" + burl); -if (burl.startsWith("https://www.aliyundrive.com/s/")){ - let result = 'aliyun' + aliIndex; - aliIndex = aliIndex + 1; - TABS.push(result); -} + let burl = pdfh(it, 'a&&href'); + log("burl >>>>>>" + burl); + if (burl.startsWith("https://www.aliyundrive.com/s/")){ + TABS.push("aliyun"+aliIndex); + aliIndex = aliIndex + 1; + } }); -d.forEach(function(it) { -let burl = pdfh(it, 'a&&href'); -log("burl >>>>>>" + burl); -if (burl.startsWith("magnet")){ - let result = 'magnet' + magnetIndex; - magnetIndex = magnetIndex + 1; - TABS.push(result); +d = pdfa(html, 'table.t_table a[href^="magnet"]'); +if (d.length>0){ + TABS.push("磁力"); } -}); log('4khdr TABS >>>>>>>>>>>>>>>>>>' + TABS); `, lists:`js: log(TABS); pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; LISTS = []; -var d = pdfa(html, 'table.t_table'); -TABS.forEach(function(tab) { -log('tab >>>>>>>>' + tab); -if (/^aliyun/.test(tab)) { - let targetindex = parseInt(tab.substring(6)); - let index = 0; - d.forEach(function(it){ - let burl = pdfh(it, 'a&&href'); - if (burl.startsWith("https://www.aliyundrive.com/s/")){ - if (index == targetindex){ - let title = pdfh(it, 'a&&Text'); - log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl); - log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } - }); -} +let d = pdfa(html, 'table.t_table'); +d.forEach(function(it){ + let burl = pdfh(it, 'a&&href'); + if (burl.startsWith("https://www.aliyundrive.com/s/")){ + let title = pdfh(it, 'a&&Text'); + log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl); + log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + LISTS.push([loopresult]); + } }); -TABS.forEach(function(tab) { -log('tab >>>>>>>>' + tab); -if (/^magnet/.test(tab)) { - let targetindex = parseInt(tab.substring(6)); - let index = 0; - d.forEach(function(it){ - let burl = pdfh(it, 'a&&href'); - if (burl.startsWith("magnet")){ - if (index == targetindex){ - let title = pdfh(it, 'a&&Text'); - log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } - }); -} +let listm = []; +d.forEach(function(it){ + let burl = pdfh(it, 'a&&href'); + if (burl.startsWith("magnet")){ + let title = pdfh(it, 'a&&Text'); + log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + listm.push(loopresult); + } }); +if (listm.length>0){ + LISTS.push(listm); +} `, }, diff --git a/js/cilixiong.js b/js/cilixiong.js new file mode 100644 index 00000000..0d73136b --- /dev/null +++ b/js/cilixiong.js @@ -0,0 +1,63 @@ +var rule = { + title:'磁力熊[磁]', + //host:'https://www.cilixiong.com', + //homeUrl:'/', + //url: '/fyclassfyfilter-(fypage-1).html', + host:'http://127.0.0.1:10079', + homeUrl:'/p/0/socks5%253A%252F%252F192.168.101.1%253A1080/https://www.cilixiong.com', + url:'/p/0/socks5%253A%252F%252F192.168.101.1%253A1080/https://www.cilixiong.com/fyclassfyfilter-(fypage-1).html', + filter_url:'-{{fl.class or "0"}}-{{fl.area or "0"}}', + filter:{ + "1":[{"key":"class","name":"类型","value":[{"n":"全部","v":"0"},{"n":"剧情","v":"1"},{"n":"喜剧","v":"2"},{"n":"惊悚","v":"3"},{"n":"动作","v":"4"},{"n":"爱情","v":"5"},{"n":"犯罪","v":"6"},{"n":"恐怖","v":"7"},{"n":"冒险","v":"8"},{"n":"悬疑","v":"9"},{"n":"科幻","v":"10"},{"n":"家庭","v":"11"},{"n":"奇幻","v":"12"},{"n":"动画","v":"13"},{"n":"战争","v":"14"},{"n":"历史","v":"15"},{"n":"传记","v":"16"},{"n":"音乐","v":"17"},{"n":"歌舞","v":"18"},{"n":"运动","v":"19"},{"n":"西部","v":"20"},{"n":"灾难","v":"21"},{"n":"古装","v":"22"},{"n":"情色","v":"23"},{"n":"同性","v":"24"},{"n":"儿童","v":"25"},{"n":"纪录片","v":"26"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"0"},{"n":"大陆","v":"1"},{"n":"香港","v":"2"},{"n":"台湾","v":"3"},{"n":"美国","v":"4"},{"n":"日本","v":"5"},{"n":"韩国","v":"6"},{"n":"英国","v":"7"},{"n":"法国","v":"8"},{"n":"德国","v":"9"},{"n":"印度","v":"10"},{"n":"泰国","v":"11"},{"n":"丹麦","v":"12"},{"n":"瑞典","v":"13"},{"n":"巴西","v":"14"},{"n":"加拿大","v":"15"},{"n":"俄罗斯","v":"16"},{"n":"意大利","v":"17"},{"n":"比利时","v":"18"},{"n":"爱尔兰","v":"19"},{"n":"西班牙","v":"20"},{"n":"澳大利亚","v":"21"},{"n":"波兰","v":"22"},{"n":"土耳其","v":"23"},{"n":"越南","v":"24"}]}], + "2":[{"key":"class","name":"类型","value":[{"n":"全部","v":"0"},{"n":"剧情","v":"1"},{"n":"喜剧","v":"2"},{"n":"惊悚","v":"3"},{"n":"动作","v":"4"},{"n":"爱情","v":"5"},{"n":"犯罪","v":"6"},{"n":"恐怖","v":"7"},{"n":"冒险","v":"8"},{"n":"悬疑","v":"9"},{"n":"科幻","v":"10"},{"n":"家庭","v":"11"},{"n":"奇幻","v":"12"},{"n":"动画","v":"13"},{"n":"战争","v":"14"},{"n":"历史","v":"15"},{"n":"传记","v":"16"},{"n":"音乐","v":"17"},{"n":"歌舞","v":"18"},{"n":"运动","v":"19"},{"n":"西部","v":"20"},{"n":"灾难","v":"21"},{"n":"古装","v":"22"},{"n":"情色","v":"23"},{"n":"同性","v":"24"},{"n":"儿童","v":"25"},{"n":"纪录片","v":"26"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"0"},{"n":"大陆","v":"1"},{"n":"香港","v":"2"},{"n":"台湾","v":"3"},{"n":"美国","v":"4"},{"n":"日本","v":"5"},{"n":"韩国","v":"6"},{"n":"英国","v":"7"},{"n":"法国","v":"8"},{"n":"德国","v":"9"},{"n":"印度","v":"10"},{"n":"泰国","v":"11"},{"n":"丹麦","v":"12"},{"n":"瑞典","v":"13"},{"n":"巴西","v":"14"},{"n":"加拿大","v":"15"},{"n":"俄罗斯","v":"16"},{"n":"意大利","v":"17"},{"n":"比利时","v":"18"},{"n":"爱尔兰","v":"19"},{"n":"西班牙","v":"20"},{"n":"澳大利亚","v":"21"},{"n":"波兰","v":"22"},{"n":"土耳其","v":"23"},{"n":"越南","v":"24"}]}] + }, + searchUrl: '/p/0/socks5%253A%252F%252F192.168.101.1%253A1080/https://www.cilixiong.com/e/search/index.php#classid=1,2&show=title&tempid=1&keyboard=**;post', + searchable:0, + quickSearch:0, + filterable:1, + headers:{ + 'User-Agent': 'MOBILE_UA' + }, + timeout:5000, + class_name:'电影&剧集&豆瓣电影Top250&IMDB Top250&高分悬疑片&高分喜剧片&高分传记片&高分爱情片&高分犯罪片&高分恐怖片&高分冒险片&高分武侠片&高分奇幻片&高分历史片&高分战争片&高分歌舞片&高分灾难片&高分情色片&高分西部片&高分音乐片&高分科幻片&高分动作片&高分动画片&高分纪录片&冷门佳片', + class_url:'1&2&/top250/&/s/imdbtop250/&/s/suspense/&/s/comedy/&/s/biopic/&/s/romance/&/s/crime/&/s/horror/&/s/adventure/&/s/martial/&/s/fantasy/&/s/history/&/s/war/&/s/musical/&/s/disaster/&/s/erotic/&/s/west/&/s/music/&/s/sci-fi/&/s/action/&/s/animation/&/s/documentary/&/s/unpopular/', + play_parse:false, + lazy:'', + limit:6, + 推荐: `js: + pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; + var d = []; + var html = request(input); + var list = pdfa(html, 'body&&.col'); + list.forEach(it => { + d.push({ + title: pdfh(it, 'h2&&Text'), + desc: pdfh(it, '.me-auto&&Text') + '分 / ' + pdfh(it, '.small&&Text'), + pic_url: pd(it, '.card-img&&style'), + url: pd(it, 'a&&href') + }); + }) + setResult(d); + `, + 一级: `js: + pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; + var d = []; + if (MY_CATE !== '1' && MY_CATE !== '2') { + let turl = (MY_PAGE === 1)? 'index' : 'index_'+ MY_PAGE; + input = rule.homeUrl + MY_CATE + turl + '.html'; + } + var html = request(input); + var list = pdfa(html, 'body&&.col'); + list.forEach(it => { + d.push({ + title: pdfh(it, 'h2&&Text'), + desc: pdfh(it, '.me-auto&&Text') + '分 / ' + pdfh(it, '.small&&Text'), + pic_url: pdfh(it, '.card-img&&style'), + url: '' + }); + }) + setResult(d); + `, + 二级:'', + 搜索:'', +} diff --git a/js/dygang.js b/js/dygang.js index afdc651f..e05158fe 100644 --- a/js/dygang.js +++ b/js/dygang.js @@ -8,17 +8,25 @@ var rule = { filter_url:'{{fl.class}}', filter:{ }, - searchUrl: '/e/search/index.php#tbname=article&show=title%2Csmalltext&tempid=1&Submit=%CB%D1%CB%F7&keyboard=**;post', + searchUrl: '/e/search/index123.php#tempid=1&tbname=article&keyborad=**&show=title%2Csmalltext&Submit=%CB%D1%CB%F7;post', searchable:2, quickSearch:0, filterable:0, headers:{ - 'User-Agent': 'PC_UA' + 'User-Agent': 'MOBILE_UA', + 'Referer': 'https://www.dygang.tv/' }, timeout:5000, class_name:'最新电影&经典高清&国配电影&经典港片&国剧&日韩剧&美剧&综艺&动漫&纪录片&高清原盘&4K高清区&3D电影&电影专题', class_url:'ys&bd&gy&gp&dsj&dsj1&yx&zy&dmq&jilupian&1080p&4K&3d&dyzt', - play_parse:false, + play_parse:true, + play_json:[{ + re:'*', + json:{ + parse:0, + jx:0 + } + }], lazy:'', limit:6, 推荐:'div#tl table.border1;img&&alt;img&&src;;a&&href', @@ -29,60 +37,80 @@ var rule = { desc:"#dede_content p:eq(3)&&Text", content:"#dede_content p:eq(2)&&Text", tabs:`js: - pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; - TABS=[] - var d = pdfa(html, '#dede_content&&a'); - var index=0; - d.forEach(function(it) { - let burl = pdfh(it, 'a&&href'); - log("burl >>>>>>" + burl); - if (burl.startsWith("magnet")){ - let result = 'magnet' + index; - index = index + 1; - TABS.push(result); - } - }); - log('TABS >>>>>>>>>>>>>>>>>>' + TABS); - `, +pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; +TABS=[] +var d = pdfa(html, '#dede_content table tbody tr a[href^="magnet"]'); +if (d.length>0){ + TABS.push("磁力"); +} +d = pdfa(html, '#dede_content table tbody tr a[href^="ed2k"]'); +if (d.length>0){ + TABS.push("電驢"); +} +log('dygang TABS >>>>>>>>>>>>>>>>>>' + TABS); +`, lists:`js: - log(TABS); - pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; - LISTS = []; - var d = pdfa(html, '#dede_content&&a'); - TABS.forEach(function(tab) { - log('tab >>>>>>>>' + tab); - if (/^magnet/.test(tab)) { - let targetindex = parseInt(tab.substring(6)); - let index = 0; - d.forEach(function(it){ - let burl = pdfh(it, 'a&&href'); - if (burl.startsWith("magnet")){ - if (index == targetindex){ - let title = pdfh(it, 'a&&Text'); - log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } - }); - } - }); - `, +log(TABS); +pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; +LISTS = []; +var d = pdfa(html, '#dede_content table tbody tr'); +let listm = []; +let liste = []; +d.forEach(function(it){ + let burl = pdfh(it, 'a&&href'); + let title = pdfh(it, 'a&&Text'); + log('dygang title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('dygang burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + if (burl.startsWith("magnet")){ + listm.push(loopresult); + }else if (burl.startsWith("ed2k")){ + liste.push(loopresult); + } +}); +if (listm.length>0){ + LISTS.push(listm); +} +if (liste.length>0){ + LISTS.push(liste); +} +`, }, - 搜索:'table.border1;img&&alt;img&&src;img&&alt;a&&href;img&&alt', - 预处理:` - let new_host=HOST+'/'; - let new_html=request(new_host, {withHeaders:true}); - let json=JSON.parse(new_html); - let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie"); - let cookie=setCk?json[setCk].split(";")[0]:""; - log("dygang cookie:"+cookie); - if (cookie !== ""){ - rule_fetch_params.headers.Cookie=cookie; - setItem(RULE_CK,cookie); + 搜索:`js: +pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; +let params = 'tempid=1&tbname=article&keyboard=' + KEY + '&show=title%2Csmalltext&Submit=%CB%D1%CB%F7'; +let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); +let postData = { + method: "POST", + body: params +}; +delete(_fetch_params.headers['Content-Type']); +Object.assign(_fetch_params, postData); +log("dygang search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params)); +let search_html = request( HOST + '/e/search/index123.php', _fetch_params, true); +log("dygang search result>>>>>>>>>>>>>>>" + search_html); +let d=[]; +let dlist = pdfa(search_html, 'table.border1'); +dlist.forEach(function(it){ + let title = pdfh(it, 'img&&alt'); + if (searchObj.quick === true){ + if (title.includes(KEY)){ + title = KEY; } - `, + } + let img = pd(it, 'img&&src', HOST); + let content = pdfh(it, 'img&&alt'); + let desc = pdfh(it, 'img&&alt'); + let url = pd(it, 'a&&href', HOST); + d.push({ + title:title, + img:img, + content:content, + desc:desc, + url:url + }) +}); +setResult(d); +`, } diff --git a/js/jiyingw.js b/js/jiyingw.js index 259efa91..6bd9c34f 100644 --- a/js/jiyingw.js +++ b/js/jiyingw.js @@ -1,8 +1,11 @@ var rule = { title:'极影网[磁]', - host:'https://www.jiyingw.net', - homeUrl:'/', - url: '/fyclass/page/fypage?', + //host:'https://www.jiyingw.net', + //homeUrl:'/', + //url: '/fyclass/page/fypage?', + host:'http://127.0.0.1:10079', + homeUrl:'/p/0/socks5%253A%252F%252F192.168.101.1%253A1080/https://www.jiyingw.net', + url: '/p/0/socks5%253A%252F%252F192.168.101.1%253A1080/https://www.jiyingw.net/fyclass/page/fypage?', filter_url:'{{fl.class}}', filter:{ "movie":[{"key":"class","name":"标签","value":[{"n":"全部","v":"movie"},{"n":"4k","v":"tag/4k"}, {"n":"人性","v":"tag/人性"}, {"n":"传记","v":"tag/chuanji"}, {"n":"儿童","v":"tag/儿童"}, {"n":"冒险","v":"tag/adventure"}, {"n":"剧情","v":"tag/剧情"}, {"n":"加拿大","v":"tag/加拿大"}, {"n":"动作","v":"tag/dongzuo"}, {"n":"动漫","v":"tag/动漫"}, {"n":"励志","v":"tag/励志"}, {"n":"历史","v":"tag/history"}, {"n":"古装","v":"tag/古装"}, {"n":"同性","v":"tag/gay"}, {"n":"喜剧","v":"tag/comedy"}, {"n":"国剧","v":"tag/国剧"}, {"n":"奇幻","v":"tag/qihuan"}, {"n":"女性","v":"tag/女性"}, {"n":"家庭","v":"tag/family"}, {"n":"德国","v":"tag/德国"}, {"n":"恐怖","v":"tag/kongbu"}, {"n":"悬疑","v":"tag/xuanyi"}, {"n":"惊悚","v":"tag/jingsong"}, {"n":"意大利","v":"tag/意大利"}, {"n":"战争","v":"tag/zhanzheng"}, {"n":"战斗","v":"tag/战斗"}, {"n":"搞笑","v":"tag/搞笑"}, {"n":"故事","v":"tag/故事"}, {"n":"文艺","v":"tag/文艺"}, {"n":"日常","v":"tag/日常"}, {"n":"日本","v":"tag/日本"}, {"n":"日语","v":"tag/日语"}, {"n":"校园","v":"tag/校园"}, {"n":"武侠","v":"tag/wuxia"}, {"n":"法国","v":"tag/法国"}, {"n":"游戏","v":"tag/游戏"}, {"n":"灾难","v":"tag/zainan"}, {"n":"爱情","v":"tag/爱情"}, {"n":"犯罪","v":"tag/crime"}, {"n":"真人秀","v":"tag/zhenrenxiu"}, {"n":"短片","v":"tag/duanpian"}, {"n":"科幻","v":"tag/kehuan"}, {"n":"纪录","v":"tag/jilu"}, {"n":"美剧","v":"tag/meiju"}, {"n":"舞台","v":"tag/stage"}, {"n":"西部","v":"tag/xibu"}, {"n":"运动","v":"tag/yundong"}, {"n":"韩剧","v":"tag/韩剧"}, {"n":"韩国","v":"tag/韩国"}, {"n":"音乐","v":"tag/yinyue"}, {"n":"高清电影","v":"tag/高清电影"}]}] @@ -38,51 +41,79 @@ var rule = { tabs:`js: pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; TABS=[] -var d = pdfa(html, '.movie-introduce p'); -var index=1; -d.forEach(function(it) { - let burl = pdfh(it, 'a[href^="magnet"]&&href'); - if (burl.startsWith("magnet")){ - log("jiyingw burl >>>>>>" + burl); - let result = 'magnet' + index; - index = index + 1; - TABS.push(result); +let d = pdfa(html, '.movie-introduce p a[href^="magnet"]'); +if (d.length > 0){ + TABS.push("磁力"); +}else{ + d = pdfa(html, 'div#down p.down-list3 a[href^="magnet"]'); + if (d.length > 0){ + TABS.push("磁力"); } -}); +} +d = pdfa(html, '.movie-introduce p a[href^="ed2k"]'); +if (d.length > 0){ + TABS.push("電驢"); +}else{ + d = pdfa(html, 'div#down p.down-list3 a[href^="ed2k'); + if (d.length > 0){ + TABS.push("電驢"); + } +} log('jiyingw TABS >>>>>>>>>>>>>>>>>>' + TABS); `, lists:`js: log(TABS); pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; LISTS = []; -var d = pdfa(html, '.movie-introduce p'); -TABS.forEach(function(tab) { -log('jiyingw tab >>>>>>>>' + tab); -if (/^magnet/.test(tab)) { - let targetindex = parseInt(tab.substring(6)); - let index = 1; +let listm = []; +let liste = []; +let d = pdfa(html, '.movie-introduce p'); +d.forEach(function(it){ + let burl = pdfh(it, 'a[href^="magnet"]&&href'); + let title = pdfh(it, 'a[href^="magnet"]&&Text'); + log('jiyingw title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('jiyingw burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + listm.push(loopresult); + + burl = pdfh(it, 'a[href^="ed2k"]&&href'); + title = pdfh(it, 'a[href^="ed2k"]&&Text'); + log('jiyingw title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('jiyingw burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + loopresult = title + '$' + burl; + liste.push(loopresult); +}); +if (listm.length<=0){ + d = pdfa(html, 'div#down p.down-list3'); d.forEach(function(it){ let burl = pdfh(it, 'a[href^="magnet"]&&href'); - if (burl.startsWith("magnet")){ - if (index == targetindex){ - let title = pdfh(it, 'a[href^="magnet"]&&Text'); - log('jiyingw title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - log('jiyingw burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } + let title = pdfh(it, 'a[href^="magnet"]&&Text'); + log('jiyingw title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('jiyingw burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + listm.push(loopresult); + + burl = pdfh(it, 'a[href^="ed2k"]&&href'); + title = pdfh(it, 'a[href^="ed2k"]&&Text'); + log('jiyingw title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('jiyingw burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + loopresult = title + '$' + burl; + liste.push(loopresult); }); } -}); +if (listm.length>0){ + LISTS.push(listm); +} +if (liste.length>0){ + LISTS.push(liste); +} `, }, 搜索:`js: pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); -let search_html=request(HOST + '/?s=' + KEY, _fetch_params); +let search_html=request(HOST + rule.homeUrl + '/?s=' + KEY, _fetch_params); let d=[]; let dlist = pdfa(search_html, 'h2'); log("jiyingw dlist.length>>>>>>>"+dlist.length); diff --git a/js/mp4us.js b/js/mp4us.js index 60d2570d..890dfae4 100644 --- a/js/mp4us.js +++ b/js/mp4us.js @@ -37,74 +37,41 @@ var rule = { tabs:`js: pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; TABS=[] -var d = pdfa(html, 'ul.down-list&&li'); -let magnetIndex=0; -let ed2kIndex=0; -d.forEach(function(it) { - let burl = pdfh(it, 'a&&href'); - log("burl >>>>>>" + burl); - if (burl.startsWith("magnet")){ - let result = 'magnet' + magnetIndex; - magnetIndex = magnetIndex + 1; - TABS.push(result); - } -}); -d.forEach(function(it) { - let burl = pdfh(it, 'a&&href'); - log("burl >>>>>>" + burl); - if (burl.startsWith("ed2k")){ - let result = 'ed2k' + ed2kIndex; - ed2kIndex = ed2kIndex + 1; - TABS.push(result); - } -}); -log('TABS >>>>>>>>>>>>>>>>>>' + TABS); +let d = pdfa(html, 'ul.down-list&&li a[href^="magnet"]'); +if (d.length > 0){ + TABS.push("磁力"); +} +d = pdfa(html, 'ul.down-list&&li a[href^="ed2k"]'); +if (d.length > 0){ + TABS.push("電驢"); +} +log('mp4us TABS >>>>>>>>>>>>>>>>>>' + TABS); `, lists:`js: log(TABS); pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd; LISTS = []; -var d = pdfa(html, 'ul.down-list&&li'); -TABS.forEach(function(tab) { - log('tab >>>>>>>>' + tab); - if (/^magnet/.test(tab)) { - let targetindex = parseInt(tab.substring(6)); - let index = 0; - d.forEach(function(it){ - let burl = pdfh(it, 'a&&href'); - if (burl.startsWith("magnet")){ - if (index == targetindex){ - let title = pdfh(it, 'a&&Text'); - log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } - }); - } -}); -TABS.forEach(function(tab) { - log('tab >>>>>>>>' + tab); - if (/^ed2k/.test(tab)) { - let targetindex = parseInt(tab.substring(4)); - let index = 0; - d.forEach(function(it){ - let burl = pdfh(it, 'a&&href'); - if (burl.startsWith("ed2k")){ - if (index == targetindex){ - let title = pdfh(it, 'a&&Text'); - log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); - log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); - let loopresult = title + '$' + burl; - LISTS.push([loopresult]); - } - index = index + 1; - } - }); +let d = pdfa(html, 'ul.down-list&&li'); +let listm = []; +let liste = []; +d.forEach(function(it){ + let burl = pdfh(it, 'a&&href'); + let title = pdfh(it, 'a&&Text'); + log('mp4us title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title); + log('mp4us burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl); + let loopresult = title + '$' + burl; + if (burl.startsWith("magnet")){ + listm.push(loopresult); + }else if (burl.startsWith("ed2k")){ + liste.push(loopresult); } }); +if (listm.length>0){ + LISTS.push(listm.reverse()); +} +if (liste.length>0){ + LISTS.push(liste.reverse()); +} `, },