From 19460d196f6fd72edebb3b5e297361a6c6f215b2 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Thu, 15 Sep 2022 11:56:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=BA=86=E7=89=88=E6=9C=AC?= 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 | 3 +- "js/007\345\275\261\350\247\206.js" | 10 +++ js/version.txt | 2 +- ...72\344\272\272\345\275\261\350\247\206.js" | 14 +++ ...07\344\274\230\345\275\261\351\231\242.js" | 15 ++++ "js/\347\211\233\351\251\254TV.js" | 12 +++ ...07\344\274\230\346\220\234\347\264\242.js" | 21 +++++ readme.md | 2 + txt/py/py_gitcafe.py | 82 +++++++++--------- 10 files changed, 117 insertions(+), 44 deletions(-) create mode 100644 "js/007\345\275\261\350\247\206.js" create mode 100644 "js/\344\272\272\344\272\272\345\275\261\350\247\206.js" create mode 100644 "js/\345\245\207\344\274\230\345\275\261\351\231\242.js" create mode 100644 "js/\347\211\233\351\251\254TV.js" create mode 100644 "py/\345\245\207\344\274\230\346\220\234\347\264\242.js" diff --git a/base/rules.db b/base/rules.db index da352afcfbd3a291fb13134e2e79830b77b37445..c0f3c7be2819b322d39fc85c2285a5f6eb4f8f46 100644 GIT binary patch delta 419 zcmZoTz|?SnX@WH4oryBejCVFBEa7KXW+H#V^)xDJn{-R09&lSwON1%*+L{vT_PQqLo?2zN%~t zvY!47&pT(oT)8GBY;uF7oKZ?lsg?qyauf54RM;5g z3)Mpn49vk+wN17bl8<=0VdB%4{c6wm^*vp>`FZo&7aj8q)r{1P)lAe3E!7My0z3kO zU4w%?U2M&Y(hF15EiFrPGBZ*vQ}Rsz6XS^NTgkNNBQTKN9+{^q;EXTkT8uaf^R zzYc#FpC_L>UpC)r{ye@@{I+~Nn++5W^V$k9t1?0Y4dMYc9%flaSRknKGRrf<{iXs^ Ni|iid%@%qm3IQH{rX&CW delta 94 zcmV-k0HObYzyg540+1U4*O44U0oSo$qz?lh0pODd5I?bjngO%m5hM;Q9}YMI555kX z4-gLH4}T7X4*w3=4mb|+4tWpV4=fLg4oMDc4yzAt4$2Qbvp68b4Uv#Vvp6ouap1%s AmjD0& diff --git a/controllers/cms.py b/controllers/cms.py index cec65c9..88b2d5b 100644 --- a/controllers/cms.py +++ b/controllers/cms.py @@ -436,7 +436,8 @@ class CMS: # print(self.headers) if self.class_parse and not has_cache: p = self.class_parse.split(';') - # print(p) + # print(p[0]) + # print(html) jsp = jsoup(self.url) pdfh = jsp.pdfh pdfa = jsp.pdfa diff --git "a/js/007\345\275\261\350\247\206.js" "b/js/007\345\275\261\350\247\206.js" new file mode 100644 index 0000000..a4c0535 --- /dev/null +++ "b/js/007\345\275\261\350\247\206.js" @@ -0,0 +1,10 @@ +muban.首图2.二级.tabs = '.nav-tabs.dpplay&&li'; +var rule = Object.assign(muban.首图2,{ + title:'007影视', + host:'https://www.007ts.me', + url:'/channel/fyclass-fypage.html', + searchUrl:'/search/**----------fypage---.html', + searchable:1, + quickSearch:0, + 搜索:'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.text-muted:eq(-1)&&Text', +}); \ No newline at end of file diff --git a/js/version.txt b/js/version.txt index b55f108..813ed36 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.6.5 \ No newline at end of file +3.6.6 \ No newline at end of file diff --git "a/js/\344\272\272\344\272\272\345\275\261\350\247\206.js" "b/js/\344\272\272\344\272\272\345\275\261\350\247\206.js" new file mode 100644 index 0000000..dd2cba3 --- /dev/null +++ "b/js/\344\272\272\344\272\272\345\275\261\350\247\206.js" @@ -0,0 +1,14 @@ +muban.首图2.二级.tabs = '.stui-pannel__head h3'; +var rule = Object.assign(muban.首图2,{ + title:'人人影视', + host:'https://www.rttks.com', + url:'/rrtop/fyclass/page/fypage.html', + searchUrl:'/rrso**/page/fypage.html', + class_parse:'.stui-header__menu li;a&&Text;a&&href;.*/(.*?).html', + // cate_exclude:'解说', + searchable:1, + quickSearch:0, + play_parse:true, + lazy:'', + 搜索:'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.text-muted:eq(-1)&&Text', +}); \ No newline at end of file diff --git "a/js/\345\245\207\344\274\230\345\275\261\351\231\242.js" "b/js/\345\245\207\344\274\230\345\275\261\351\231\242.js" new file mode 100644 index 0000000..6a3eb02 --- /dev/null +++ "b/js/\345\245\207\344\274\230\345\275\261\351\231\242.js" @@ -0,0 +1,15 @@ +muban.首图2.二级.title = '.stui-content__detail&&h1&&Text;.stui-content__detail&&p:eq(0)&&Text'; +muban.首图2.二级.tabs = '.stui-pannel__head a'; +muban.首图2.二级.lists = '.stui-content__playlist:eq(#id) li'; +muban.首图2.二级.desc = '.stui-content__detail&&p:eq(1)&&Text;.stui-content__detail&&p:eq(2)&&Text;.stui-content__detail&&p:eq(3)&&Text'; +muban.首图2.二级.content = '.stui-pannel_bd:eq(1)&&Text'; +var rule = Object.assign(muban.首图2,{ + title:'奇优影院', + host:'http://1e6e.com', + url:'/list/fyclass_fypage.html', + searchUrl:'/search.php;**', + 搜索:'js:let url=input.split(";")[0];let d=[];let body={searchword:input.split(";")[1]};fetch_params.body=body;let html=post(url,fetch_params);let pdfa=jsp.pdfa;let pdfh=jsp.pdfh;let pd=jsp.pd;let lists=pdfa(html,"ul.stui-vodlist__media&&li");lists.forEach(function(it){d.push({title:pdfh(it,".title&&Text"),url:pd(it,"a&&href"),desc:pdfh(html,".pic-text&&Text"),pic_url:pd(html,".lazyload&&data-original")})});setResult(d);', + searchable:1, + quickSearch:0, +//搜索:'li.stui-vodlist__item;a&&title;a&&data-original;.pic-text&&Text;a&&href' +}); \ No newline at end of file diff --git "a/js/\347\211\233\351\251\254TV.js" "b/js/\347\211\233\351\251\254TV.js" new file mode 100644 index 0000000..28f233a --- /dev/null +++ "b/js/\347\211\233\351\251\254TV.js" @@ -0,0 +1,12 @@ +muban.首图2.二级.tabs = '.stui-pannel__head h3'; +muban.首图2.二级.content = '.stui-content__desc&&Text'; +var rule = Object.assign(muban.首图2,{ + title:'牛马TV', + host:'https://www.niumatv.com', + url:'/type/fyclass-fypage.html', + searchUrl:'/vodsearch**/page/fypage.html', + class_parse:'.stui-header__menu&&li;a&&Text;a&&href;.*/(.*?).html', + searchable:1, + quickSearch:0, + 搜索:'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.text-muted:eq(-1)&&Text', +}); \ No newline at end of file diff --git "a/py/\345\245\207\344\274\230\346\220\234\347\264\242.js" "b/py/\345\245\207\344\274\230\346\220\234\347\264\242.js" new file mode 100644 index 0000000..28c77f5 --- /dev/null +++ "b/py/\345\245\207\344\274\230\346\220\234\347\264\242.js" @@ -0,0 +1,21 @@ +js: +// log(input); +let url=input.split(";")[0]; +let d = []; +let body={searchword:input.split(";")[1]}; +fetch_params.body=body; +let html = post(url,fetch_params); +// print(html);\ +let pdfa = jsp.pdfa; +let pdfh = jsp.pdfh; +let pd = jsp.pd; +let lists = pdfa(html,'ul.stui-vodlist__media&&li'); +lists.forEach(function (it){ + d.push({ + title:pdfh(it,'.title&&Text'), + url:pd(it,'a&&href'), + desc:pdfh(html,'.pic-text&&Text'), + pic_url:pd(html,'.lazyload&&data-original'), + }); +}); +setResult(d); \ No newline at end of file diff --git a/readme.md b/readme.md index 3065119..7cf4c72 100644 --- a/readme.md +++ b/readme.md @@ -53,6 +53,8 @@ - [X] 4.修复局域网ip可能会获取成网关地址问题 - [X] 5.设置中心增加自定义进程管理地址(可用于goorm等设备绑定快捷方式) - [X] 6.直播文件目录迁移 +- [X] 7.增加py_gitcafe.py和其他几个js首图2模板源 +- [X] 8.版本号更新至3.6.6 ###### 2022/09/14 - [X] 1.升级至3.6.2,增加了一些解析 - [X] 2.升级至3.6.5,修复菜狗部分源解析失败问题(url参数有+号被自动变空格导致的) diff --git a/txt/py/py_gitcafe.py b/txt/py/py_gitcafe.py index 5d5b575..7f4c2f1 100644 --- a/txt/py/py_gitcafe.py +++ b/txt/py/py_gitcafe.py @@ -4,6 +4,7 @@ import sys sys.path.append('..') from base.spider import Spider import requests +import json class Spider(Spider): def getDependence(self): @@ -20,41 +21,26 @@ class Spider(Spider): pass def homeContent(self,filter): result = {} - cateManual = { - "hyds": "华语电视", - "rhds": "日韩电视", - "omds": "欧美电视", - "qtds": "其他电视", - "hydy": "华语电影", - "rhdy": "日韩电影", - "omdy": "欧美电影", - "qtdy": "其他电影", - "hydm": "华语动漫", - "rhdm": "日韩动漫", - "omdm": "欧美动漫", - "jlp": "纪录片", - "zyp": "综艺片", - "jypx": "教育培训", - "qtsp": "其他视频", - "hyyy": "华语音乐", - "rhyy": "日韩音乐", - "omyy": "欧美音乐", - "qtyy": "其他音乐", - "kfrj": "娱乐软件", - "xtrj": "系统软件", - "wlrj": "网络软件", - "bgrj": "办公软件", - "qtrj": "其他软件", - "mh": "漫画", - "xs": "小说", - "cbs": "出版书", - "zspx": "知识培训", - "qtwd": "其他文档", - "bz": "壁纸", - "rw": "人物", - "fj": "风景", - "qttp": "其他图片", - "qt": "其他" + cateManual = { + "华语电视" :"hyds", + "日韩电视" :"rhds", + "欧美电视" :"omds", + "其他电视" :"qtds", + "华语电影" :"hydy", + "日韩电影" :"rhdy", + "欧美电影" :"omdy", + "其他电影" :"qtdy", + "华语动漫" :"hydm", + "日韩动漫" :"rhdm", + "欧美动漫" :"omdm", + "纪录片" :"jlp", + "综艺片" :"zyp", + "教育培训" :"jypx", + "其他视频" :"qtsp", + "华语音乐" :"hyyy", + "日韩音乐" :"rhyy", + "欧美音乐" :"omyy", + "其他音乐" :"qtyy" } classes = [] for k in cateManual: @@ -63,6 +49,8 @@ class Spider(Spider): 'type_id':cateManual[k] }) result['class'] = classes + if filter: + result['filter'] = self.config['filter'] return result def homeVideoContent(self): result = {} @@ -84,13 +72,16 @@ class Spider(Spider): result['list']=videos return result def categoryContent(self,tid,pg,filter,extend): + result = {} url = self.baseUrl+'/tool/alipaper/' form = { "action": "viewcat", "cat": tid, "num":pg } - vodList = requests.post(url,headers=self.header,data=form).json() + + rsp = requests.post(url,headers=self.header,data=form) + vodList = json.loads(self.cleanText(rsp.text)) videos = [] for vod in vodList: videos.append({ @@ -99,14 +90,17 @@ class Spider(Spider): "vod_pic": "https://txc.gtimg.com/data/375895/2022/0214/d6b96cc3799b6417d30e4715d2973f64.png", "vod_remarks": vod['cat'] }) - return videos - header = { - "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" - } + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result category = ['hydm','hyds','hydy','omdm','omds','omdy','rhdm','rhds','rhdy','qtds','qtdy','qtsp','jlp','zyp'] def detailContent(self,array): - return self.ali.detailContent(newArray) + return self.ali.detailContent(array) def searchContent(self,key,quick): + result = {} url = self.baseUrl+'/tool/alipaper/' form = { "action": "search", @@ -121,9 +115,13 @@ class Spider(Spider): "vod_pic": "https://txc.gtimg.com/data/375895/2022/0214/d6b96cc3799b6417d30e4715d2973f64.png", "vod_remarks": vod['cat'] }) - return videos + result = { + 'list':videos + } + return result def playerContent(self,flag,id,vipFlags): return self.ali.playerContent(flag,id,vipFlags) + homeData = {} baseUrl = 'https://gitcafe.net' config = { -- GitLab