From cd519056f6b89d4133e2b03f5cfc5a4f8079dd02 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Fri, 16 Sep 2022 18:19:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=81=9A=E6=90=9C=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/rules.db | Bin 40960 -> 40960 bytes controllers/cms.py | 2 +- controllers/vod.py | 6 +++--- "js/\350\217\234\347\213\227.js" | 2 +- ...34\347\213\227\346\220\234\347\264\242.js" | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base/rules.db b/base/rules.db index 8579e1d50696c9b01a66654ccb3e03aef629c1f2..6e0be6de697cdb1496db5f963d7f98a5c9e5a23a 100644 GIT binary patch delta 57 zcmZoTz|?SnX@WH4`-w8njPExl^a(4NCMBnu8kiXakwvn3qM1RGL0XbglBs!8vO!{^ LiRorOkx$(KIZ+b* delta 57 zcmZoTz|?SnX@WH4>xnYXjITE)^a(2%7#mp{r&^k(8dzGUBqkfAnxq3 diff --git a/controllers/cms.py b/controllers/cms.py index 440df41..ff6614a 100644 --- a/controllers/cms.py +++ b/controllers/cms.py @@ -772,7 +772,7 @@ class CMS: url = urljoin(self.homeUrl,detailUrl) else: url = detailUrl - print(url) + logger.info(f'进入详情页: {url}') try: p = self.二级 # 解析 if p == '*': diff --git a/controllers/vod.py b/controllers/vod.py index 71283ad..e42a308 100644 --- a/controllers/vod.py +++ b/controllers/vod.py @@ -62,8 +62,8 @@ def vod_home(): try: for future in as_completed(to_do, timeout=timeout): # 并发执行 ret = future.result() - print(ret) - if ret: + # print(ret) + if ret and isinstance(ret,dict) and ret.get('list'): res.extend(ret['list']) except Exception as e: print(f'发生错误:{e}') @@ -81,7 +81,7 @@ def vod_home(): if ac and ids and ids.find('#') > -1: # 聚搜的二级 id_list = ids.split(',') rule = id_list[0].split('#')[1] - print(rule) + # print(rule) ext = getParmas('ext') filters = getParmas('f') diff --git "a/js/\350\217\234\347\213\227.js" "b/js/\350\217\234\347\213\227.js" index 2c03849..f3ee579 100644 --- "a/js/\350\217\234\347\213\227.js" +++ "b/js/\350\217\234\347\213\227.js" @@ -26,5 +26,5 @@ var rule = { 二级:'js:var vod={vod_id:input};let html=request(input);function adhead(url){let hd="https://v.sogou.com";if(!url.startsWith(hd)){url=hd+url}return urlencode(url)}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=[];play_url=play_url.replace("&play_url=","&type=json&play_url=");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(adhead(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);function adhead(url){let hd="https://v.sogou.com";if(!url.startsWith(hd)){url=hd+url}return url}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=[];play_url=play_url.replace("&play_url=","&type=json&play_url=");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(adhead(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:let d=[];let html=request(input);let jsonA=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]);print(jsonA);jsonA=jsonA.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);', + 搜索:'js:let d=[];let html=request(input);let jsonA=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]);jsonA=jsonA.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\346\220\234\347\264\242.js" "b/py/\346\220\234\347\213\227\346\220\234\347\264\242.js" index caa4665..020221f 100644 --- "a/py/\346\220\234\347\213\227\346\220\234\347\264\242.js" +++ "b/py/\346\220\234\347\213\227\346\220\234\347\264\242.js" @@ -3,7 +3,7 @@ let d=[]; let html = request(input); // print(html); let jsonA = JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]); -print(jsonA); +// print(jsonA); jsonA = jsonA.result.longVideo.results; jsonA.forEach(function (it){ let name=it.name; -- GitLab