From 6d127f1e59e04bf49465bf91cdcaa2f771e8e292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?= <434857005@qq.com> Date: Sun, 7 Jan 2024 13:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Hipy=E7=9A=84t3=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/custom.conf | 8 +-- js/rules.py | 1 + js/version.txt | 2 +- txt/py/py_cctv.py | 138 ---------------------------------------------- 4 files changed, 6 insertions(+), 143 deletions(-) delete mode 100644 txt/py/py_cctv.py diff --git a/base/custom.conf b/base/custom.conf index 7449aec..6f1d137 100644 --- a/base/custom.conf +++ b/base/custom.conf @@ -23,21 +23,21 @@ "key":"hipy_cctv", "name":"hipy_cctv", "type":4, - "api":"http://192.168.31.49:5707/api/v1/vod/cctv_spider?api_ext=./cctv_spider.json", + "api":"http://192.168.31.49:5707/api/v1/vod/cctv_spider?api_ext={{host}}/txt/hipy/cctv_spider.json", "searchable":1, "quickSearch":1, "filterable":1, "ext":"api的扩展,可以是字符串", }, { - "key": "py_cctv", - "name": "py_cctv", + "key": "t3_hipy_cctv", + "name": "t3_hipy_cctv", "type": 3, "api": "{{host}}/txt/hipy/cctv_spider.py", "searchable": 1, "quickSearch": 1, "filterable": 1, - "ext": "./cctv_spider.json" + "ext": "{{host}}/txt/hipy/cctv_spider.json" }, {"key":"Test_jsapi","name":"Test_jsapi(drpy)","type":3,"api":"{{host}}/libs/drpy2.min.js","searchable":2,"quickSearch":0,"filterable":0,"ext":"{{host}}/js/jsapi.js","jar":"{{host}}/libs/jar/custom_jsapi.jar"}, diff --git a/js/rules.py b/js/rules.py index 25a949b..6b1a938 100644 --- a/js/rules.py +++ b/js/rules.py @@ -254,6 +254,7 @@ def getPys(path='txt/py'): # print(file_name) rule_list = [file.replace('.py', '') for file in file_name] py_path = [f'{path}/{rule}.py' for rule in rule_list] + # print(py_path) new_rule_list = [] for i in range(len(rule_list)): new_rule_list.append({ diff --git a/js/version.txt b/js/version.txt index 8fef985..7ce90ef 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.49beta13 \ No newline at end of file +3.9.49beta14 \ No newline at end of file diff --git a/txt/py/py_cctv.py b/txt/py/py_cctv.py deleted file mode 100644 index fe578b9..0000000 --- a/txt/py/py_cctv.py +++ /dev/null @@ -1,138 +0,0 @@ -#coding=utf-8 -#!/usr/bin/python -import sys -sys.path.append('..') -from base.spider import Spider -import json -import time -import base64 - -class Spider(Spider): # 元类 默认的元类 type - def getName(self): - return "央视" - def init(self,extend=""): - print("============{0}============".format(extend)) - pass - def isVideoFormat(self,url): - pass - def manualVideoCheck(self): - pass - def homeContent(self,filter): - result = {} - cateManual = { - "等着我": "TOPC1451378757637200", - "我爱发明": "TOPC1569314345479107", - "动物世界": "TOPC1451378967257534", - "探索发现": "TOPC1451557893544236", - "创新进行时": "TOPC1570875218228998", - "我爱发明2021": "TOPC1451557970755294", - "经典咏流传 第五季":"VIDAIiNbDQzOjE5mLl3T4t2B220403" - } - classes = [] - for k in cateManual: - classes.append({ - 'type_name':k, - 'type_id':cateManual[k] - }) - result['class'] = classes - if(filter): - result['filters'] = self.config['filter'] - return result - def homeVideoContent(self): - result = { - 'list':[] - } - return result - def categoryContent(self,tid,pg,filter,extend): - result = {} - extend['id'] = tid - extend['p'] = pg - filterParams = ["id", "p", "d"] - params = ["", "", ""] - for idx in range(len(filterParams)): - fp = filterParams[idx] - if fp in extend.keys(): - params[idx] = '{0}={1}'.format(filterParams[idx],extend[fp]) - suffix = '&'.join(params) - url = 'https://api.cntv.cn/NewVideo/getVideoListByColumn?{0}&n=20&sort=desc&mode=0&serviceId=tvcctv&t=json'.format(suffix) - if not tid.startswith('TOPC'): - url = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?{0}&n=20&sort=desc&mode=0&serviceId=tvcctv&t=json'.format(suffix) - rsp = self.fetch(url,headers=self.header) - jo = json.loads(rsp.text) - vodList = jo['data']['list'] - videos = [] - for vod in vodList: - guid = vod['guid'] - title = vod['title'] - img = vod['image'] - brief = vod['brief'] - videos.append({ - "vod_id":guid+"###"+img, - "vod_name":title, - "vod_pic":img, - "vod_remarks":'' - }) - result['list'] = videos - result['page'] = pg - result['pagecount'] = 9999 - result['limit'] = 90 - result['total'] = 999999 - return result - def detailContent(self,array): - aid = array[0].split('###') - tid = aid[0] - url = "https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={0}".format(tid) - - rsp = self.fetch(url,headers=self.header) - jo = json.loads(rsp.text) - title = jo['title'].strip() - link = jo['hls_url'].strip() - vod = { - "vod_id":tid, - "vod_name":title, - "vod_pic":aid[1], - "type_name":'', - "vod_year":"", - "vod_area":"", - "vod_remarks":"", - "vod_actor":"", - "vod_director":"", - "vod_content":"" - } - vod['vod_play_from'] = 'CCTV' - vod['vod_play_url'] = title+"$"+link - - result = { - 'list':[ - vod - ] - } - return result - def searchContent(self,key,quick): - result = { - 'list':[] - } - return result - def playerContent(self,flag,id,vipFlags): - result = {} - rsp = self.fetch(id,headers=self.header) - content = rsp.text.strip() - arr = content.split('\n') - urlPrefix = self.regStr(id,'(http[s]?://[a-zA-z0-9.]+)/') - url = urlPrefix + arr[-1] - result["parse"] = 0 - result["playUrl"] = '' - result["url"] = url - result["header"] = '' - return result - - config = { - "player": {}, - "filter": {"TOPC1451557970755294": [{"key": "d", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2021", "v": "2021"}, {"n": "2020", "v": "2020"}, {"n": "2019", "v": "2019"}, {"n": "2018", "v": "2018"}, {"n": "2017", "v": "2017"}, {"n": "2016", "v": "2016"}, {"n": "2015", "v": "2015"}, {"n": "2014", "v": "2014"}, {"n": "2013", "v": "2013"}, {"n": "2012", "v": "2012"}, {"n": "2011", "v": "2011"}, {"n": "2010", "v": "2010"}, {"n": "2009", "v": "2009"}]}]} - } - 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" - } - - def localProxy(self,param): - return [200, "video/MP2T", action, ""] \ No newline at end of file