diff --git a/base/custom.conf b/base/custom.conf index 3800cefcb3bc20da0a21294786e279d2b05caaf1..8235850ad470ccf34e3e7af325de131453f71e87 100644 --- a/base/custom.conf +++ b/base/custom.conf @@ -3,7 +3,7 @@ # 可以使用Python的 # 单行注释 { - "spider": "{{host}}/files/bc.jar", + "spider": "{{ host }}/files/custom_spider.jar", "sites":[ { "key":"t4", diff --git a/base/files/bc.jar b/base/files/bc.jar deleted file mode 100644 index 894abb8f58a02e2b6171f66e2550df347348a2e7..0000000000000000000000000000000000000000 Binary files a/base/files/bc.jar and /dev/null differ diff --git a/base/files/custom_spider.jar b/base/files/custom_spider.jar index 152a94b4c151320830ea6f29bc687b3f41ee6088..894abb8f58a02e2b6171f66e2550df347348a2e7 100644 Binary files a/base/files/custom_spider.jar and b/base/files/custom_spider.jar differ diff --git a/base/files/custom_spider.mini.jar b/base/files/custom_spider.mini.jar new file mode 100644 index 0000000000000000000000000000000000000000..152a94b4c151320830ea6f29bc687b3f41ee6088 Binary files /dev/null and b/base/files/custom_spider.mini.jar differ diff --git "a/base/\350\247\243\346\236\220.conf" "b/base/\350\247\243\346\236\220.conf" new file mode 100644 index 0000000000000000000000000000000000000000..bf49ac2790561920c6f26163c0c28e4fc8dc79ab --- /dev/null +++ "b/base/\350\247\243\346\236\220.conf" @@ -0,0 +1,6 @@ +# 这是用户自定义解析列表,不会被系统升级覆盖 +# 0123,对应,普通解析,json解析,并发多json解析,聚合解析,参数3不填默认0 +# flags是线路名称标识,会自动拦截并走以下的解析 +# 名称,链接,类型,ua (ua不填默认 Mozilla/5.0) 可以手动填 Dart/2.14 (dart:io) +虾米,https://dm.xmflv.com:4433/?url= + \ No newline at end of file diff --git a/controllers/cms.py b/controllers/cms.py index 4cb5b2ce1383d8f5576e9c347f0ed9e80084aa87..fa11e585a57604715d6ce90e58aa7fdbf8654e43 100644 --- a/controllers/cms.py +++ b/controllers/cms.py @@ -178,16 +178,16 @@ class CMS: def blank_vod(self): return { - "vod_id": "", - "vod_name": "", - "vod_pic": "", - "type_name": "", - "vod_year": "", - "vod_area": "", - "vod_remarks": "", - "vod_actor": "", - "vod_director": "", - "vod_content": "" + "vod_id": "id", + "vod_name": "片名", + "vod_pic": "",# 图片 + "type_name": "剧情", + "vod_year": "年份", + "vod_area": "地区", + "vod_remarks": "更新信息", + "vod_actor": "主演", + "vod_director": "导演", + "vod_content": "简介" } def jsoup(self): @@ -468,9 +468,11 @@ class CMS: "vod_name": title, "vod_pic": img, "vod_remarks": desc, - "vod_content": content, - "type_id": 1, - "type_name": "首页推荐", + "no_use":{ + "vod_content": content, + "type_id": 1, + "type_name": "首页推荐", + }, }) except: pass @@ -491,21 +493,25 @@ class CMS: "vod_name": title, "vod_pic": img, "vod_remarks": desc, - "vod_content": content, - "type_id": 1, - "type_name": "首页推荐", + "no_use": { + "vod_content": content, + "type_id": 1, + "type_name": "首页推荐", + }, }) except: pass # result['list'] = videos[min((fypage-1)*self.limit,len(videos)-1):min(fypage*self.limit,len(videos))] result['list'] = videos - result['code'] = 1 - result['msg'] = '数据列表' - result['page'] = fypage - result['pagecount'] = math.ceil(len(videos)/self.limit) - result['limit'] = self.limit - result['total'] = len(videos) - result['now_count'] = len(result['list']) + result['no_use'] = { + 'code':1, + 'msg':'数据列表', + 'page':fypage, + 'pagecount':math.ceil(len(videos)/self.limit), + 'limit':self.limit, + 'total':len(videos), + 'now_count':len(result['list']), + } return result except Exception as e: logger.info(f'首页内容获取失败:{e}') @@ -768,7 +774,6 @@ class CMS: # print(vod_play_url) except Exception as e: logger.info(f'{self.getName()}获取单个详情页{detailUrl}出错{e}') - # print(vod) return vod def detailContent(self, fypage, array): @@ -867,7 +872,7 @@ class CMS: "vod_name": title, "vod_pic": img, "vod_remarks": desc, - "vod_content": content, + "vod_content": content, # 无用参数 }) except: pass @@ -880,7 +885,9 @@ class CMS: return result def playContent(self, play_url,jxs=None,flag=None): + # flag参数只有类型为4的时候才有,可以忽略 # logger.info('播放免嗅地址: ' + self.play_url) + # 注意:全局flags里的视频没法执行免嗅代码,因为会自动拦截去调用解析: url=yoursite:5705/vod?play_url=xxxx if not jxs: jxs = [] try: diff --git "a/js/360\345\275\261\350\247\206.js" "b/js/360\345\275\261\350\247\206.js" index 5fbb007f938af47b2c2ac2df19ae846ad1918752..de8079fcb05ead48c2a6b79a000ea5312e067133 100644 --- "a/js/360\345\275\261\350\247\206.js" +++ "b/js/360\345\275\261\350\247\206.js" @@ -12,11 +12,12 @@ var rule = { class_name:'电视剧&电影&综艺&动漫', class_url:'2&1&3&4', limit:5, - // play_parse:true, + play_parse:true, + lazy:'js:input=input.split("?")[0];log(input);', // 疑似t4专用的 - lazy:'js:input={parse: 1, playUrl: "", jx: 1, url: input.split("?")[0]}', + // lazy:'js:input={parse: 1, playUrl: "", jx: 1, url: input.split("?")[0]}', // 手动调用解析请求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: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', 推荐:'json:data;title;cover;comment;cat+ent_id;description', 一级:'json:data.movies;title;cover;pubdate;id;description', // 二级:{is_json:1,"title":"data.title;data.moviecategory[0]+data.moviecategory[1]","img":"data.cdncover","desc":"data.area[0];data.director[0]","content":"data.description","tabs":"data.playlink_sites;data.playlinksdetail.#idv.quality","lists":"data.playlinksdetail.#idv.default_url"}, diff --git a/js/custom_spider.jar b/js/custom_spider.jar index 152a94b4c151320830ea6f29bc687b3f41ee6088..894abb8f58a02e2b6171f66e2550df347348a2e7 100644 Binary files a/js/custom_spider.jar and b/js/custom_spider.jar differ diff --git a/js/rules.py b/js/rules.py index f299025e46b4e8aa6dce1a68ea3d9684e83a8021..eb23281dede8fa7be10c6e3d3685a608bc7f94f7 100644 --- a/js/rules.py +++ b/js/rules.py @@ -69,11 +69,10 @@ def getRules(path='cache'): logger.info(f'自动配置装载耗时:{get_interval(t1)}毫秒') return rules -def getJxs(path='js'): - with open(f'{path}/解析.conf',encoding='utf-8') as f: - data = f.read().strip() +def jxTxt2Json(text:str): + data = text.strip().split('\n') jxs = [] - for i in data.split('\n'): + for i in data: i = i.strip() dt = i.split(',') if not i.startswith('#'): @@ -83,9 +82,27 @@ def getJxs(path='js'): 'type':dt[2] if len(dt) > 2 else 0, 'ua':dt[3] if len(dt) > 3 else UA, }) - # jxs = [{'name':dt.split(',')[0],'url':dt.split(',')[1]} for dt in data.split('\n')] - # jxs = list(filter(lambda x:not str(x['name']).strip().startswith('#'),jxs)) - # print(jxs) + return jxs + +def getJxs(path='js'): + custom_jx = 'base/解析.conf' + if not os.path.exists(custom_jx): + with open(custom_jx,'w+',encoding='utf-8') as f1: + msg = """# 这是用户自定义解析列表,不会被系统升级覆盖 +# 0123,对应,普通解析,json解析,并发多json解析,聚合解析,参数3不填默认0 +# flags是线路名称标识,会自动拦截并走以下的解析 +# 名称,链接,类型,ua (ua不填默认 Mozilla/5.0) 可以手动填 Dart/2.14 (dart:io) +虾米,https://dm.xmflv.com:4433/?url= + """ + f1.write(msg) + + with open(f'{path}/解析.conf',encoding='utf-8') as f: + text = f.read() + jxs = jxTxt2Json(text) + with open(custom_jx,encoding='utf-8') as f2: + text = f2.read() + jxs2 = jxTxt2Json(text) + jxs.extend(jxs2) print(f'共计{len(jxs)}条解析') return jxs diff --git a/js/version.txt b/js/version.txt index 3f09e910959e699d1ae19c407b48d611976ad1da..2c6109e5bb82f3acf70853f9f27e6d3bb1883517 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.3.3 \ No newline at end of file +3.3.4 \ No newline at end of file diff --git "a/js/\350\247\243\346\236\220.conf" "b/js/\350\247\243\346\236\220.conf" index 9da116b82574c59e916c9775a7ede04cbce833dd..d1604438972e4e86a8b3192f17a2f83515bcabca 100644 --- "a/js/\350\247\243\346\236\220.conf" +++ "b/js/\350\247\243\346\236\220.conf" @@ -1,8 +1,9 @@ # 0123,对应,普通解析,json解析,并发多json解析,聚合解析,参数3不填默认0 # flags是线路名称标识,会自动拦截并走以下的解析 # 名称,链接,类型,ua (ua不填默认 Mozilla/5.0) 可以手动填 Dart/2.14 (dart:io) -# Json并发|轮询,,2 -# 解析聚合,,3 +轮询,Sequence,2 +并发,Parallel,2 +# 聚合,Demo,3 BT5V,https://rx.bt5v.com/json/jsonindex.php/?url=,1 爱酷,https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url=,1 ok解析,https://okjx.cc/?url= diff --git a/templates/config.txt b/templates/config.txt index f4455cfcde9e1e93c77250847988e980c6b575cf..6a76495d981b49b668f682380bf491ec650eefce 100644 --- a/templates/config.txt +++ b/templates/config.txt @@ -25,14 +25,14 @@ "filterable": {{ rule.filterable }} }{% endif %}{% if loop.last==False %},{% endif %}{% endfor %}], "parses": [{ - "name": "免解嗅探", + "name": "Ⓤ免", "type": 0, "url": "", "header": { "User-Agent": "Mozilla/5.0" } },{ - "name": "免解JSON", + "name": "Ⓙ免", "type": 1, "url": "", "header": {