From 59d015f45f4e32a61ef7caf45a8d58e9e158c16a Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Mon, 12 Sep 2022 00:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=8F=9C=E7=8B=97=E7=9A=84?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/vod.py | 2 ++ js/version.txt | 2 +- "js/\350\217\234\347\213\227.js" | 4 ++-- "py/\346\220\234\347\213\227\344\272\214\347\272\247.js" | 9 +++++---- "py/\346\220\234\347\213\227\345\205\215\345\227\205.js" | 3 ++- readme.md | 1 + 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/controllers/vod.py b/controllers/vod.py index 4af9f01..8016335 100644 --- a/controllers/vod.py +++ b/controllers/vod.py @@ -25,6 +25,8 @@ def vod_home(): rule = getParmas('rule') ext = getParmas('ext') filters = getParmas('f') + tp = getParmas('type') + # print(f'type:{tp}') if not ext.startswith('http') and not rule: return R.failed('规则字段必填') rule_list = getRuleLists() diff --git a/js/version.txt b/js/version.txt index e5b8a84..1947319 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.5.4 \ No newline at end of file +3.5.5 \ No newline at end of file diff --git "a/js/\350\217\234\347\213\227.js" "b/js/\350\217\234\347\213\227.js" index 501fe94..c86e443 100644 --- "a/js/\350\217\234\347\213\227.js" +++ "b/js/\350\217\234\347\213\227.js" @@ -20,11 +20,11 @@ var rule = { play_parse:true, // 手动调用解析请求json的url,此lazy不方便 // lazy:'js:input="https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input', - lazy:'js:fetch_params.headers["user-agent"]=MOBILE_UA;let html=request(input);let rurl=html.match(/window\\.open\\(\'(.*?)\',/)[1].split("?")[0];input=rurl;', + lazy:'js:fetch_params.headers["user-agent"]=MOBILE_UA;let html=request(input);let rurl=html.match(/window\\.open\\(\'(.*?)\',/)[1].split("?")[0];input={parse:1,url:rurl};', // 推荐:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float', 一级:'js:let d=[];let html=request(input);html=JSON.parse(html);let list=html.listData.results;list.forEach(function(it){let desc1=it.ipad_play_for_list.finish_episode?it.ipad_play_for_list.episode===it.ipad_play_for_list.finish_episode?"全集"+it.ipad_play_for_list.finish_episode:"连载"+it.ipad_play_for_list.episode+"/"+it.ipad_play_for_list.finish_episode:"";let desc2=it.score?"评分:"+it.score:"";let desc3=it.date?"更至:"+it.date:"";d.push({title:it.name,img:it.v_picurl,url:"https://v.sogou.com"+it.url.replace("teleplay","series").replace("cartoon","series"),desc:desc1||desc2||desc3})});setResult(d);', 二级:'', - 二级:'js:var vod={vod_id:input};let html=request(input);try{let json=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).detail.itemData;let key=json.dockey;let name=json.name;let zone=json.zone;let score=json.score?json.score:"暂无";let style=json.style;let emcee=json.emcee?"主持:"+json.emcee:json.name;let director=json.director?"导演:"+json.director:name;director=director.replace(/;/g,"\\t");let starring=json.starring?"演员:"+json.starring:"声优:"+json.shengyou;starring=starring.replace(/.*undefined/,"").replace(/;/g,"\\t");let update=json.update_wordstr?json.update_wordstr:"";let tv_station=json.tv_station?json.tv_station:zone;let introduction=json.introduction;let shengyou=json.shengyou;let shows=json.play_from_open_index;let plays=json.play.item_list;if(shows){vod.vod_name=name;vod.vod_area=emcee+","+tv_station;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_remarks=style+" 评分:"+score+","+update;vod.vod_content=introduction}else{vod.vod_name=name;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_content=introduction}try{let tabs=[];let lists=[];plays.forEach(function(it){lists.push(it.info);let tbn=it.sitename[0]||it.site.replace(".com","");tbn=tbn.split("").join(" ");tabs.push(tbn)});vod.vod_play_from=tabs.join("$$$");vod_lists=[];lists.forEach(function(item,idex){if(item||shows){if(item&&Array.isArray(item)&&item.length>1){let tmp=item.slice(1).map(function(its){return its.index+"$"+play_url+base64Encode("https://v.sogou.com"+its.url)});vod_lists.push(tmp.join("#"))}if(shows){let arr=[];let tmp=[];let zy=shows.item_list[idex];zy.date.forEach(function(date){let day=date.day;for(let j=0;j=10?day[j][0]:"0"+day[j][0];let Tdate=date.year+date.month+dayy;arr.push(Tdate)}});for(let k=0;k0?img[0]:""}}catch(e){}', + 二级:'js:var vod={vod_id:input};let html=request(input);try{let json=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).detail.itemData;let key=json.dockey;let name=json.name;let zone=json.zone;let score=json.score?json.score:"暂无";let style=json.style;let emcee=json.emcee?"主持:"+json.emcee:json.name;let director=json.director?"导演:"+json.director:name;director=director.replace(/;/g,"\\t");let starring=json.starring?"演员:"+json.starring:"声优:"+json.shengyou;starring=starring.replace(/.*undefined/,"").replace(/;/g,"\\t");let update=json.update_wordstr?json.update_wordstr:"";let tv_station=json.tv_station?json.tv_station:zone;let introduction=json.introduction;let shengyou=json.shengyou;let shows=json.play_from_open_index;let plays=json.play.item_list;if(shows){vod.vod_name=name;vod.vod_area=emcee+","+tv_station;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_remarks=style+" 评分:"+score+","+update;vod.vod_content=introduction}else{vod.vod_name=name;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_content=introduction}let tp="&type=json";try{let tabs=[];let lists=[];plays.forEach(function(it){lists.push(it.info);let tbn=it.sitename[0]||it.site.replace(".com","");tbn=tbn.split("").join(" ");tabs.push(tbn)});vod.vod_play_from=tabs.join("$$$");vod_lists=[];lists.forEach(function(item,idex){if(item||shows){if(item&&Array.isArray(item)&&item.length>1){let tmp=item.slice(1).map(function(its){return its.index+"$"+play_url+base64Encode("https://v.sogou.com"+its.url)+tp});vod_lists.push(tmp.join("#"))}if(shows){let arr=[];let tmp=[];let zy=shows.item_list[idex];zy.date.forEach(function(date){let day=date.day;for(let j=0;j=10?day[j][0]:"0"+day[j][0];let Tdate=date.year+date.month+dayy;arr.push(Tdate)}});for(let k=0;k0?img[0]:""}}catch(e){}', 搜索:'', 搜索:'js:let d=[];let html=request(input);let jsonA=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).result.longVideo.results;jsonA.forEach(function(it){let name=it.name;let introduction=it.introduction;let pic=it.v_picurl;let url=it.tiny_url;let zone=it.zone;let score=it.score||"暂无";let style=it.style;if(it.play.item_list){let r={};r.title=name.replace(//,"").replace(//,"");r.url="https://v.sogou.com"+url;r.desc=it.list_category.join(",");r.content=introduction;r.pic_url=pic;d.push(r)}});setResult(d);', } \ No newline at end of file diff --git "a/py/\346\220\234\347\213\227\344\272\214\347\272\247.js" "b/py/\346\220\234\347\213\227\344\272\214\347\272\247.js" index 1860864..8d04592 100644 --- "a/py/\346\220\234\347\213\227\344\272\214\347\272\247.js" +++ "b/py/\346\220\234\347\213\227\344\272\214\347\272\247.js" @@ -38,6 +38,7 @@ try { // vod.vod_remarks = style + ' 评分:' + score + ',' + update; vod.vod_content = introduction; } + let tp = '&type=json'; try { let tabs = []; let lists = []; @@ -56,7 +57,7 @@ try { if (item || shows) { // 动漫,电视剧 if(item && Array.isArray(item)&&item.length>1){ // let tmp = item.slice(1).map(function (its){return its.index+'$'+play_url+'https://v.sogou.com'+its.url}); - let tmp = item.slice(1).map(function (its){return its.index+'$'+play_url+base64Encode('https://v.sogou.com'+its.url)}); + let tmp = item.slice(1).map(function (its){return its.index+'$'+play_url+base64Encode('https://v.sogou.com'+its.url)+tp}); vod_lists.push(tmp.join('#')); } if (shows) { //综艺,纪录片 @@ -74,7 +75,7 @@ try { for (let k = 0; k < arr.length; k++) { let url = "https://v.sogou.com/vc/eplay?query=" + arr[k] + "&date=" + arr[k] + "&key=" + key + "&st=5&tvsite=" + plays[idex].site; - tmp.push("第" + arr[k] + "期"+'$'+play_url+base64Encode('https://v.sogou.com'+url)); + tmp.push("第" + arr[k] + "期"+'$'+play_url+base64Encode('https://v.sogou.com'+url)+tp); } vod_lists.push(tmp.join('#')); } @@ -82,9 +83,9 @@ try { // print(plays[idex].site); let tmp = []; if (!plays[idex].flag_list.includes('trailer')) { - tmp.push(plays[idex].sitename[0]+'$'+play_url+base64Encode('https://v.sogou.com' + plays[idex].url)); + tmp.push(plays[idex].sitename[0]+'$'+play_url+base64Encode('https://v.sogou.com' + plays[idex].url)+tp); } else { - tmp.push(plays[idex].sitename[0] + '—预告'+'$'+play_url+base64Encode("https://v.sogou.com" + plays[idex].url)); + tmp.push(plays[idex].sitename[0] + '—预告'+'$'+play_url+base64Encode("https://v.sogou.com" + plays[idex].url)+tp); } vod_lists.push(tmp.join('#')); } diff --git "a/py/\346\220\234\347\213\227\345\205\215\345\227\205.js" "b/py/\346\220\234\347\213\227\345\205\215\345\227\205.js" index 52b3cfc..380e961 100644 --- "a/py/\346\220\234\347\213\227\345\205\215\345\227\205.js" +++ "b/py/\346\220\234\347\213\227\345\205\215\345\227\205.js" @@ -7,5 +7,6 @@ let html=request(input); let rurl = html.match(/window\.open\('(.*?)',/)[1].split('?')[0]; // print(input); // print(rurl); -input = rurl; +// input = rurl; +input = {parse:1,url:rurl}; // print(html); diff --git a/readme.md b/readme.md index 2e6078a..1b43e2d 100644 --- a/readme.md +++ b/readme.md @@ -50,6 +50,7 @@ - [X] 1.升级至3.5.2.后台管理增加设置中心 (可能会存在bug) - [X] 2.升级至3.5.3.增加菜狗源(筛选及解析播放暂未解决) - [X] 3.升级至3.5.4 (此版本+pluto1.4.1以上版本支持filter,源示例:菜狗.js) +- [X] 4.升级至3.5.5 (菜狗播放返回json) ###### 2022/09/10 - [X] 1.升级至3.4.4.增加小强迷源,增加二级重定向属性(提供重定向后的源码,让代码重新取重定向过后的线路和播放列表) - [X] 2.升级至3.4.5.增加兔小贝儿歌源,优化json:细节处理以及详情页拼接细节 -- GitLab