diff --git a/controllers/home.py b/controllers/home.py index 808c2f675ec1cff2d2c596ba7ba2b9068e93213b..e21e569d3fd54c7ac914b6eedb6cb55f569b1e23 100644 --- a/controllers/home.py +++ b/controllers/home.py @@ -6,12 +6,12 @@ import json import os -from flask import Blueprint,abort,render_template,render_template_string,url_for,redirect,make_response +from flask import Blueprint,abort,render_template,render_template_string,url_for,redirect,make_response,send_from_directory from controllers.service import storage_service from controllers.classes import getClasses,getClassInfo from utils.web import getParmas from utils.files import getPics,custom_merge -from js.rules import getRules +from js.rules import getRules,getPys from base.R import R from utils.system import cfg,getHost,is_linux from utils import parser @@ -111,19 +111,25 @@ def get_files(name): response.headers['Content-Disposition'] = f'attachment;filename="{filename}"' return response -@home.route('/txt/') -def get_txt_files(name): - base_path = 'txt' - os.makedirs(base_path,exist_ok=True) - file_path = os.path.join(base_path, f'{name}') - if not os.path.exists(file_path): - return R.failed(f'{file_path}文件不存在') - - with open(file_path, mode='r',encoding='utf-8') as f: - file_byte = f.read() - response = make_response(file_byte) - response.headers['Content-Type'] = 'text/plain; charset=utf-8' - return response +@home.route('/txt/') +def custom_static(filename): + # 自定义静态目录 {{ url_for('custom_static',filename='help.txt')}} + # print(filename) + return send_from_directory('txt', filename) + +# @home.route('/txt/') +# def get_txt_files(name): +# base_path = 'txt' +# os.makedirs(base_path,exist_ok=True) +# file_path = os.path.join(base_path, f'{name}') +# if not os.path.exists(file_path): +# return R.failed(f'{file_path}文件不存在') +# +# with open(file_path, mode='r',encoding='utf-8') as f: +# file_byte = f.read() +# response = make_response(file_byte) +# response.headers['Content-Type'] = 'text/plain; charset=utf-8' +# return response @home.route('/lives') @@ -174,11 +180,13 @@ def config_render(mode): except Exception as e: logger.info(f'用户自定义配置加载失败:{e}') jxs = getJxs() + pys = getPys() + print(pys) alists = getAlist() alists_str = json.dumps(alists, ensure_ascii=False) live_url = get_live_url(new_conf,mode) # html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,base64Encode=base64Encode,config=new_conf) - html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,alists=alists,alists_str=alists_str,live_url=live_url,config=new_conf) + html = render_template('config.txt',pys=pys,rules=getRules('js'),host=host,mode=mode,jxs=jxs,alists=alists,alists_str=alists_str,live_url=live_url,config=new_conf) merged_config = custom_merge(parseText(html),customConfig) # print(merged_config) # response = make_response(html) @@ -193,12 +201,13 @@ def config_gen(): os.makedirs('txt',exist_ok=True) new_conf = cfg jxs = getJxs() + pys = getPys() alists = getAlist() alists_str = json.dumps(alists,ensure_ascii=False) - set_local = render_template('config.txt',rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,0),mode=0,host=getHost(0),jxs=jxs) + set_local = render_template('config.txt',pys=pys,rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,0),mode=0,host=getHost(0),jxs=jxs) print(set_local) - set_area = render_template('config.txt',rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,1),mode=1,host=getHost(1),jxs=jxs) - set_online = render_template('config.txt',rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,2),mode=1,host=getHost(2),jxs=jxs) + set_area = render_template('config.txt',pys=pys,rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,1),mode=1,host=getHost(1),jxs=jxs) + set_online = render_template('config.txt',pys=pys,rules=getRules('js'),alists=alists,alists_str=alists_str,live_url=get_live_url(new_conf,2),mode=1,host=getHost(2),jxs=jxs) with open('txt/pycms0.json','w+',encoding='utf-8') as f: set_dict = json.loads(set_local) f.write(json.dumps(set_dict,ensure_ascii=False,indent=4)) diff --git a/js/rules.py b/js/rules.py index eb23281dede8fa7be10c6e3d3685a608bc7f94f7..19f9ce9974e2b939e5373b483a646a09fdc710e8 100644 --- a/js/rules.py +++ b/js/rules.py @@ -106,5 +106,26 @@ def getJxs(path='js'): print(f'共计{len(jxs)}条解析') return jxs +def getPys(path='txt/py'): + t1 = time() + base_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 上级目录 + py_path = os.path.join(base_path, path) + os.makedirs(py_path, exist_ok=True) + file_name = os.listdir(py_path) + file_name = list(filter(lambda x: str(x).endswith('.py'), file_name)) + # print(file_name) + rule_list = [file.replace('.py', '') for file in file_name] + py_path = [f'{path}/{rule}.py' for rule in rule_list] + new_rule_list = [] + for i in range(len(rule_list)): + new_rule_list.append({ + 'name': rule_list[i], + 'searchable': 1, + 'quickSearch': 1, + 'filterable': 0, + }) + logger.info(f'自动加载Pyramid耗时:{get_interval(t1)}毫秒') + return new_rule_list + if __name__ == '__main__': print(getRuleLists()) \ No newline at end of file diff --git a/js/version.txt b/js/version.txt index 8cf6caf561bc66b4882a6ef17c3dbc0ff4d83dba..a423d4217b960a11491d571175305febc4d7223b 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.4.1 \ No newline at end of file +3.4.2 \ No newline at end of file diff --git a/readme.md b/readme.md index f6f2ebc91f672c664d4bc7d6635fc351bf0d0efa..0a4a7465a2e1e3f7f1d270ff27ee7efeb8d5635b 100644 --- a/readme.md +++ b/readme.md @@ -49,6 +49,7 @@ ###### 2022/09/09 - [X] 1.增加西瓜源,修复一级不支持lazy的bug - [X] 2.兄弟们dockerhub没法push镜像不知道咋回事,3.4.1的镜像自己用docker目录下的文件build吧 +- [X] 3.版本升至3.4.2,增加py源支持,放txt/py目录即可,特别鸣谢Pyramid开发者及xiaoya liu提供的技术和源 ###### 2022/09/08 - [X] 1.升级到3.2.9,支持自动合并自定义用户配置(内置t4测试源) - [X] 2.升级到3.3.0,增加奇珍异兽源 diff --git a/templates/config.txt b/templates/config.txt index 3f78249577ea7909f198711a267fb77518adbce5..1f18e0a67b2d9b01b51ed743a7c413212a204830 100644 --- a/templates/config.txt +++ b/templates/config.txt @@ -23,7 +23,18 @@ "searchable": {{ rule.searchable }}, "quickSearch": {{ rule.quickSearch }}, "filterable": {{ rule.filterable }} -}{% endif %}{% if loop.last==False %},{% endif %}{% endfor %}], +}{% endif %}{% if loop.last==False %},{% endif %}{% endfor %} +,{% for py in pys %}{ + "key":"{{ py.name }}", + "name":"{{ py.name }}(Pyramid)", + "type": 3, + "api":"{{ py.name }}", + "searchable": {{ py.searchable }}, + "quickSearch": {{ py.quickSearch }}, + "filterable": {{ py.filterable }}, + "ext": "{{ host }}/txt/py/{{ py.name }}.py" +}{% if loop.last==False %},{% endif %}{% endfor %} +], "parses": [{ "name": "🌐Ⓤ", "type": 0, diff --git a/txt/py/py_ali.py b/txt/py/py_ali.py new file mode 100644 index 0000000000000000000000000000000000000000..cf016fd6dab33a2b14e98574a954ff37f18bd3c8 --- /dev/null +++ b/txt/py/py_ali.py @@ -0,0 +1,405 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json +import requests +import time +import re + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "阿里云盘" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def homeContent(self,filter): + result = {} + return result + def homeVideoContent(self): + result = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + return result + def searchContent(self,key,quick): + result = {} + return result + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def playerContent(self,flag,id,vipFlags): + if flag == 'AliYun': + return self.originContent(flag,id,vipFlags) + elif flag == 'AliYun原画': + return self.fhdContent(flag,id,vipFlags) + else: + return {} + def fhdContent(self,flag,id,vipFlags): + self.login() + ids = id.split('+') + shareId = ids[0] + shareToken = ids[1] + fileId = ids[2] + category = ids[3] + url = self.getDownloadUrl(shareId,shareToken,fileId,category) + print(url) + + noRsp = requests.get(url,headers=self.header, allow_redirects=False,verify = False) + realUrl = '' + if 'Location' in noRsp.headers: + realUrl = noRsp.headers['Location'] + if 'location' in noRsp.headers and len(realUrl) == 0 : + realUrl = noRsp.headers['location'] + newHeader = { + "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", + "referer":"https://www.aliyundrive.com/", + } + result = { + 'parse':'0', + 'playUrl':'', + 'url':realUrl, + 'header':newHeader + } + return result + def originContent(self,flag,id,vipFlags): + self.login() + ids = id.split('+') + shareId = ids[0] + shareToken = ids[1] + fileId = ids[2] + url = '{0}?do=push_agent&api=python&type=m3u8&share_id={1}&file_id={2}'.format(self.localProxyUrl,shareId,fileId) + + result = { + 'parse':'0', + 'playUrl':'', + 'url':url, + 'header':'' + } + + # shareToken = self.getToken(shareId,'') + # self.getMediaSlice(shareId,shareToken,fileId) + + + # map = { + # 'share_id':'p1GJYEqgeb2', + # 'file_id':'62ed1b95b1048d60ffc246669f5e0999e90b8c2f', + # 'media_id':'1' + # } + + # self.proxyMedia(map) + + return result + + def detailContent(self,array): + tid = array[0] + # shareId = self.regStr(href,'www.aliyundrive.com\\/s\\/([^\\/]+)(\\/folder\\/([^\\/]+))?') + # todo ========================================================================================= + m = re.search('www.aliyundrive.com\\/s\\/([^\\/]+)(\\/folder\\/([^\\/]+))?', tid) + col = m.groups() + shareId = col[0] + fileId = col[2] + + infoUrl = 'https://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous' + + infoForm = {'share_id':shareId} + infoRsp = requests.post(infoUrl,json = infoForm,headers=self.header) + infoJo = json.loads(infoRsp.text) + + infoJa = [] + if 'file_infos' in infoJo: + infoJa = infoJo['file_infos'] + if len(infoJa) <= 0 : + return '' + fileInfo = {} + # todo + fileInfo = infoJa[0] + print(fileId) + if fileId == None or len(fileId) <= 0: + fileId = fileInfo['file_id'] + + vodList = { + 'vod_id':tid, + 'vod_name':infoJo['share_name'], + 'vod_pic':infoJo['avatar'], + 'vod_content':tid, + 'vod_play_from':'AliYun$$$AliYun原画' + } + fileType = fileInfo['type'] + if fileType != 'folder': + if fileType != 'file' or fileInfo['category'] != video: + return '' + fileId = 'root' + + shareToken = self.getToken(shareId,'') + hashMap = {} + self.listFiles(hashMap,shareId,shareToken,fileId) + + sortedMap = sorted(hashMap.items(), key=lambda x: x[0]) + arrayList = [] + playList = [] + + for sm in sortedMap: + arrayList.append(sm[0]+'$'+sm[1]) + playList.append('#'.join(arrayList)) + playList.append('#'.join(arrayList)) + vodList['vod_play_url'] = '$$$'.join(playList) + + result = { + 'list':[vodList] + } + return result + + authorization = '' + timeoutTick = 0 + localTime = 0 + expiresIn = 0 + shareTokenMap = {} + expiresMap = {} + localMedia = {} + header = { + "Referer":"https://www.aliyundrive.com/", + "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" + } + localProxyUrl = 'http://127.0.0.1:UndCover/proxy' + + def redirectResponse(tUrl): + rsp = requests.get(tUrl, allow_redirects=False,verify = False) + if 'Location' in rsp.headers: + return redirectResponse(rsp.headers['Location']) + else: + return rsp + + def getDownloadUrl(self,shareId,token,fileId,category): + lShareId = shareId + lFileId = fileId + params = { + "share_id": lShareId, + "category": "live_transcoding", + "file_id": lFileId, + "template_id": "" + } + customHeader = self.header.copy() + customHeader['x-share-token'] = token + customHeader['authorization'] = self.authorization + url = 'https://api.aliyundrive.com/v2/file/get_share_link_video_preview_play_info' + if category == 'video': + rsp = requests.post(url,json = params,headers=customHeader) + rspJo = json.loads(rsp.text) + lShareId = rspJo['share_id'] + lFileId = rspJo['file_id'] + jo = { + + } + if category == 'video': + jo['share_id'] = lShareId + jo['file_id'] = lFileId + jo['expire_sec'] = 600 + if category == 'audio': + jo['share_id'] = lShareId + jo['file_id'] = lFileId + jo['get_audio_play_info'] = True + downloadUrl = 'https://api.aliyundrive.com/v2/file/get_share_link_download_url' + downloadRsp = requests.post(downloadUrl,json = jo,headers=customHeader) + resultJo = json.loads(downloadRsp.text) + return resultJo['download_url'] + + def getMediaSlice(self,shareId,token,fileId): + params = { + "share_id": shareId, + "category": "live_transcoding", + "file_id": fileId, + "template_id": "" + } + customHeader = self.header.copy() + customHeader['x-share-token'] = token + customHeader['authorization'] = self.authorization + url = 'https://api.aliyundrive.com/v2/file/get_share_link_video_preview_play_info' + + rsp = requests.post(url,json = params,headers=customHeader) + rspJo = json.loads(rsp.text) + + quality = ['FHD','HD','SD'] + videoList = rspJo['video_preview_play_info']['live_transcoding_task_list'] + highUrl = '' + for q in quality: + if len(highUrl) > 0: + break + for video in videoList: + if(video['template_id'] == q): + highUrl = video['url'] + break + if len(highUrl) == 0: + highUrl = videoList[0]['url'] + + noRsp = requests.get(highUrl,headers=self.header, allow_redirects=False,verify = False) + m3u8Url = '' + if 'Location' in noRsp.headers: + m3u8Url = noRsp.headers['Location'] + if 'location' in noRsp.headers and len(m3u8Url) == 0 : + m3u8Url = noRsp.headers['location'] + m3u8Rsp = requests.get(m3u8Url,headers=self.header) + m3u8Content = m3u8Rsp.text + + tmpArray = m3u8Url.split('/')[0:-1] + host = '/'.join(tmpArray) + '/' + + m3u8List = [] + mediaMap = {} + slices = m3u8Content.split("\n") + count = 0 + for slice in slices: + tmpSlice = slice + if 'x-oss-expires' in tmpSlice: + count = count + 1 + mediaMap[str(count)] = host+tmpSlice + + tmpSlice = "{0}?do=push_agent&api=python&type=media&share_id={1}&file_id={2}&media_id={3}".format(self.localProxyUrl,shareId,fileId,count) + m3u8List.append(tmpSlice) + + self.localMedia[fileId] = mediaMap + + return '\n'.join(m3u8List) + + def proxyMedia(self,map): + shareId = map['share_id'] + fileId = map['file_id'] + mediaId = map['media_id'] + shareToken = self.getToken(shareId,'') + + refresh = False + url = '' + ts = 0 + if fileId in self.localMedia: + fileMap = self.localMedia[fileId] + if mediaId in fileMap: + url = fileMap[mediaId] + if len(url) > 0: + ts = int(self.regStr(url,"x-oss-expires=(\\d+)&")) + + # url = self.localMedia[fileId][mediaId] + + # ts = int(self.regStr(url,"x-oss-expires=(\\d+)&")) + + self.localTime = int(time.time()) + + if ts - self.localTime <= 60: + self.getMediaSlice(shareId,shareToken,fileId) + url = self.localMedia[fileId][mediaId] + + action = { + 'url':url, + 'header':self.header, + 'param':'', + 'type':'stream', + 'after':'' + } + print(action) + return [200, "video/MP2T", action, ""] + + def proxyM3U8(self,map): + shareId = map['share_id'] + fileId = map['file_id'] + + shareToken = self.getToken(shareId,'') + content = self.getMediaSlice(shareId,shareToken,fileId) + + action = { + 'url':'', + 'header':'', + 'param':'', + 'type':'string', + 'after':'' + } + + return [200, "application/octet-stream", action, content] + + def localProxy(self,param): + typ = param['type'] + if typ == "m3u8": + return self.proxyM3U8(param) + if typ == "media": + return self.proxyMedia(param) + return None + + def getToken(self,shareId,sharePwd): + self.localTime = int(time.time()) + shareToken = '' + if shareId in self.shareTokenMap: + shareToken = self.shareTokenMap[shareId] + # todo + expire = self.expiresMap[shareId] + if len(shareToken) > 0 and expire - self.localTime > 600: + return shareToken + params = { + 'share_id':shareId, + 'share_pwd':sharePwd + } + url = 'https://api.aliyundrive.com/v2/share_link/get_share_token' + rsp = requests.post(url,json = params,headers=self.header) + jo = json.loads(rsp.text) + newShareToken = jo['share_token'] + self.expiresMap[shareId] = self.localTime + int(jo['expires_in']) + self.shareTokenMap[shareId] = newShareToken + + print(self.expiresMap) + print(self.shareTokenMap) + + return newShareToken + + def listFiles(self,map,shareId,shareToken,fileId): + url = 'https://api.aliyundrive.com/adrive/v3/file/list' + newHeader = self.header.copy() + newHeader['x-share-token'] = shareToken + params = { + 'image_thumbnail_process':'image/resize,w_160/format,jpeg', + 'image_url_process':'image/resize,w_1920/format,jpeg', + 'limit':200, + 'order_by':'updated_at', + 'order_direction':'DESC', + 'parent_file_id':fileId, + 'share_id':shareId, + 'video_thumbnail_process':'video/snapshot,t_1000,f_jpg,ar_auto,w_300' + } + maker = '' + arrayList = [] + for i in range(1,51): + if i >= 2 and len(maker) == 0: + break + params['marker'] = maker + rsp = requests.post(url,json = params,headers=newHeader) + jo = json.loads(rsp.text) + ja = jo['items'] + for jt in ja: + if jt['type'] == 'folder': + arrayList.append(jt['file_id']) + else: + if 'video' in jt['mime_type'] or 'video' in jt['category']: + repStr = jt['name'].replace("#", "_").replace("$", "_") + map[repStr] = shareId + "+" + shareToken + "+" + jt['file_id'] + "+" + jt['category'] + # print(repStr,shareId + "+" + shareToken + "+" + jt['file_id']) + maker = jo['next_marker'] + i = i + 1 + + for item in arrayList: + self.listFiles(map,shareId,shareToken,item) + + def login(self): + self.localTime = int(time.time()) + url = 'https://api.aliyundrive.com/token/refresh' + if len(self.authorization) == 0 or self.timeoutTick - self.localTime <= 600: + form = { + 'refresh_token':'4acb3ad2f2254ba1b566279f7cd98ba3' + } + rsp = requests.post(url,json = form,headers=self.header) + jo = json.loads(rsp.text) + self.authorization = jo['token_type'] + ' ' + jo['access_token'] + self.expiresIn = int(jo['expires_in']) + self.timeoutTick = self.localTime + self.expiresIn + + # print(self.authorization) + # print(self.timeoutTick) + # print(self.localTime) + # print(self.expiresIn) diff --git a/txt/py/py_bilibili.py b/txt/py/py_bilibili.py new file mode 100644 index 0000000000000000000000000000000000000000..7597b37699a1c262a79b1d4f17f9328127bd6863 --- /dev/null +++ b/txt/py/py_bilibili.py @@ -0,0 +1,175 @@ +#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 = { + "Zard": "Zard", + "玩具汽车": "玩具汽车", + "儿童": "儿童", + "幼儿": "幼儿", + "儿童玩具": "儿童玩具", + "昆虫": "昆虫", + "动物世界": "动物世界", + "纪录片": "纪录片", + "相声小品": "相声小品", + "搞笑": "搞笑", + "假窗-白噪音": "窗+白噪音", + "演唱会": "演唱会" + } + 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 + cookies = '' + def getCookie(self): + rsp = self.fetch("https://www.bilibili.com/") + self.cookies = rsp.cookies + return rsp.cookies + def categoryContent(self,tid,pg,filter,extend): + result = {} + url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&duration=4&page={1}'.format(tid,pg) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url,cookies=self.cookies) + content = rsp.text + jo = json.loads(content) + if jo['code'] != 0: + rspRetry = self.fetch(url,cookies=self.getCookie()) + content = rspRetry.text + jo = json.loads(content) + videos = [] + vodList = jo['data']['result'] + for vod in vodList: + aid = str(vod['aid']).strip() + title = vod['title'].strip().replace("","").replace("","") + img = 'https:' + vod['pic'].strip() + remark = str(vod['duration']).strip() + videos.append({ + "vod_id":aid, + "vod_name":title, + "vod_pic":img, + "vod_remarks":remark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def cleanSpace(self,str): + return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','') + def detailContent(self,array): + aid = array[0] + url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid) + + rsp = self.fetch(url,headers=self.header) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + title = jo['title'].replace("","").replace("","") + pic = jo['pic'] + desc = jo['desc'] + typeName = jo['tname'] + vod = { + "vod_id":aid, + "vod_name":title, + "vod_pic":pic, + "type_name":typeName, + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":desc + } + ja = jo['pages'] + playUrl = '' + for tmpJo in ja: + cid = tmpJo['cid'] + part = tmpJo['part'] + playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid) + + vod['vod_play_from'] = 'B站' + vod['vod_play_url'] = playUrl + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + result = { + 'list':[] + } + return result + def playerContent(self,flag,id,vipFlags): + # https://www.555dianying.cc/vodplay/static/js/playerconfig.js + result = {} + + ids = id.split("_") + url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1]) + rsp = self.fetch(url) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + ja = jo['durl'] + + maxSize = -1 + position = -1 + for i in range(len(ja)): + tmpJo = ja[i] + if maxSize < int(tmpJo['size']): + maxSize = int(tmpJo['size']) + position = i + + url = '' + if len(ja) > 0: + if position == -1: + position = 0 + url = ja[position]['url'] + + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = { + "Referer":"https://www.bilibili.com", + "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + result["contentType"] = 'video/x-flv' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_bilimd.py b/txt/py/py_bilimd.py new file mode 100644 index 0000000000000000000000000000000000000000..ba4fd951cec1a2bf115241afda578c602ca12341 --- /dev/null +++ b/txt/py/py_bilimd.py @@ -0,0 +1,213 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json +from requests import session, utils +import os +import time +import base64 + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "B站影视" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + cateManual = { + "番剧": "1", + "国创": "4", + "电影": "2", + "综艺": "7", + "电视剧": "5", + "纪录片": "3" + } + 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 + cookies = '' + def getCookie(self): + cookies_str = "" # 填B站Cookies + cookies_dic = dict([co.strip().split('=') for co in cookies_str.split(';')]) + rsp = session() + cookies_jar = utils.cookiejar_from_dict(cookies_dic) + rsp.cookies = cookies_jar + content = self.fetch("http://api.bilibili.com/x/web-interface/nav", cookies=rsp.cookies) + res = json.loads(content.text) + if res["code"] == 0: + self.cookies = rsp.cookies + else: + rsp = self.fetch("https://www.bilibili.com/") + self.cookies = rsp.cookies + return rsp.cookies + + def categoryContent(self,tid,pg,filter,extend): + result = {} + url = 'https://api.bilibili.com/pgc/season/index/result?order=2&season_status=-1&style_id=-1&sort=0&area=-1&pagesize=20&type=1&st={0}&season_type={0}&page={1}'.format(tid,pg) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url, cookies=self.cookies) + content = rsp.text + jo = json.loads(content) + videos = [] + vodList = jo['data']['list'] + for vod in vodList: + aid = str(vod['season_id']).strip() + title = vod['title'].strip() + img = vod['cover'].strip() + remark = vod['index_show'].strip() + videos.append({ + "vod_id":aid, + "vod_name":title, + "vod_pic":img, + "vod_remarks":remark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def cleanSpace(self,str): + return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','') + def detailContent(self,array): + aid = array[0] + url = "http://api.bilibili.com/pgc/view/web/season?season_id={0}".format(aid) + rsp = self.fetch(url,headers=self.header) + jRoot = json.loads(rsp.text) + jo = jRoot['result'] + id = jo['season_id'] + title = jo['title'] + pic = jo['cover'] + areas = jo['areas'][0]['name'] + typeName = jo['share_sub_title'] + dec = jo['evaluate'] + remark = jo['new_ep']['desc'] + vod = { + "vod_id":id, + "vod_name":title, + "vod_pic":pic, + "type_name":typeName, + "vod_year":"", + "vod_area":areas, + "vod_remarks":remark, + "vod_actor":"", + "vod_director":"", + "vod_content":dec + } + ja = jo['episodes'] + playUrl = '' + for tmpJo in ja: + eid = tmpJo['id'] + cid = tmpJo['cid'] + part = tmpJo['title'].replace("#", "-") + playUrl = playUrl + '{0}${1}_{2}#'.format(part, eid, cid) + + vod['vod_play_from'] = 'B站影视' + vod['vod_play_url'] = playUrl + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=media_bangumi&keyword={0}'.format(key) # 番剧搜索 + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url, cookies=self.cookies) + content = rsp.text + jo = json.loads(content) + rs = jo['data'] + if rs['numResults'] == 0: + url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=media_ft&keyword={0}'.format(key) # 影视搜索 + rspRetry = self.fetch(url, cookies=self.cookies) + content = rspRetry.text + jo = json.loads(content) + videos = [] + vodList = jo['data']['result'] + for vod in vodList: + aid = str(vod['season_id']).strip() + title = vod['title'].strip().replace("", "").replace("", "") + img = vod['eps'][0]['cover'].strip() + remark = vod['index_show'] + videos.append({ + "vod_id": aid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": remark + }) + result = { + 'list': videos + } + return result + + def playerContent(self,flag,id,vipFlags): + result = {} + ids = id.split("_") + header = { + "Referer": "https://www.bilibili.com", + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + url = 'https://api.bilibili.com/pgc/player/web/playurl?qn=116&ep_id={0}&cid={1}'.format(ids[0],ids[1]) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url,cookies=self.cookies,headers=header) + jRoot = json.loads(rsp.text) + if jRoot['message'] != 'success': + print("需要大会员权限才能观看") + return {} + jo = jRoot['result'] + ja = jo['durl'] + maxSize = -1 + position = -1 + for i in range(len(ja)): + tmpJo = ja[i] + if maxSize < int(tmpJo['size']): + maxSize = int(tmpJo['size']) + position = i + + url = '' + if len(ja) > 0: + if position == -1: + position = 0 + url = ja[position]['url'] + + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = { + "Referer":"https://www.bilibili.com", + "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + result["contentType"] = 'video/x-flv' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] diff --git a/txt/py/py_bilivd.py b/txt/py/py_bilivd.py new file mode 100644 index 0000000000000000000000000000000000000000..3c2f33a484becb7963c56ed2aea8b9fa85ff5446 --- /dev/null +++ b/txt/py/py_bilivd.py @@ -0,0 +1,227 @@ +# coding=utf-8 +# !/usr/bin/python +import sys + +sys.path.append('..') +from base.spider import Spider +import json +import requests +from requests import session, utils +import os +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 = { + "搞笑": "搞笑", + "美食": "美食", + "科普": "科普", + "橙子": "半个橙子", + "纪录片": "纪录片", + "演唱会": "演唱会", + "动物世界": "动物世界", + "相声小品": "相声小品", + "假窗-白噪音": "窗+白噪音" + } + 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 + + cookies = '' + + def getCookie(self): + cookies_str = "" # 填B站Cookies + cookies_dic = dict([co.strip().split('=') for co in cookies_str.split(';')]) + rsp = session() + cookies_jar = utils.cookiejar_from_dict(cookies_dic) + rsp.cookies = cookies_jar + content = self.fetch("http://api.bilibili.com/x/web-interface/nav", cookies=rsp.cookies) + res = json.loads(content.text) + if res["code"] == 0: + self.cookies = rsp.cookies + else: + rsp = self.fetch("https://www.bilibili.com/") + self.cookies = rsp.cookies + return rsp.cookies + + def categoryContent(self, tid, pg, filter, extend): + result = {} + url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid, pg) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url, cookies=self.cookies) + content = rsp.text + jo = json.loads(content) + videos = [] + vodList = jo['data']['result'] + for vod in vodList: + aid = str(vod['aid']).strip() + title = vod['title'].strip().replace("", "").replace("", "") + img = 'https:' + vod['pic'].strip() + remark = str(vod['duration']).strip() + videos.append({ + "vod_id": aid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": remark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + + def cleanSpace(self, str): + return str.replace('\n', '').replace('\t', '').replace('\r', '').replace(' ', '') + + def detailContent(self, array): + aid = array[0] + url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid) + rsp = self.fetch(url, headers=self.header) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + title = jo['title'].replace("", "").replace("", "") + pic = jo['pic'] + desc = jo['desc'] + timeStamp = jo['pubdate'] + timeArray = time.localtime(timeStamp) + year = str(time.strftime("%Y", timeArray)) + dire = jo['owner']['name'] + typeName = jo['tname'] + remark = str(jo['duration']).strip() + vod = { + "vod_id": aid, + "vod_name": title, + "vod_pic": pic, + "type_name": typeName, + "vod_year": year, + "vod_area": "", + "vod_remarks": remark, + "vod_actor": "", + "vod_director": dire, + "vod_content": "" + } + ja = jo['pages'] + playUrl = '' + for tmpJo in ja: + cid = tmpJo['cid'] + part = tmpJo['part'].replace("#", "-") + playUrl = playUrl + '{0}${1}_{2}#'.format(part, aid, cid) + + vod['vod_play_from'] = 'B站视频' + vod['vod_play_url'] = playUrl + + result = { + 'list': [ + vod + ] + } + return result + + def searchContent(self, key, quick): + header = { + "Referer": "https://www.bilibili.com", + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}'.format(key) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url, cookies=self.cookies,headers=header) + content = rsp.text + jo = json.loads(content) + if jo['code'] != 0: + rspRetry = self.fetch(url, cookies=self.getCookie()) + content = rspRetry.text + jo = json.loads(content) + videos = [] + vodList = jo['data']['result'] + for vod in vodList: + aid = str(vod['aid']).strip() + title = vod['title'].strip().replace("", "").replace("", "") + img = 'https:' + vod['pic'].strip() + remark = str(vod['duration']).strip() + videos.append({ + "vod_id": aid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": remark + }) + result = { + 'list': videos + } + return result + + def playerContent(self, flag, id, vipFlags): + result = {} + + ids = id.split("_") + url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid={1}&qn=116'.format(ids[0], ids[1]) + if len(self.cookies) <= 0: + self.getCookie() + rsp = self.fetch(url, cookies=self.cookies) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + ja = jo['durl'] + + maxSize = -1 + position = -1 + for i in range(len(ja)): + tmpJo = ja[i] + if maxSize < int(tmpJo['size']): + maxSize = int(tmpJo['size']) + position = i + + url = '' + if len(ja) > 0: + if position == -1: + position = 0 + url = ja[position]['url'] + + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = { + "Referer": "https://www.bilibili.com", + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + result["contentType"] = 'video/x-flv' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self, param): + return [200, "video/MP2T", action, ""] diff --git a/txt/py/py_cctv.py b/txt/py/py_cctv.py new file mode 100644 index 0000000000000000000000000000000000000000..fe578b91fce5073e53f554d8ae2f9cd145c8b4c6 --- /dev/null +++ b/txt/py/py_cctv.py @@ -0,0 +1,138 @@ +#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 diff --git a/txt/py/py_cokemv.py b/txt/py/py_cokemv.py new file mode 100644 index 0000000000000000000000000000000000000000..5c6dc466e8f7dcd7514d443d96739d72090d54ba --- /dev/null +++ b/txt/py/py_cokemv.py @@ -0,0 +1,203 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "Cokemv" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def homeContent(self,filter): + result = {} + cateManual = { + "抖音电影":"5", + "电视剧":"2", + "电影":"1", + "动漫":"4", + "综艺":"3" + } + 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): + rsp = self.fetch("https://cokemv.me/") + root = self.html(rsp.text) + aList = root.xpath("//div[@class='main']//div[contains(@class,'module-items')]/a") + + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('.//img/@data-original')[0] + mark = a.xpath(".//div[@class='module-item-note']/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/voddetail/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + + urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""] + urlParams[0] = tid + urlParams[8] = pg + for key in extend: + urlParams[int(key)] = extend[key] + params = '-'.join(urlParams) + url = 'https://cokemv.me/vodshow/{0}.html'.format(params) + print(url) + rsp = self.fetch(url) + root = self.html(rsp.text) + aList = root.xpath("//div[contains(@class, 'module-items')]/a") + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('.//img/@data-original')[0] + mark = a.xpath(".//div[contains(@class,'module-item-note')]/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/voddetail/(\\d+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://cokemv.me/voddetail/{0}.html'.format(tid) + rsp = self.fetch(url) + root = self.html(rsp.text) + divContent = root.xpath("//div[@class='module-info-main']")[0] + title = divContent.xpath('.//h1/text()')[0] + pic = root.xpath(".//div[@class='module-poster-bg']//img/@data-original")[0] + detail = root.xpath(".//div[@class='module-info-introduction-content']/p/text()")[0] + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":detail + } + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath("//div[@class='module-tab-item tab-item']/span/text()") + for v in vodHeader: + playFrom.append(v) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath("//div[@class='module-play-list']") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./div/a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('.//span/text()')[0] + tId = self.regStr(href,'/vodplay/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + + def searchContent(self,key,quick): + url = 'http://freezdytv.tk/api/search.php?key=free&wd={0}'.format(key) + rsp = self.fetch(url) + ja = json.loads(rsp.text) + result = {} + jArray = [] + for j in ja: + if j['from'] == 'ckmv': + jArray.append({ + "vod_id": j['vid'], + "vod_name": j['title'], + "vod_pic": j['img'], + "vod_remarks": "" + }) + result = { + 'list':jArray + } + return result + + config = { + "player": {"cokemv0555":{"show":"COKEMV","des":"","ps":"0","parse":""},"cokeqie01":{"show":"極速路線","des":"","ps":"0","parse":""},"xin":{"show":"高速路線","des":"","ps":"0","parse":""},"90mm":{"show":"COKEMV(測試)","des":"","ps":"0","parse":""},"toutiao":{"show":"海外路線","des":"","ps":"0","parse":""},"age01":{"show":"動漫一線","des":"","ps":"0","parse":""},"mahua":{"show":"海外(禁國內)","des":"","ps":"0","parse":""},"age02":{"show":"動漫二線","des":"","ps":"0","parse":""}}, + "filter": {"5":[{"key":3,"name":"剧情","value":[{"n":"全部","v":""},{"n":"喜劇","v":"喜劇"},{"n":"愛情","v":"愛情"},{"n":"恐怖","v":"恐怖"},{"n":"動作","v":"動作"},{"n":"科幻","v":"科幻"},{"n":"劇情","v":"劇情"},{"n":"戰爭","v":"戰爭"},{"n":"犯罪","v":"犯罪"},{"n":"動畫","v":"動畫"},{"n":"奇幻","v":"奇幻"},{"n":"恐怖","v":"恐怖"},{"n":"懸疑","v":"懸疑"},{"n":"微電影","v":"微電影"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"國語","v":"國語"},{"n":"英語","v":"英語"},{"n":"粵語","v":"粵語"},{"n":" 閩南語","v":"閩南語"},{"n":"韓語","v":"韓語"},{"n":"日語","v":"日語"},{"n":"法語","v":"法語"},{"n":"德語","v":"德語"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"时间排序","v":"time"},{"n":"人气排序","v":"hits"},{"n":"评分排序","v":"score"}]}],"2":[{"key":0,"name":"类型","value":[{"n":"全部","v":"2"},{"n":"大陸劇","v":"13"},{"n":"香港劇","v":"14"},{"n":"韓國劇","v":"15"},{"n":"歐美劇","v":"16"},{"n":"日本劇","v":"20"},{"n":"台灣劇","v":"21"},{"n":"泰國劇","v":"22"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"韩国","v":"韩国"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"加拿大","v":"加拿大"},{"n":"泰国","v":"泰国"},{"n":"英国","v":"英国"},{"n":"新加坡","v":"新加坡"},{"n":"其他","v":"其他"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"时间排序","v":"time"},{"n":"人气排序","v":"hits"},{"n":"评分排序","v":"score"}]}],"1":[{"key":0,"name":"类型","value":[{"n":"全部","v":"1"},{"n":"動作片","v":"6"},{"n":"喜劇片","v":"7"},{"n":"愛情片","v":"8"},{"n":"科幻片","v":"9"},{"n":"恐怖片","v":"10"},{"n":"劇情片","v":"11"},{"n":"戰爭片","v":"12"},{"n":"犯罪片","v":"23"},{"n":"奇幻片","v":"24"},{"n":"懸疑片","v":"25"},{"n":"記錄片","v":"27"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"韩国","v":"韩国"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"加拿大","v":"加拿大"},{"n":"泰国","v":"泰国"},{"n":"英国","v":"英国"},{"n":"新加坡","v":"新加坡"},{"n":"其他","v":"其他"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"法语","v":"法语"},{"n":"德语","v":"德语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"时间排序","v":"time"},{"n":"人气排序","v":"hits"},{"n":"评分排序","v":"score"}]}],"4":[{"key":0,"name":"类型","value":[{"n":"全部","v":"4"},{"n":"動畫電影","v":"41"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"时间排序","v":"time"},{"n":"人气排序","v":"hits"},{"n":"评分排序","v":"score"}]}],"3":[{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"韩国","v":" 韩国"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩 语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":" 时间排序","v":"time"},{"n":"人气排序","v":"hits"},{"n":"评分排序","v":"score"}]}]} + } + header = { + "origin":"https://cokemv.me", + "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + "Accept":" */*", + "Accept-Language":"zh-CN,zh;q=0.9,en-US;q=0.3,en;q=0.7", + "Accept-Encoding":"gzip, deflate" + } + def playerContent(self,flag,id,vipFlags): + url = 'https://cokemv.me/vodplay/{0}.html'.format(id) + rsp = self.fetch(url) + root = self.html(rsp.text) + scripts = root.xpath("//script/text()") + jo = {} + result = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + parseUrl = "" + playerConfig = self.config['player'] + if jo['from'] in self.config['player']: + playerConfig = self.config['player'][jo['from']] + videoUrl = jo['url'] + playerUrl = playerConfig['parse'] + result["parse"] = playerConfig['ps'] + result["playUrl"] = playerUrl + result["url"] = videoUrl + result["header"] = json.dumps(self.header) + return result + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_czspp.py b/txt/py/py_czspp.py new file mode 100644 index 0000000000000000000000000000000000000000..f20ca3cde9cbaf1aed906eae3577de347d2ee33c --- /dev/null +++ b/txt/py/py_czspp.py @@ -0,0 +1,236 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json +import base64 +from Crypto.Cipher import AES + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "厂长资源" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def homeContent(self,filter): + result = {} + cateManual = { + "豆瓣电影Top250": "dbtop250", + "最新电影": "zuixindianying", + "电视剧": "dsj", + "国产剧": "gcj", + "美剧": "meijutt", + "韩剧": "hanjutv", + "番剧": "fanju", + "动漫": "dm" + } + classes = [] + for k in cateManual: + classes.append({ + 'type_name':k, + 'type_id':cateManual[k] + }) + result['class'] = classes + return result + def homeVideoContent(self): + rsp = self.fetch("https://czspp.com") + root = self.html(rsp.text) + aList = root.xpath("//div[@class='mi_btcon']//ul/li") + videos = [] + for a in aList: + name = a.xpath('./a/img/@alt')[0] + pic = a.xpath('./a/img/@data-original')[0] + mark = a.xpath("./div[@class='hdinfo']/span/text()")[0] + sid = a.xpath("./a/@href")[0] + sid = self.regStr(sid,"/movie/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + url = 'https://czspp.com/{0}/page/{1}'.format(tid,pg) + rsp = self.fetch(url) + root = self.html(rsp.text) + aList = root.xpath("//div[contains(@class,'mi_cont')]//ul/li") + videos = [] + for a in aList: + name = a.xpath('./a/img/@alt')[0] + pic = a.xpath('./a/img/@data-original')[0] + mark = a.xpath("./div[@class='hdinfo']/span/text()")[0] + sid = a.xpath("./a/@href")[0] + sid = self.regStr(sid,"/movie/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://czspp.com/movie/{0}.html'.format(tid) + rsp = self.fetch(url) + root = self.html(rsp.text) + node = root.xpath("//div[@class='dyxingq']")[0] + + pic = node.xpath(".//div[@class='dyimg fl']/img/@src")[0] + title = node.xpath('.//h1/text()')[0] + detail = root.xpath(".//div[@class='yp_context']//p/text()")[0] + + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":detail + } + + infoArray = node.xpath(".//ul[@class='moviedteail_list']/li") + for info in infoArray: + content = info.xpath('string(.)') + if content.startswith('类型'): + vod['type_name'] = content + if content.startswith('年份'): + vod['vod_year'] = content + if content.startswith('地区'): + vod['vod_area'] = content + if content.startswith('豆瓣'): + vod['vod_remarks'] = content + if content.startswith('主演'): + vod['vod_actor'] = content + if content.startswith('导演'): + vod['vod_director'] = content + # if content.startswith('剧情'): + # vod['vod_content'] = content + + vod_play_from = '$$$' + playFrom = ['厂长'] + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath("//div[@class='paly_list_btn']") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('./text()')[0] + tId = self.regStr(href,'/v_play/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + + def searchContent(self,key,quick): + url = 'https://czspp.com/xssearch?q={0}'.format(key) + # getHeader() + rsp = self.fetch(url) + root = self.html(rsp.text) + + result = {} + vodList = root.xpath("//div[contains(@class,'mi_ne_kd')]/ul/li/a") + videos = [] + for vod in vodList: + name = vod.xpath('./img/@alt')[0] + pic = vod.xpath('./img/@data-original')[0] + href = vod.xpath('./@href')[0] + tid = self.regStr(href,'movie/(\\S+).html') + remark = "" + videos.append({ + "vod_id": tid, + "vod_name": name, + "vod_pic": pic, + "vod_remarks": remark + }) + result = { + 'list':videos + } + return result + + config = { + "player": { }, + "filter": { } + } + header = { + "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" + } + + def parseCBC(self, enc, key, iv): + keyBytes = key.encode("utf-8") + ivBytes = iv.encode("utf-8") + cipher = AES.new(keyBytes, AES.MODE_CBC, ivBytes) + msg = cipher.decrypt(enc) + paddingLen = msg[len(msg)-1] + return msg[0:-paddingLen] + + def playerContent(self,flag,id,vipFlags): + url = 'https://czspp.com/v_play/{0}.html'.format(id) + pat = '\\"([^\\"]+)\\";var [\\d\\w]+=function dncry.*md5.enc.Utf8.parse\\(\\"([\\d\\w]+)\\".*md5.enc.Utf8.parse\\(([\\d]+)\\)' + rsp = self.fetch(url) + + html = rsp.text + content = self.regStr(html,pat) + key = self.regStr(html,pat,2) + iv = self.regStr(html,pat,3) + decontent = self.parseCBC(base64.b64decode(content),key,iv).decode() + + urlPat = 'video: \\{url: \\\"([^\\\"]+)\\\"' + vttPat = 'subtitle: \\{url:\\\"([^\\\"]+\\.vtt)\\\"' + + str3 = self.regStr(decontent,urlPat) + str4 = self.regStr(decontent,vttPat) + + self.loadVtt(str3) + + result = { + 'parse':'0', + 'playUrl':'', + 'url':str3, + 'header':'' + } + if len(str4) > 0: + result['subf'] = '/vtt/utf-8' + # result['subt'] = Proxy.localProxyUrl() + "?do=czspp&url=" + URLEncoder.encode(str4) + result['subt'] = '' + return result + + def loadVtt(self,url): + print(url) + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def localProxy(self,param): + action = {} + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_douyu.py b/txt/py/py_douyu.py new file mode 100644 index 0000000000000000000000000000000000000000..3a5c2bb332bee53ba4c299721691dddbacb9cd62 --- /dev/null +++ b/txt/py/py_douyu.py @@ -0,0 +1,138 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +class Spider(Spider): + def getName(self): + return "斗鱼" + def init(self,extend=""): + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + cateManual = { + "热门游戏": "热门游戏", + "主机游戏": "主机游戏", + "原创IP": "原创IP" + } + 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 = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + url = 'http://live.yj1211.work/api/live/getRecommendByPlatformArea?platform=douyu&size=20&area={0}&page={1}'.format(tid, pg) + rsp = self.fetch(url) + content = rsp.text + jo = json.loads(content) + videos = [] + vodList = jo['data'] + for vod in vodList: + aid = (vod['roomId']).strip() + title = vod['roomName'].strip() + img = vod['roomPic'].strip() + remark = (vod['ownerName']).strip() + videos.append({ + "vod_id": aid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": remark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + aid = array[0] + url = "http://live.yj1211.work/api/live/getRoomInfo?platform=douyu&roomId={0}".format(aid) + rsp = self.fetch(url) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + title = jo['roomName'] + pic = jo['roomPic'] + desc = str(jo['online']) + dire = jo['ownerName'] + typeName = jo['categoryName'] + remark = jo['categoryName'] + vod = { + "vod_id": aid, + "vod_name": title, + "vod_pic": pic, + "type_name": typeName, + "vod_year": "", + "vod_area": "", + "vod_remarks": remark, + "vod_actor": '在线人数:' + desc, + "vod_director": dire, + "vod_content": "" + } + playUrl = '原画' + '${0}#'.format(aid) + vod['vod_play_from'] = '斗鱼直播' + vod['vod_play_url'] = playUrl + + result = { + 'list': [ + vod + ] + } + return result + def searchContent(self,key,quick): + result = {} + return result + def playerContent(self,flag,id,vipFlags): + result = {} + url = 'http://live.yj1211.work/api/live/getRealUrl?platform=douyu&roomId={0}'.format(id) + rsp = self.fetch(url) + jRoot = json.loads(rsp.text) + if len(jRoot['data']) == 0: + return {} + jo = jRoot['data'] + ja = jo['OD'] + url = ja + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = { + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + result["contentType"] = 'video/x-flv' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + config = { + "player": {}, + "filter": {} + } + header = {} + def localProxy(self,param): + action = { + 'url':'', + 'header':'', + 'param':'', + 'type':'string', + 'after':'' + } + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_genmov.py b/txt/py/py_genmov.py new file mode 100644 index 0000000000000000000000000000000000000000..b00249b01e3e872a6dde5c8cbf04404248380cfb --- /dev/null +++ b/txt/py/py_genmov.py @@ -0,0 +1,202 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +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): + # genmov + # https://www.genmov.com/v/yinyue.html + result = {} + cateManual = { + "电影":"dianying", + "连续剧":"lianxuju", + "动漫":"dongman", + "综艺":"zongyi", + "少儿":"shaoer", + "音乐":"yinyue" + } + 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): + rsp = self.fetch("https://www.genmov.com/",headers=self.header) + root = self.html(rsp.text) + aList = root.xpath("//div[@class='module module-wrapper']//div[@class='module-item']") + videos = [] + for a in aList: + name = a.xpath(".//div[@class='module-item-pic']/a/@title")[0] + pic = a.xpath(".//div[@class='module-item-pic']/img/@data-src")[0] + mark = a.xpath("./div[@class='module-item-text']/text()")[0] + sid = a.xpath(".//div[@class='module-item-pic']/a/@href")[0] + sid = self.regStr(sid,"/video/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""] + urlParams[0] = tid + urlParams[8] = pg + for key in extend: + urlParams[int(key)] = extend[key] + params = '-'.join(urlParams) + url = 'https://www.genmov.com/vodshow/{0}.html'.format(params) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + aList = root.xpath("//div[@class='module-items']/div[@class='module-item']") + videos = [] + for a in aList: + name = a.xpath(".//div[@class='module-item-pic']/a/@title")[0] + pic = a.xpath(".//div[@class='module-item-pic']/img/@data-src")[0] + mark = a.xpath("./div[@class='module-item-text']/text()")[0] + sid = a.xpath(".//div[@class='module-item-pic']/a/@href")[0] + sid = self.regStr(sid,"/video/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + # video-info-header + tid = array[0] + url = 'https://www.genmov.com/video/{0}.html'.format(tid) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + title = root.xpath(".//h1[@class='page-title']/text()")[0] + pic = root.xpath(".//div[@class='video-cover']//img/@data-src")[0] + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":"" + } + infoArray = root.xpath(".//div[@class='video-info-items']") + for info in infoArray: + content = info.xpath('string(.)') + # if content.startswith('类型'): + # vod['type_name'] = content + # if content.startswith('年份'): + # vod['vod_year'] = content + # if content.startswith('地区'): + # vod['vod_area'] = content + if content.startswith('集数'): + vod['vod_remarks'] = content + if content.startswith('主演'): + vod['vod_actor'] = content + if content.startswith('导演'): + vod['vod_director'] = content + if content.startswith('剧情'): + vod['vod_content'] = content + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath(".//main[@id='main']//div[@class='module-heading']//div[contains(@class,'module-tab-item')]/span/text()") + for v in vodHeader: + playFrom.append(v) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath(".//main[@id='main']//div[contains(@class,'module-list')]//div[@class='sort-item']") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('./span/text()')[0] + tId = self.regStr(href,'/play/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + result = {} + return result + def playerContent(self,flag,id,vipFlags): + # https://www.genmov.com/play/301475-1-1.html + # https://www.genmov.com/static/js/playerconfig.js + url = 'https://www.genmov.com/play/{0}.html'.format(id) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + scripts = root.xpath("//script/text()") + jo = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + result = {} + parseUrl = "" + playerConfig = self.config['player'] + if jo['from'] in self.config['player']: + parser = self.config['player'][jo['from']] + originUrl = jo['url'] + parseUrl = parser['parse'] + + result["parse"] = parser['ps'] + result["playUrl"] = parseUrl + result["url"] = originUrl + result["header"] = '' + return result + + cookie = {} + config = { + "player": {"dplayer":{"show":"默认","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"qqy":{"show":"预告专用","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"qiyi":{"show":"爱奇艺","des":"qiyi.com","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"youku":{"show":"优酷","des":"youku.com","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"qq":{"show":"腾讯","des":"qq.com","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"mgtv":{"show":"芒果","des":"mgtv.com","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"letv":{"show":"乐视","des":"","ps":"1","parse":"https://jx.quanmingjiexi.com/?url="},"m1905":{"show":"电影网","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"bilibili":{"show":"哔哩哔哩","des":"","ps":"1","parse":"https://jx.bozrc.com:4433/player/?url="},"sohu":{"show":"搜狐","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"lzm3u8":{"show":"量子资源1","des":"支持手机电脑在线播放","ps":"0","parse":""},"ss4m3u8":{"show":"松鼠资源4","des":"支持手机电脑在线播放","ps":"0","parse":""},"ss3m3u8":{"show":"松鼠资源3","des":"支持手机电脑在线播放","ps":"0","parse":""},"ss2m3u8":{"show":"松鼠资源2","des":"支持手机电脑在线播放","ps":"0","parse":""},"ss1m3u8":{"show":"松鼠资源1","des":"支持手机电脑在线播放","ps":"0","parse":""},"jinyingm3u8":{"show":"金鹰资源②","des":"支持手机电脑在线播放","ps":"0","parse":""},"cmpyun":{"show":"冠军资源①","des":"支持手机电脑在线播放","ps":"0","parse":""},"kcm3u8":{"show":"快车资源①","des":"支持手机电脑在线播放","ps":"0","parse":""},"xlm3u8":{"show":"新浪资源2","des":"支持手机电脑在线播放","ps":"0","parse":""},"ssyun":{"show":"神速资源1","des":"支持手机电脑在线播放","ps":"0","parse":""},"ssm3u8":{"show":"神速资源2","des":"支持手机电脑在线播放","ps":"0","parse":""},"wolong":{"show":"卧龙资源","des":"支持手机电脑在线播放","ps":"1","parse":"https://vip.2ktvb.com/?url="},"ptzy":{"show":"葡萄资源","des":"支持手机电脑在线播放","ps":"0","parse":""},"zgzy":{"show":"猪哥播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"ukm3u8":{"show":"U酷点播","des":"支持手机电脑在线播放","ps":"0","parse":""},"fsm3u8":{"show":"飞速播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"mim3u8":{"show":"大米播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"if101":{"show":"if101播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"sgm3u8":{"show":"速更播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"kdm3u8":{"show":"酷点播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"xiuse":{"show":"秀色播放","des":"支持手机电脑在线播放","ps":"0","parse":""},"swm3u8":{"show":"丝袜播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"bdxm3u8":{"show":"北斗星m3u8","des":"支持手机电脑在线播放","ps":"0","parse":""},"hjm3u8":{"show":"花椒播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"kbzy":{"show":"快播云播","des":"支持手机电脑在线播放","ps":"0","parse":""},"88zym3u8":{"show":"88在线","des":"支持手机电脑在线播放","ps":"0","parse":""},"lezy":{"show":"乐库云播","des":"支持手机电脑在线播放","ps":"0","parse":""},"kkyun":{"show":"酷酷云播","des":"支持手机电脑在线播放","ps":"0","parse":""},"kkm3u8":{"show":"KK在线","des":"支持手机电脑在线播放","ps":"0","parse":""},"tpm3u8":{"show":"淘片播放器","des":"支持手机电脑在线播放","ps":"0","parse":""},"ckm3u8":{"show":"ck资源","des":"支持手机电脑在线播放","ps":"0","parse":""},"bjyun":{"show":"八戒云播","des":"支持手机电脑在线播放","ps":"0","parse":""},"gsm3u8":{"show":"光速云资源②","des":"支持手机电脑在线播放","ps":"0","parse":""},"m3u8":{"show":"m3u8在线","des":"支持手机电脑在线播放","ps":"0","parse":""},"videojs":{"show":"videojs-H5播放器","des":"videojs.com","ps":"0","parse":""},"iva":{"show":"iva-H5播放器","des":"videojj.com","ps":"0","parse":""},"iframe":{"show":"外链数据","des":"iframe外链数据","ps":"0","parse":""},"link":{"show":"外链数据","des":"外部网站播放链接","ps":"0","parse":""},"swf":{"show":"Flash文件","des":"swf","ps":"0","parse":""},"flv":{"show":"Flv文件","des":"flv","ps":"0","parse":""},"pptv":{"show":"PPTV","des":"pptv","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"migu":{"show":"咪咕","des":"migu","ps":"0","parse":"https://vip.2ktvb.com/player/sg.php?url="},"cctv":{"show":"cctv","des":"cctv","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"cntv":{"show":"cntv","des":"cntv","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"funshion":{"show":"风行","des":"funshion","ps":"1","parse":"hhttps://vip.2ktvb.com/player/sg.php?url="},"wasu":{"show":"华数","des":"wasu","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"605m3u8":{"show":"605线","des":"支持手机电脑在线播放","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"bjm3u8":{"show":"八戒","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"dbm3u8":{"show":"百度线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"hnm3u8":{"show":"牛牛线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"igen":{"show":"爱跟线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"kbm3u8":{"show":"快播线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"lajiao":{"show":"辣椒","des":"","ps":"1","parse":"https://lajiaoapi.com/watch?url="},"tkm3u8":{"show":"天空线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"tsm3u8":{"show":"Ts线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"wjm3u8":{"show":"无尽线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"xigua":{"show":"西瓜线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/sg.php?url="},"xkm3u8":{"show":"想看线","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"jhyun":{"show":"聚合云","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"sdm3u8":{"show":"闪电线","des":"支持手机电脑在线播放","ps":"1","parse":"https://vip.2ktvb.com/player/?url="},"ddzy":{"show":"极速多线","des":"","ps":"1","parse":"https://bo.dd520.cc//xmplayer/?url="},"jscq":{"show":"极速超清","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?xf=languang&url="},"jslg":{"show":"极速蓝光","des":"","ps":"1","parse":"https://vip.2ktvb.com/player/?xf=languang&url="}}, + "filter": {"dianying":[{"key":3,"name":"分类","value":[{"n":"全部","v":""},{"n":"喜剧","v":"喜剧"},{"n":"动作","v":"动作"},{"n":"爱情","v":"爱情"},{"n":"惊悚","v":"惊悚"},{"n":"犯罪","v":"犯罪"},{"n":"冒险","v":"冒险"},{"n":"科幻","v":"科幻"},{"n":"悬疑","v":"悬疑"},{"n":"剧情","v":"剧情"},{"n":"动画","v":"动画"},{"n":"仙侠","v":"仙侠"},{"n":"武侠","v":"武侠"},{"n":"战争","v":"战争"},{"n":"歌舞","v":"歌舞"},{"n":"奇幻","v":"奇幻"},{"n":"传记","v":"传记"},{"n":"警匪","v":"警匪"},{"n":"历史","v":"历史"},{"n":"运动","v":" 运动"},{"n":"伦理","v":"伦理"},{"n":"灾难","v":"灾难"},{"n":"西部","v":"西部"},{"n":"魔幻","v":"魔幻"},{"n":"枪战","v":"枪战"},{"n":"恐怖","v":"恐怖"},{"n":"记录","v":"记录"},{"n":"情色","v":"情色"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"美国","v":"美国"},{"n":"香港","v":"香港"},{"n":"韩国","v":"韩国"},{"n":"英国","v":"英国"},{"n":"台湾","v":"台湾"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"意大利","v":"意大利"},{"n":"德国","v":"德国"},{"n":"西班牙","v":"西班牙"},{"n":"泰国","v":"泰国"},{"n":"其它","v":"其它"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"法语","v":"法语"},{"n":"德语","v":"德语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"lianxuju":[{"key":3,"name":"分类","value":[{"n":" 全部","v":""},{"n":"古装","v":"古装"},{"n":"动作","v":"动作"},{"n":"都市","v":"都市"},{"n":"偶像","v":"偶像"},{"n":"家庭","v":"家庭"},{"n":"警匪","v":"警匪"},{"n":"言情","v":"言情"},{"n":"军事","v":"军事"},{"n":"武侠","v":"武侠"},{"n":"悬疑","v":"悬疑"},{"n":"历史","v":"历史"},{"n":"农村","v":"农村"},{"n":"都市","v":"都市"},{"n":"神话","v":"神话"},{"n":"科幻","v":"科幻"},{"n":"少儿","v":"少儿"},{"n":"搞笑","v":"搞笑"},{"n":"谍战","v":"谍战"},{"n":"战争","v":"战争"},{"n":"年代","v":"年代"},{"n":"犯罪","v":"犯 罪"},{"n":"恐怖","v":"恐怖"},{"n":"惊悚","v":"惊悚"},{"n":"爱情","v":"爱情"},{"n":"剧情","v":"剧情"},{"n":"奇幻","v":"奇幻"},{"n":"仙侠","v":"仙侠"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"泰国","v":"泰国"},{"n":"英国","v":"英国"},{"n":"新加坡","v":"新加坡"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"dongman":[{"key":3,"name":"分类","value":[{"n":"全部","v":""},{"n":"番剧","v":"番剧"},{"n":"国创","v":"国创"},{"n":"热血","v":"热血"},{"n":"科幻","v":"科幻"},{"n":"动画","v":"动画"},{"n":"仙侠","v":"仙侠"},{"n":"修仙","v":"修仙"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":"冒险"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":"社会","v":"社会"},{"n":"原创","v":"原创"},{"n":"亲子","v":"亲子"},{"n":"益智","v":"益智"},{"n":"励志","v":"励志"},{"n":"其他","v":"其他"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"日本","v":"日本"},{"n":"欧美","v":"欧美"},{"n":"其他","v":"其他"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"zongyi":[{"key":3,"name":"分类","value":[{"n":"全部","v":""},{"n":"真人秀","v":"真人秀"},{"n":"访谈","v":"访谈"},{"n":"情感","v":"情感"},{"n":"选秀","v":"选秀"},{"n":"旅游","v":"旅游"},{"n":"美食","v":"美食"},{"n":"口秀","v":"口秀"},{"n":"曲艺","v":"曲艺"},{"n":"搞笑","v":"搞笑"},{"n":"游戏","v":"游戏"},{"n":"歌舞","v":"歌舞"},{"n":"生活","v":"生活"},{"n":"音乐","v":"音乐"},{"n":"时尚","v":"时尚"},{"n":"益智","v":"益智"},{"n":"职场","v":"职场"},{"n":"少儿","v":"少儿"},{"n":"纪实","v":"纪实"},{"n":"盛会","v":"盛会"},{"n":"音乐MV","v":"音乐MV"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"美国","v":"美国"},{"n":"其它","v":"其它"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"shaoer":[{"key":3,"name":"分类","value":[{"n":"全部","v":""},{"n":"历险","v":"历险"},{"n":"奇幻","v":"奇幻"},{"n":"教育","v":"教 育"},{"n":"搞笑","v":"搞笑"},{"n":"教育","v":"教育"},{"n":"益智","v":"益智"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"美国","v":"美国"},{"n":"香港","v":"香港"},{"n":"韩国","v":"韩国"},{"n":"英国","v":"英国"},{"n":"台湾","v":"台湾"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"意大利","v":"意大利"},{"n":"德国","v":"德国"},{"n":"西班牙","v":"西班牙"},{"n":"泰国","v":"泰国"},{"n":"其它","v":"其它"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"},{"n":"粤语","v":"粤语"},{"n":"闽南语","v":"闽南语"},{"n":"韩语","v":"韩语"},{"n":"日语","v":"日语"},{"n":"法语","v":"法语"},{"n":"德语","v":"德语"},{"n":"其它","v":"其它"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"yinyue":[{"key":3,"name":"分类","value":[{"n":"全部","v":""},{"n":"MV","v":"MV"},{"n":"演唱会","v":"演唱会"},{"n":"音频","v":"音频"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"韩国","v":"韩国"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"}]},{"key":4,"name":"语言","value":[{"n":"全部","v":""},{"n":"韩语","v":"韩语"},{"n":"粤语","v":"粤语"},{"n":"日语","v":"日语"},{"n":"英语","v":"英语"},{"n":"泰语","v":"泰语"},{"n":"国语","v":"国语"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}]} + } + header = { + 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.47' + } + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_gimytv.py b/txt/py/py_gimytv.py new file mode 100644 index 0000000000000000000000000000000000000000..669fced579d6087b55bddf04e70c1bb47ce8517d --- /dev/null +++ b/txt/py/py_gimytv.py @@ -0,0 +1,216 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +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): + # https://gimytv.co/ + result = {} + cateManual = { + "电影": "movies", + "电视剧": "tvseries", + "综艺": "tv_show", + "动漫": "anime" + } + 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): + rsp = self.fetch("https://gimytv.co/",headers=self.header) + root = self.html(rsp.text) + aList = root.xpath("//ul[@class='myui-vodlist clearfix']/li/div/a") + videos = [] + for a in aList: + name = a.xpath("./@title")[0] + pic = a.xpath("./@data-original")[0] + mark = a.xpath("./span[contains(@class, 'pic-text')]/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + urlParams = ["", "", "", ""] + urlParams[0] = tid + urlParams[3] = pg + suffix = '' + for key in extend: + if key == 4: + suffix = '/by/'+extend[key] + else: + urlParams[int(key)] = extend[key] + params = '-'.join(urlParams)+suffix + # https://gimytv.co/genre/tvseries--2022-/by/hits_month.html + url = 'https://gimytv.com/genre/{0}.html'.format(params) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + aList = root.xpath("//ul[@class='myui-vodlist clearfix']/li/div/a") + videos = [] + for a in aList: + name = a.xpath("./@title")[0] + pic = a.xpath("./@data-original")[0] + mark = a.xpath("./span[contains(@class, 'pic-text')]/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://gimytv.co/{0}.html'.format(tid) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + node = root.xpath("//div[@class='container']")[0] + title = node.xpath(".//div[@class='myui-content__thumb']/a/@title")[0] + pic = node.xpath(".//div[@class='myui-content__thumb']/a/img/@data-original")[0] + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":"" + } + infoArray = node.xpath(".//div[@class='myui-content__detail']/p") + for info in infoArray: + content = info.xpath('string(.)') + if content.startswith('分類'): + vod['type_name'] = content + # if content.startswith('年份'): + # vod['vod_year'] = content + # if content.startswith('地区'): + # vod['vod_area'] = content + if content.startswith('狀態'): + vod['vod_remarks'] = content + if content.startswith('主演'): + vod['vod_actor'] = content + if content.startswith('導演'): + vod['vod_director'] = content + # if content.startswith('剧情'): + # vod['vod_content'] = content + vod['vod_content'] = node.xpath(".//div[contains(@class,'col-pd')]/p/text()")[0] + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath(".//div[@class='myui-panel_hd']/div/h3/text()[2]") + for v in vodHeader: + playFrom.append(v.strip()) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath(".//ul[contains(@class,'myui-content__list')]") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./li/a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('./text()')[0] + tId = self.regStr(href,'/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + url = "https://gimytv.co/search/-------------.html?wd={0}".format(key) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + aList = root.xpath("//ul[contains(@class,'myui-vodlist__media')]/li") + videos = [] + for a in aList: + name = a.xpath(".//a/@title")[0] + pic = a.xpath(".//a/@data-original")[0] + mark = a.xpath(".//span[contains(@class, 'pic-text')]/text()")[0] + sid = a.xpath(".//a/@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def playerContent(self,flag,id,vipFlags): + url = 'https://gimytv.co/{0}.html'.format(id) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + scripts = root.xpath("//script/text()") + jo = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + url = jo['url'] + result = {} + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = '' + return result + + cookie = {} + config = { + "player": {}, + "filter": {"movies":[{"key":0,"name":"分类","value":[{"n":"全部","v":""},{"n":"劇情片","v":"drama"},{"n":"動作片","v":"action"},{"n":"科幻片","v":"scifi"},{"n":"喜劇片","v":"comedymovie"},{"n":"愛情片","v":"romance"},{"n":"戰爭片","v":"war"},{"n":"恐怖片","v":"horror"},{"n":"動畫電影","v":"animation"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"美國","v":"美國"},{"n":"歐美","v":"歐美"},{"n":"大陸","v":"大陸"},{"n":"中國大陸","v":"中國大陸"},{"n":"韓國","v":"韓國"},{"n":"香港","v":"香港"},{"n":"日本","v":"日本"},{"n":"英國","v":"英國"}]},{"key":2,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":4,"name":"排序","value":[{"n":"按更新","v":"time"},{"n":"周人气","v":"hits_week"},{"n":"月人气","v":"hits_month"}]}],"tvseries":[{"key":0,"name":"分类","value":[{"n":"全部","v":""},{"n":"陸劇","v":"cn"},{"n":"韓劇","v":"kr"},{"n":"美劇","v":"us"},{"n":"日劇","v":"jp"},{"n":"台劇","v":"tw"},{"n":"港劇","v":"hks"},{"n":"海外劇","v":"ot"},{"n":"紀錄片","v":"documentary"}]},{"key":2,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":4,"name":"排序","value":[{"n":"按更新","v":"time"},{"n":"周人气","v":"hits_week"},{"n":"月人气","v":"hits_month"}]}],"anime":[{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"日本"},{"n":"美國","v":"美國"},{"n":"歐美","v":"歐美"},{"n":"大陸","v":"大陸"},{"n":"臺灣","v":"臺灣"},{"n":"香港","v":"香港"}]},{"key":2,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":4,"name":"排序","value":[{"n":"按更新","v":"time"},{"n":"周人气","v":"hits_week"},{"n":"月人气","v":"hits_month"}]}],"tv_show":[{"key":0,"name":"分类","value":[{"n":"全部","v":""},{"n":"纪录片","v":"28"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"大陸","v":"大陸"},{"n":"中國大陸","v":"中國大陸"},{"n":"韓國","v":"韓國"},{"n":"臺灣","v":"臺灣"},{"n":"美國","v":"美國"},{"n":"歐美","v":"歐美"},{"n":"日本","v":"日本"},{"n":"香港","v":"香港"}]},{"key":2,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":4,"name":"排序","value":[{"n":"按更新","v":"time"},{"n":"周人气","v":"hits_week"},{"n":"月人气","v":"hits_month"}]}]} + } + header = { + 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.47' + } + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_gitcafe.py b/txt/py/py_gitcafe.py new file mode 100644 index 0000000000000000000000000000000000000000..5d5b57587a747beaa6337453df19b5e8d5632948 --- /dev/null +++ b/txt/py/py_gitcafe.py @@ -0,0 +1,138 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import requests + +class Spider(Spider): + def getDependence(self): + return ['py_ali'] + def getName(self): + return "py_gitcafe" + def init(self,extend): + self.ali = extend[0] + print("============py_gitcafe============") + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + 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": "其他" + } + classes = [] + for k in cateManual: + classes.append({ + 'type_name':k, + 'type_id':cateManual[k] + }) + result['class'] = classes + return result + def homeVideoContent(self): + result = {} + if len(self.homeData.keys()) == 0: + url = self.baseUrl+'/alipaper/home.json' + self.homeData = self.fetch(url,headers=self.header).json() + cateList = self.homeData['data'] + videos = [] + for cate in cateList: + if cate['info']['code'] in self.category: + vodList = cate['data'] + for vod in vodList: + videos.append({ + "vod_id":"https://www.aliyundrive.com/s/" + vod['key'], + "vod_name":vod['title'], + "vod_pic":'https://txc.gtimg.com/data/375895/2022/0214/d6b96cc3799b6417d30e4715d2973f64.png', + "vod_remarks":'' + }) + result['list']=videos + return result + def categoryContent(self,tid,pg,filter,extend): + url = self.baseUrl+'/tool/alipaper/' + form = { + "action": "viewcat", + "cat": tid, + "num":pg + } + vodList = requests.post(url,headers=self.header,data=form).json() + videos = [] + for vod in vodList: + videos.append({ + "vod_id": 'https://www.aliyundrive.com/s/'+vod["key"], + "vod_name": vod["title"], + "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" + } + category = ['hydm','hyds','hydy','omdm','omds','omdy','rhdm','rhds','rhdy','qtds','qtdy','qtsp','jlp','zyp'] + def detailContent(self,array): + return self.ali.detailContent(newArray) + def searchContent(self,key,quick): + url = self.baseUrl+'/tool/alipaper/' + form = { + "action": "search", + "keyword": key + } + vodList = requests.post(url,headers=self.header,data=form).json() + videos = [] + for vod in vodList: + videos.append({ + "vod_id": 'https://www.aliyundrive.com/s/'+vod["key"], + "vod_name": vod["title"], + "vod_pic": "https://txc.gtimg.com/data/375895/2022/0214/d6b96cc3799b6417d30e4715d2973f64.png", + "vod_remarks": vod['cat'] + }) + return videos + def playerContent(self,flag,id,vipFlags): + return self.ali.playerContent(flag,id,vipFlags) + homeData = {} + baseUrl = 'https://gitcafe.net' + config = { + "player": {}, + "filter": {} + } + header = { + "User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36", + "Referer": "https://u.gitcafe.net/" + } + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_huya.py b/txt/py/py_huya.py new file mode 100644 index 0000000000000000000000000000000000000000..0f126e5b5a65b077b5b149b739cbbd238c9cbc7b --- /dev/null +++ b/txt/py/py_huya.py @@ -0,0 +1,140 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +class Spider(Spider): + def getName(self): + return "虎牙" + def init(self,extend=""): + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + cateManual = { + "音乐": "音乐", + "一起看": "一起看", + "三国杀": "三国杀", + "网游竞技": "网游竞技" + } + 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 = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + url = 'http://live.yj1211.work/api/live/getRecommendByPlatformArea?platform=huya&size=20&area={0}&page={1}'.format(tid, pg) + rsp = self.fetch(url) + content = rsp.text + jo = json.loads(content) + videos = [] + vodList = jo['data'] + for vod in vodList: + aid = (vod['roomId']).strip() + title = vod['roomName'].strip() + img = vod['roomPic'].strip() + remark = (vod['ownerName']).strip() + videos.append({ + "vod_id": aid, + "vod_name": title, + "vod_pic": img, + "vod_remarks": remark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + aid = array[0] + url = "http://live.yj1211.work/api/live/getRoomInfo?platform=huya&roomId={0}".format(aid) + rsp = self.fetch(url) + jRoot = json.loads(rsp.text) + jo = jRoot['data'] + title = jo['roomName'] + pic = jo['roomPic'] + desc = str(jo['online']) + dire = jo['ownerName'] + typeName = jo['categoryName'] + remark = jo['categoryName'] + vod = { + "vod_id": aid, + "vod_name": title, + "vod_pic": pic, + "type_name": typeName, + "vod_year": "", + "vod_area": "", + "vod_remarks": remark, + "vod_actor": '在线人数:' + desc, + "vod_director": dire, + "vod_content": "" + } + playUrl = '原画' + '${0}#'.format(aid) + vod['vod_play_from'] = '虎牙直播' + vod['vod_play_url'] = playUrl + + result = { + 'list': [ + vod + ] + } + return result + def searchContent(self,key,quick): + result = {} + return result + def playerContent(self,flag,id,vipFlags): + result = {} + url = 'https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={0}'.format(id) + rsp = self.fetch(url) + jRoot = json.loads(rsp.text) + if jRoot['data']['liveStatus'] != 'ON': + return {} + jo = jRoot['data'] + ja = jo['stream']['baseSteamInfoList'][0]['sStreamName'] + url = 'http://txtest-xp2p.p2p.huya.com/src/' + ja + '.xs?ratio=4000' + + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = url + result["header"] = { + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + } + result["contentType"] = 'video/x-flv' + return result + + config = { + "player": {}, + "filter": {} + } + header = {} + + config = { + "player": {}, + "filter": {} + } + header = {} + def localProxy(self,param): + action = { + 'url':'', + 'header':'', + 'param':'', + 'type':'string', + 'after':'' + } + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_pansou.py b/txt/py/py_pansou.py new file mode 100644 index 0000000000000000000000000000000000000000..54fab0fc2677026f76464231021fce1852d6ad62 --- /dev/null +++ b/txt/py/py_pansou.py @@ -0,0 +1,92 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider + +class Spider(Spider): + def getDependence(self): + return ['py_ali'] + def getName(self): + return "py_pansou" + def init(self,extend): + self.ali = extend[0] + print("============py_pansou============") + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + return result + def homeVideoContent(self): + result = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + return result + + def detailContent(self,array): + tid = array[0] + print(self.getName()) + pattern = '(https:\\/\\/www.aliyundrive.com\\/s\\/[^\\\"]+)' + url = self.regStr(tid,pattern) + if len(url) > 0: + return self.ali.detailContent(array) + + rsp = self.fetch('https://www.alipansou.com'+tid) + url = self.regStr(rsp.text,pattern) + if len(url) == 0: + return "" + url = url.replace('\\','') + newArray = [url] + print(newArray) + return self.ali.detailContent(newArray) + + + def searchContent(self,key,quick): + map = { + '7':'文件夹', + '1':'视频' + } + ja = [] + for tKey in map.keys(): + url = "https://www.alipansou.com/search?k={0}&t={1}".format(key,tKey) + rsp = self.fetch(url) + root = self.html(self.cleanText(rsp.text)) + aList = root.xpath("//van-row/a") + for a in aList: + title = '' + # title = a.xpath('string(.//template/div)') + # title = self.cleanText(title).strip() + + divList = a.xpath('.//template/div') + for div in divList: + t = div.xpath('string(.)') + t = self.cleanText(t).strip() + title = title + t + if key in title: + pic = 'https://www.alipansou.com'+ self.xpText(a,'.//van-card/@thumb') + jo = { + 'vod_id': a.xpath('@href')[0], + 'vod_name': '[{0}]{1}'.format(key,title), + 'vod_pic': pic + } + ja.append(jo) + result = { + 'list':ja + } + return result + + def playerContent(self,flag,id,vipFlags): + return self.ali.playerContent(flag,id,vipFlags) + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_voflix.py b/txt/py/py_voflix.py new file mode 100644 index 0000000000000000000000000000000000000000..1f606759dc6210e0dc2d1a5532abf150823c6730 --- /dev/null +++ b/txt/py/py_voflix.py @@ -0,0 +1,228 @@ +#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 "Voflix" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + # https://meijuchong.cc/ + result = {} + cateManual = { + "电影": "1", + "剧集": "2", + "综艺": "3", + "动漫": "4" + } + 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): + rsp = self.fetch("https://www.voflix.com/",headers=self.header) + root = self.html(rsp.text) + vodList = root.xpath("//div[@class='module']/div[contains(@class,'tab-list')]//a") + videos = [] + for vod in vodList: + name = vod.xpath("./@title")[0] + pic = vod.xpath(".//img/@data-original")[0] + mark = vod.xpath(".//div[@class='module-item-note']/text()")[0] + sid = vod.xpath("./@href")[0] + sid = self.regStr(sid,"/detail/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + if 'id' not in extend.keys(): + extend['id'] = tid + extend['page'] = pg + filterParams = ["id", "area", "by", "class", "", "", "", "", "page", "", "", "year"] + params = ["", "", "", "", "", "", "", "", "", "", "", ""] + for idx in range(len(filterParams)): + fp = filterParams[idx] + if fp in extend.keys(): + params[idx] = extend[fp] + suffix = '-'.join(params) + url = 'https://www.voflix.com/show/{0}.html'.format(suffix) + + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + vodList = root.xpath("//div[contains(@class, 'module-items')]/a") + videos = [] + for vod in vodList: + name = vod.xpath("./@title")[0] + pic = vod.xpath(".//img/@data-original")[0] + mark = vod.xpath(".//div[contains(@class,'module-item-note')]/text()")[0] + sid = vod.xpath("./@href")[0] + sid = self.regStr(sid,"/detail/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://www.voflix.com/detail/{0}.html'.format(tid) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + node = root.xpath("//div[@class='main']")[0] + title = node.xpath(".//div[@class='module-info-heading']/h1/text()")[0] + pic = root.xpath(".//div[@class='module-item-pic']/img/@data-original")[0] + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":"" + } + infoArray = node.xpath(".//div[@class='module-info-item']") + for info in infoArray: + content = info.xpath('string(.)') + # if content.startswith('分類'): + # vod['type_name'] = content + # if content.startswith('年份'): + # vod['vod_year'] = content + # if content.startswith('地区'): + # vod['vod_area'] = content + if content.startswith('片长'): + vod['vod_remarks'] = content.replace('\n','').replace('\t','') + if content.startswith('主演'): + vod['vod_actor'] = content.replace('\n','').replace('\t','') + if content.startswith('导演'): + vod['vod_director'] = content.replace('\n','').replace('\t','') + # if content.startswith('剧情'): + # vod['vod_content'] = content.replace('\n','').replace('\t','') + vod['vod_content'] = node.xpath(".//div[contains(@class,'module-info-introduction-content')]/p/text()")[0].replace('\n','').replace('\t','') + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath(".//div[contains(@class,'module-tab-items-box')]/div/span/text()") + for v in vodHeader: + playFrom.append(v.strip()) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath(".//div[contains(@class,'module-play-list-content')]") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('.//span/text()')[0] + tId = self.regStr(href,'/play/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + url = "https://www.voflix.com/index.php/ajax/suggest?mid=1&wd={0}".format(key) + rsp = self.fetch(url,headers=self.header) + jo = json.loads(rsp.text) + vodList = jo['list'] + videos = [] + for vod in vodList: + name = vod['name'] + pic = vod['pic'] + mark = '' + sid = vod['id'] + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def playerContent(self,flag,id,vipFlags): + # https://meijuchong.cc/static/js/playerconfig.js + result = {} + url = 'https://www.voflix.com/play/{0}.html'.format(id) + rsp = self.fetch(url,headers=self.header) + root = self.html(rsp.text) + scripts = root.xpath("//script/text()") + jo = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + + parseUrl = 'https://play.shtpin.com/xplay/?url={0}'.format(jo['url']) + parseRsp = self.fetch(parseUrl,headers={'referer':'https://www.voflix.com/'}) + + configStr = self.regStr(parseRsp.text,'var config = ({[\\s\\S]+})') + configJo = json.loads(configStr) + playUrl = 'https://play.shtpin.com/xplay/555tZ4pvzHE3BpiO838.php?tm={0}&url={1}&vkey={2}&token={3}&sign=F4penExTGogdt6U8' + playUrl.format(time.time(),configJo['url'],configJo['vkey'],configJo['token']) + playRsp = self.fetch(playUrl.format(time.time(),configJo['url'],configJo['vkey'],configJo['token']) + ,headers={'referer':'https://www.voflix.com/'}) + playJo = json.loads(playRsp.text) + b64 = playJo['url'][8:] + targetUrl = base64.b64decode(b64)[8:-8].decode() + + result["parse"] = 0 + result["playUrl"] = '' + result["url"] = targetUrl + result["header"] = '' + return result + + config = { + "player": {}, + "filter": {"1":[{"key":"id","name":"类型","value":[{"n":"全部","v":"1"},{"n":"动作","v":"6"},{"n":"喜剧","v":"7"},{"n":"爱情","v":"8"},{"n":"科幻","v":"9"},{"n":"恐怖","v":"10"},{"n":"剧情","v":"11"},{"n":"战争","v":"12"},{"n":"动画","v":"23"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"喜剧","v":"喜剧"},{"n":"爱情","v":"爱情"},{"n":"恐怖","v":"恐怖"},{"n":"动作","v":"动作"},{"n":"科幻","v":"科幻"},{"n":"剧情","v":"剧情"},{"n":"战争","v":"战争"},{"n":"警匪","v":"警匪"},{"n":"犯罪","v":"犯罪"},{"n":"动画","v":"动画"},{"n":"奇幻","v":"奇幻"},{"n":"武侠","v":"武侠"},{"n":"冒险","v":"冒险"},{"n":"枪战","v":"枪战"},{"n":"恐怖","v":"恐怖"},{"n":"悬疑","v":"悬疑"},{"n":"惊悚","v":"惊悚"},{"n":"经典","v":"经典"},{"n":"青春","v":"青春"},{"n":"文艺","v":"文艺"},{"n":"微电影","v":"微电影"},{"n":"古装","v":"古装"},{"n":"历史","v":"历史"},{"n":"运动","v":"运动"},{"n":"农村","v":"农村"},{"n":"儿童","v":"儿童"},{"n":"网络电影","v":"网络电影"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"日本","v":"日本"},{"n":"韩国","v":"韩国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":"印度","v":"印度"},{"n":"意大利","v":"意大利"},{"n":"西班牙","v":"西班牙"},{"n":"加拿大","v":"加拿大"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"2":[{"key":"id","name":"类型","value":[{"n":"全部","v":"2"},{"n":"国产剧","v":"13"},{"n":"港台剧","v":"14"},{"n":"日韩剧","v":"15"},{"n":"欧美剧","v":"16"},{"n":"纪 录片","v":"21"},{"n":"泰国剧","v":"24"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"古装","v":"古装"},{"n":"战争","v":"战争"},{"n":"青春偶像","v":"青春偶像"},{"n":"喜剧","v":"喜剧"},{"n":"家庭","v":"家庭"},{"n":"犯罪","v":"犯罪"},{"n":"动作","v":"动作"},{"n":"奇幻","v":"奇幻"},{"n":"剧情","v":"剧情"},{"n":"历史","v":"历史"},{"n":"经典","v":"经典"},{"n":"乡村","v":"乡村"},{"n":"情景","v":"情景"},{"n":"商战","v":"商战"},{"n":"网剧","v":"网剧"},{"n":"其他","v":"其他"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国台湾","v":"中国台湾"},{"n":"中国香港","v":"中国香港"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"美国","v":"美国"},{"n":"泰国","v":"泰国"},{"n":"英国","v":"英国"},{"n":"新加坡","v":"新加坡"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"3":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"选秀","v":"选秀"},{"n":"情感","v":"情感"},{"n":"访谈","v":"访谈"},{"n":"播报","v":"播报"},{"n":"旅游","v":"旅游"},{"n":"音乐","v":"音乐"},{"n":"美食","v":"美食"},{"n":"纪实","v":"纪实"},{"n":"曲艺","v":"曲艺"},{"n":"生活","v":"生活"},{"n":"游戏互动","v":"游戏互动"},{"n":"财经","v":"财经"},{"n":"求职","v":"求职"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"4":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"情感","v":"情感"},{"n":"科幻","v":"科幻"},{"n":"热血","v":"热血"},{"n":"推理","v":"推理"},{"n":"搞笑","v":"搞笑"},{"n":"冒险","v":" 冒险"},{"n":"萝莉","v":"萝莉"},{"n":"校园","v":"校园"},{"n":"动作","v":"动作"},{"n":"机战","v":"机战"},{"n":"运动","v":"运动"},{"n":"战争","v":"战争"},{"n":"少年","v":"少年"},{"n":"少女","v":"少女"},{"n":" 社会","v":"社会"},{"n":"原创","v":"原创"},{"n":"亲子","v":"亲子"},{"n":"益智","v":"益智"},{"n":"励志","v":"励志"},{"n":"其他","v":"其他"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国","v":"中国"},{"n":"日本","v":"日本"},{"n":"欧美","v":"欧美"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}]} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_xmaomi.py b/txt/py/py_xmaomi.py new file mode 100644 index 0000000000000000000000000000000000000000..83e6b7fa9b19f7c9466468f078eef263d6fef996 --- /dev/null +++ b/txt/py/py_xmaomi.py @@ -0,0 +1,258 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "x小猫咪" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + cateManual = { + "电影":"1", + "电视剧":"2", + "综艺":"3", + "动漫":"4", + "纪录":"5" + } + 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): + tmpRsp = self.fetch("https://xmaomi.net/") + suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") + url = "https://xmaomi.net"+suffix + # self.cookie = rsp.cookies + rsp = self.fetch(url,cookies=tmpRsp.cookies) + root = self.html(rsp.text) + print(rsp.text[0]) + print(root) + aList = root.xpath("//ul[contains(@class,'hl-vod-list')]/li/a") + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('./@data-original')[0] + mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + + urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""] + urlParams[0] = tid + urlParams[8] = pg + for key in extend: + urlParams[int(key)] = extend[key] + params = '-'.join(urlParams) + url = 'https://xmaomi.net/vod_____show/{0}.html'.format(params) + tmpRsp = self.fetch(url) + suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") + url = 'https://xmaomi.net'+suffix + rsp = self.fetch(url,cookies=tmpRsp.cookies) + root = self.html(rsp.text) + print(rsp.text[0]) + print(root) + aList = root.xpath("//ul[contains(@class,'hl-vod-list')]/li/a") + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('./@data-original')[0] + mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://xmaomi.net/{0}.html'.format(tid) + tmpRsp = self.fetch(url) + suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") + url = "https://xmaomi.net"+suffix + rsp = self.fetch(url,cookies=tmpRsp.cookies) + root = self.html(rsp.text) + print(rsp.text[0]) + print(root) + divContent = root.xpath("//div[contains(@class,'hl-full-box')]")[0] + title = divContent.xpath("./div[@class='hl-item-pic']/span/@title")[0] + pic = divContent.xpath("./div[@class='hl-item-pic']/span/@data-original")[0] + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":"" + } + liArray = divContent.xpath(".//li") + for li in liArray: + content = li.xpath('string(.)') + if content.startswith('类型'): + vod['type_name'] = content + if content.startswith('年份'): + vod['vod_year'] = content + if content.startswith('地区'): + vod['vod_area'] = content + if content.startswith('状态'): + vod['vod_remarks'] = content + if content.startswith('主演'): + vod['vod_actor'] = content + if content.startswith('导演'): + vod['vod_director'] = content + if content.startswith('简介'): + vod['vod_content'] = content + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath("//div[contains(@class,'hl-rb-tips')]//span[@class='hl-text-site']/text()") + for v in vodHeader: + playFrom.append(v) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath(".//div[contains(@class,'hl-play-source')]//ul") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./li/a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('string(.)') + tId = self.regStr(href,'/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + def searchContent(self,key,quick): + url = 'https://xmaomi.net/v_search/{0}-------------.html'.format(key) + tmpRsp = self.fetch(url) + suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") + url = "https://xmaomi.net"+suffix + rsp = self.fetch(url,cookies=tmpRsp.cookies) + root = self.html(rsp.text) + print(rsp.text[0]) + print(root) + aList = root.xpath("//ul[contains(@class,'hl-one-list')]/li//a[contains(@class,'hl-item-thumb')]") + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + print(name) + pic = a.xpath('./@data-original')[0] + print(pic) + mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def playerContent(self,flag,id,vipFlags): + url = 'https://xmaomi.net/{0}.html'.format(id) + tmpRsp = self.fetch(url) + suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") + url = "https://xmaomi.net"+suffix + rsp = self.fetch(url,cookies=tmpRsp.cookies) + root = self.html(rsp.text) + print(rsp.text[0]) + print(root) + scripts = root.xpath("//script/text()") + jo = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + parseUrl = "" + print(jo) + htmlUrl = 'https://play.fositv.com/?url={0}&tm={1}&key={2}&next=&title='.format(jo['url'],jo['tm'],jo['key']) + htmlRsp = self.fetch(htmlUrl) + htmlRoot = self.html(htmlRsp.text) + configScripts = htmlRoot.xpath("//script/text()") + configJo = {} + for script in configScripts: + if(script.strip().startswith("var config")): + target = script[script.index('{'):(script.index('}')+1)] + configJo = json.loads(target) + break; + param = { + 'url': configJo['url'], + 'time': configJo['time'], + 'key': configJo['key'] + } + postRsp = self.post('https://play.fositv.com/API.php',param) + resultJo = json.loads(postRsp.text) + result = { + 'parse':0, + 'playUrl':'', + 'url':resultJo['url'], + 'header':{ + 'User-Agent':resultJo['ua'] + } + } + return result + + cookie = {} + config = { + "player": {}, + "filter": {"1":[{"key":0,"name":"分类","value":[{"n":"全部","v":"1"},{"n":"动作","v":"101"},{"n":"喜剧","v":"102"},{"n":"爱情","v":"103"},{"n":"科幻","v":"104"},{"n":"剧情","v":"105"},{"n":"悬疑","v":"106"},{"n":"惊悚","v":"107"},{"n":"恐怖","v":"108"},{"n":"犯罪","v":"109"},{"n":"谍战","v":"110"},{"n":"冒险","v":"111"},{"n":"奇幻","v":"112"},{"n":"灾难","v":"113"},{"n":"战争","v":"114"},{"n":"动画","v":"115"},{"n":"歌舞","v":"116"},{"n":"历史","v":"117"},{"n":"传记","v":"118"},{"n":"纪录","v":"119"},{"n":"其他","v":"120"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":" 印度","v":"印度"},{"n":"其他","v":"其他"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"2":[{"key":0,"name":"分类","value":[{"n":"全部","v":"2"},{"n":"武侠","v":"201"},{"n":"喜剧","v":"202"},{"n":"爱情","v":"203"},{"n":"剧情","v":"204"},{"n":"青春","v":"205"},{"n":"悬疑","v":"206"},{"n":"科幻","v":"207"},{"n":"军事","v":"208"},{"n":"警匪","v":"209"},{"n":"谍战","v":"210"},{"n":"奇幻","v":"211"},{"n":"偶 像","v":"212"},{"n":"年代","v":"213"},{"n":"乡村","v":"214"},{"n":"都市","v":"215"},{"n":"家庭","v":"216"},{"n":"古装","v":"217"},{"n":"历史","v":"218"},{"n":"神话","v":"219"},{"n":"其他","v":"220"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":"印度","v":"印 度"},{"n":"其他","v":"其他"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"3":[{"key":0,"name":"分类","value":[{"n":"全部","v":"3"},{"n":"脱口秀","v":"301"},{"n":"真人秀","v":"302"},{"n":"搞笑","v":"303"},{"n":"访谈","v":"304"},{"n":"生活","v":"305"},{"n":"晚会","v":"306"},{"n":"美食","v":"307"},{"n":"游戏","v":"308"},{"n":"亲子","v":"309"},{"n":"旅游","v":"310"},{"n":"文化","v":"311"},{"n":"体育","v":"312"},{"n":"时尚","v":"313"},{"n":"纪实","v":"314"},{"n":"益智","v":"315"},{"n":"演艺","v":"316"},{"n":"歌舞","v":"317"},{"n":"音乐","v":"318"},{"n":"播报","v":"319"},{"n":"其他","v":"320"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":"印度","v":"印度"},{"n":"其他","v":"其他"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"4":[{"key":0,"name":"分类","value":[{"n":"全部","v":"4"},{"n":"热血","v":"401"},{"n":"格斗","v":"402"},{"n":"恋爱","v":"403"},{"n":"美少女","v":"404"},{"n":"校园","v":"405"},{"n":"搞笑","v":"406"},{"n":"LOLI","v":"407"},{"n":"神魔","v":"408"},{"n":"机战","v":"409"},{"n":"科幻","v":"410"},{"n":"真人","v":"411"},{"n":"青春","v":"412"},{"n":"魔法","v":"413"},{"n":"神话","v":"414"},{"n":"冒险","v":"415"},{"n":"运动","v":"416"},{"n":"竞技","v":"417"},{"n":"童话","v":"418"},{"n":"亲子","v":"419"},{"n":"教育","v":"420"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":"印度","v":"印度"},{"n":"其他","v":"其他"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}],"5":[{"key":0,"name":"分类","value":[{"n":"全部","v":"5"},{"n":"人物","v":"501"},{"n":"军事","v":"502"},{"n":"历史","v":"503"},{"n":"自然","v":"504"},{"n":"探险","v":"505"},{"n":"科技","v":"506"},{"n":"文化","v":"507"},{"n":"刑侦","v":"508"},{"n":"社会","v":"509"},{"n":"旅游","v":"510"},{"n":"其他","v":"511"}]},{"key":1,"name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"中国香港"},{"n":"中国台湾","v":"中国台湾"},{"n":"美国","v":"美国"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"法国","v":"法国"},{"n":"英国","v":"英国"},{"n":"德国","v":"德国"},{"n":"泰国","v":"泰国"},{"n":"印度","v":"印度"},{"n":"其他","v":"其他"}]},{"key":11,"name":"年份","value":[{"n":"全部","v":""},{"n":"2022","v":"2022"},{"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"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":5,"name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0-9","v":"0-9"}]},{"key":2,"name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}]} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_yiso.py b/txt/py/py_yiso.py new file mode 100644 index 0000000000000000000000000000000000000000..4ce5f65257d2a82678bea916d6af707d5f6801e4 --- /dev/null +++ b/txt/py/py_yiso.py @@ -0,0 +1,63 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import requests + +class Spider(Spider): + def getDependence(self): + return ['py_ali'] + def getName(self): + return "py_yiso" + def init(self,extend): + self.ali = extend[0] + print("============py_yiso============") + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + return result + def homeVideoContent(self): + result = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + return result + header = { + "User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36", + "Referer": "https://yiso.fun/" + } + def detailContent(self,array): + return self.ali.detailContent(array) + + def searchContent(self,key,quick): + url = "https://yiso.fun/api/search?name={0}&from=ali".format(key) + vodList = requests.get(url=url, headers=self.header, verify=False).json()["data"]["list"] + videos = [] + for vod in vodList: + videos.append({ + "vod_id": vod["url"], + "vod_name": vod["fileInfos"][0]["fileName"], + "vod_pic": "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000", + "vod_remarks": vod['gmtCreate'] + }) + result = { + 'list':videos + } + return result + + def playerContent(self,flag,id,vipFlags): + return self.ali.playerContent(flag,id,vipFlags) + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_zhaozy.py b/txt/py/py_zhaozy.py new file mode 100644 index 0000000000000000000000000000000000000000..f2039e0a8e399de29548479c9f866dad69dbba11 --- /dev/null +++ b/txt/py/py_zhaozy.py @@ -0,0 +1,85 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider + +class Spider(Spider): + def getDependence(self): + return ['py_ali'] + def getName(self): + return "py_zhaozy" + def init(self,extend): + self.ali = extend[0] + print("============py_zhaozy============") + pass + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def homeContent(self,filter): + result = {} + return result + def homeVideoContent(self): + result = {} + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + return result + 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", + "Referer": "https://zhaoziyuan.me/" + } + def detailContent(self,array): + tid = array[0] + print(self.getName()) + pattern = '(https://www.aliyundrive.com/s/[^\"]+)' + url = self.regStr(tid,pattern) + if len(url) > 0: + return self.ali.detailContent(array) + + rsp = self.fetch('https://zhaoziyuan.me/'+tid) + url = self.regStr(rsp.text,pattern) + if len(url) == 0: + return "" + newArray = [url] + print(newArray) + return self.ali.detailContent(newArray) + + def searchContent(self,key,quick): + map = { + '7':'文件夹', + '1':'视频' + } + ja = [] + for tKey in map.keys(): + url = "https://zhaoziyuan.me/so?filename={0}&t={1}".format(key,tKey) + rsp = self.fetch(url,headers=self.header) + root = self.html(self.cleanText(rsp.text)) + aList = root.xpath("//li[@class='clear']//a") + for a in aList: + # title = a.xpath('./h3/text()')[0] + a.xpath('./p/text()')[0] + title = self.xpText(a,'./h3/text()') + self.xpText(a,'./p/text()') + pic = 'https://img0.baidu.com/it/u=603086994,1727626977&fm=253&fmt=auto?w=500&h=667' + jo = { + 'vod_id': self.xpText(a,'@href'), + 'vod_name': '[{0}]{1}'.format(key,title), + 'vod_pic': pic + } + ja.append(jo) + result = { + 'list':ja + } + return result + + def playerContent(self,flag,id,vipFlags): + return self.ali.playerContent(flag,id,vipFlags) + + config = { + "player": {}, + "filter": {} + } + header = {} + + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/py/py_zxzj.py b/txt/py/py_zxzj.py new file mode 100644 index 0000000000000000000000000000000000000000..aab5bb70805978758daa4b70142a6a8583df771b --- /dev/null +++ b/txt/py/py_zxzj.py @@ -0,0 +1,246 @@ +#coding=utf-8 +#!/usr/bin/python +import sys +sys.path.append('..') +from base.spider import Spider +import json + +class Spider(Spider): # 元类 默认的元类 type + def getName(self): + return "在线之家" + def init(self,extend=""): + print("============{0}============".format(extend)) + pass + def homeContent(self,filter): + result = {} + cateManual = { + "电影":"1", + "美剧":"2", + "韩剧":"3", + "日剧":"4", + "泰剧":"5", + "动漫":"6" + } + 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): + rsp = self.fetch("https://zxzj.vip/") + root = self.html(rsp.text) + aList = root.xpath("//div[@class='stui-vodlist__box']/a") + + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('./@data-original')[0] + mark = a.xpath("./span[@class='pic-text text-right']/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/detail/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + result = { + 'list':videos + } + return result + def categoryContent(self,tid,pg,filter,extend): + result = {} + if 'id' not in extend.keys(): + extend['id'] = tid + extend['page'] = pg + filterParams = ["id", "area", "by", "class", "lang", "", "", "", "page", "", "", "year"] + params = ["", "", "", "", "", "", "", "", "", "", "", ""] + for idx in range(len(filterParams)): + fp = filterParams[idx] + if fp in extend.keys(): + params[idx] = extend[fp] + suffix = '-'.join(params) + url = 'https://zxzj.vip/vodshow/{0}.html'.format(suffix) + rsp = self.fetch(url) + root = self.html(rsp.text) + aList = root.xpath("//div[@class='stui-vodlist__box']/a") + videos = [] + for a in aList: + name = a.xpath('./@title')[0] + pic = a.xpath('./@data-original')[0] + mark = a.xpath("./span[@class='pic-text text-right']/text()")[0] + sid = a.xpath("./@href")[0] + sid = self.regStr(sid,"/detail/(\\S+).html") + videos.append({ + "vod_id":sid, + "vod_name":name, + "vod_pic":pic, + "vod_remarks":mark + }) + + result['list'] = videos + result['page'] = pg + result['pagecount'] = 9999 + result['limit'] = 90 + result['total'] = 999999 + return result + def detailContent(self,array): + tid = array[0] + url = 'https://zxzj.vip/detail/{0}.html'.format(tid) + rsp = self.fetch(url) + root = self.html(rsp.text) + node = root.xpath("//div[@class='stui-content']")[0] + + pic = node.xpath(".//img/@data-original")[0] + title = node.xpath('.//h1/text()')[0] + detail = node.xpath(".//span[@class='detail-content']/text()")[0] + + vod = { + "vod_id":tid, + "vod_name":title, + "vod_pic":pic, + "type_name":"", + "vod_year":"", + "vod_area":"", + "vod_remarks":"", + "vod_actor":"", + "vod_director":"", + "vod_content":detail + } + + infoArray = node.xpath(".//div[@class='stui-content__detail']/p") + for info in infoArray: + content = info.xpath('string(.)') + if content.startswith('类型'): + vod['type_name'] = content + # if content.startswith('年份'): + # vod['vod_year'] = content + # if content.startswith('地区'): + # vod['vod_area'] = content + # if content.startswith('更新'): + # vod['vod_remarks'] = content.replace('\n','').replace('\t','') + if content.startswith('主演'): + vod['vod_actor'] = content.replace('\n','').replace('\t','') + if content.startswith('导演'): + vod['vod_director'] = content.replace('\n','').replace('\t','') + # if content.startswith('剧情'): + # vod['vod_content'] = content.replace('\n','').replace('\t','') + + vod_play_from = '$$$' + playFrom = [] + vodHeader = root.xpath("//div[@class='stui-vodlist__head']/h3/text()") + for v in vodHeader: + playFrom.append(v) + vod_play_from = vod_play_from.join(playFrom) + + vod_play_url = '$$$' + playList = [] + vodList = root.xpath("//ul[contains(@class,'stui-content__playlist')]") + for vl in vodList: + vodItems = [] + aList = vl.xpath('./li/a') + for tA in aList: + href = tA.xpath('./@href')[0] + name = tA.xpath('./text()')[0] + tId = self.regStr(href,'/video/(\\S+).html') + vodItems.append(name + "$" + tId) + joinStr = '#' + joinStr = joinStr.join(vodItems) + playList.append(joinStr) + vod_play_url = vod_play_url.join(playList) + + vod['vod_play_from'] = vod_play_from + vod['vod_play_url'] = vod_play_url + + result = { + 'list':[ + vod + ] + } + return result + + def searchContent(self,key,quick): + url = 'https://zxzj.vip/index.php/ajax/suggest?mid=1&wd={0}'.format(key) + # getHeader() + rsp = self.fetch(url) + jo = json.loads(rsp.text) + result = {} + jArray = [] + if int(jo['total']) > 0: + for j in jo['list']: + jArray.append({ + "vod_id": j['id'], + "vod_name": j['name'], + "vod_pic": j['pic'], + "vod_remarks": "" + }) + result = { + 'list':jArray + } + return result + + config = { + "player": { + "dpp": { + "sh": "DP播放", + "pu": "https://jx.zxzj.vip/dplayer.php?url=", + "sn": 1, + "or": 999 + } + }, + "filter": {"1": [{"key": "class", "name": "剧情", "value": [{"n": "全部", "v": ""}, {"n": "喜剧", "v": "喜剧"}, {"n": "爱情", "v": "爱情"}, {"n": "恐怖", "v": "恐怖"}, {"n": "动作", "v": "动作"}, {"n": "科幻", "v": "科幻"}, {"n": "剧情", "v": "剧情"}, {"n": "战争", "v": "战争"}, {"n": "警匪", "v": "警匪"}, {"n": "犯罪", "v": "犯罪"}, {"n": "动画", "v": "动画"}, {"n": "奇幻", "v": "奇幻"}, {"n": "冒险", "v": "冒险"}, {"n": "恐怖", "v": "恐怖"}, {"n": "悬疑", "v": "悬疑"}, {"n": "惊悚", "v": "惊悚"}, {"n": "青春", "v": "青春"}, {"n": "情色", "v": "情色"}]}, {"key": "area", "name": "地区", "value": [{"n": "全部", "v": ""}, {"n": "大陆", "v": "大陆"}, {"n": "香港", "v": "香港"}, {"n": "台湾", "v": "台湾"}, {"n": "欧美", "v": "欧美"}, {"n": "韩国", "v": "韩国"}, {"n": "日本", "v": "日本"}, {"n": "泰国", "v": "泰国"}, {"n": "印度", "v": "印度"}, {"n": "俄罗斯", "v": "俄罗斯"}, {"n": "其他", "v": "其他"}]}, {"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2007", "v": "2007"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}, {"n": "2003", "v": "2003"}, {"n": "2002", "v": "2002"}, {"n": "2001", "v": "2001"}, {"n": "2000", "v": "2000"}]}, {"key": "lang", "name": "语言", "value": [{"n": "全部", "v": ""}, {"n": "英语", "v": "英语"}, {"n": "韩语", "v": "韩语"}, {"n": "日语", "v": "日语"}, {"n": "法语", "v": "法语"}, {"n": "泰语", "v": "泰语"}, {"n": "德语", "v": "德语"}, {"n": "印度语", "v": "印度语"}, {"n": "国语", "v": "国语"}, {"n": "粤 语", "v": "粤语"}, {"n": "俄语", "v": "俄语"}, {"n": "西班牙语", "v": "西班牙语"}, {"n": "意大利语", "v": "意大利语"}, {"n": "其它", "v": "其它"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}], "2": [{"key": "class", "name": "剧情", "value": [{"n": "全部", "v": ""}, {"n": "剧 情", "v": "剧情"}, {"n": "喜剧", "v": "喜剧"}, {"n": "爱情", "v": "爱情"}, {"n": "动作", "v": "动作"}, {"n": "悬疑", "v": "悬疑"}, {"n": "恐怖", "v": "恐怖"}, {"n": "奇幻", "v": "奇幻"}, {"n": "惊悚", "v": "惊悚"}, {"n": "犯罪", "v": "犯罪"}, {"n": "科幻", "v": "科幻"}, {"n": "音乐", "v": "音乐"}, {"n": "其他", "v": "其他"}]}, {"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}]}, {"key": "lang", "name": "语言", "value": [{"n": "全部", "v": ""}, {"n": "英语", "v": "英语"}, {"n": "法语", "v": "法语"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}], "3": [{"key": "class", "name": "剧情", "value": [{"n": "全部", "v": ""}, {"n": "剧情", "v": "剧情"}, {"n": "喜剧", "v": "喜剧"}, {"n": "爱情", "v": "爱情"}, {"n": "动 作", "v": "动作"}, {"n": "悬疑", "v": "悬疑"}, {"n": "恐怖", "v": "恐怖"}, {"n": "奇幻", "v": "奇幻"}, {"n": "惊悚", "v": "惊悚"}, {"n": "犯罪", "v": "犯罪"}, {"n": "科幻", "v": "科幻"}, {"n": "音乐", "v": "音乐"}, {"n": "其他", "v": "其他"}]}, {"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2007", "v": "2007"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}, {"n": "2003", "v": "2003"}, {"n": "2002", "v": "2002"}, {"n": "2001", "v": "2001"}, {"n": "2000", "v": "2000"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}], "4": [{"key": "class", "name": "剧情", "value": [{"n": "全部", "v": ""}, {"n": "剧情", "v": "剧情"}, {"n": "喜剧", "v": "喜剧"}, {"n": "爱情", "v": "爱情"}, {"n": "动作", "v": "动作"}, {"n": "悬疑", "v": "悬疑"}, {"n": "恐怖", "v": "恐怖"}, {"n": "奇幻", "v": "奇幻"}, {"n": "惊悚", "v": "惊悚"}, {"n": "犯罪", "v": "犯罪"}, {"n": "科幻", "v": "科幻"}, {"n": "音乐", "v": "音乐"}, {"n": "其他", "v": "其他"}]}, {"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2007", "v": "2007"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}, {"n": "2003", "v": "2003"}, {"n": "2002", "v": "2002"}, {"n": "2001", "v": "2001"}, {"n": "2000", "v": "2000"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}], "5": [{"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2007", "v": "2007"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}, {"n": "2003", "v": "2003"}, {"n": "2002", "v": "2002"}, {"n": "2001", "v": "2001"}, {"n": "2000", "v": "2000"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}], "6": [{"key": "class", "name": "剧情", "value": [{"n": "全部", "v": ""}, {"n": "情感", "v": "情感"}, {"n": "科幻", "v": "科幻"}, {"n": "热血", "v": "热血"}, {"n": "推理", "v": " 推理"}, {"n": "搞笑", "v": "搞笑"}, {"n": "冒险", "v": "冒险"}, {"n": "萝莉", "v": "萝莉"}, {"n": "校园", "v": "校园"}, {"n": "动作", "v": "动作"}, {"n": "机战", "v": "机战"}, {"n": "运动", "v": "运动"}, {"n": "战争", "v": "战争"}, {"n": " 少年", "v": "少年"}, {"n": "少女", "v": "少女"}, {"n": "社会", "v": "社会"}, {"n": "原创", "v": "原创"}, {"n": "亲子", "v": "亲子"}, {"n": "益智", "v": "益智"}, {"n": "励志", "v": "励志"}, {"n": "其他", "v": "其他"}]}, {"key": "area", "name": "地区", "value": [{"n": "全部", "v": ""}, {"n": "国产", "v": "国产"}, {"n": "日本", "v": "日本"}, {"n": "欧美", "v": "欧美"}, {"n": "其他", "v": "其他"}]}, {"key": "lang", "name": "语言", "value": [{"n": "全部", "v": ""}, {"n": "国语", "v": "国语"}, {"n": "日语", "v": "日语"}, {"n": "英语", "v": "英语"}, {"n": "其他", "v": "其他"}]}, {"key": "year", "name": "年份", "value": [{"n": "全部", "v": ""}, {"n": "2022", "v": "2022"}, {"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"}, {"n": "2008", "v": "2008"}, {"n": "2007", "v": "2007"}, {"n": "2006", "v": "2006"}, {"n": "2005", "v": "2005"}, {"n": "2004", "v": "2004"}, {"n": "2003", "v": "2003"}, {"n": "2002", "v": "2002"}, {"n": "2001", "v": "2001"}, {"n": "2000", "v": "2000"}]}, {"key": "by", "name": "排序", "value": [{"n": "最新", "v": "time"}, {"n": "最热", "v": "hits"}, {"n": "评分", "v": "score"}]}]} + } + header = { + "origin":"https://zxzj.vip", + "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + "Accept":" */*", + "Accept-Language":"zh-CN,zh;q=0.9,en-US;q=0.3,en;q=0.7", + "Accept-Encoding":"gzip, deflate" + } + def playerContent(self,flag,id,vipFlags): + result = {} + url = 'https://zxzj.vip/video/{0}.html'.format(id) + rsp = self.fetch(url) + root = self.html(rsp.text) + scripts = root.xpath("//script/text()") + jo = {} + for script in scripts: + if(script.startswith("var player_")): + target = script[script.index('{'):] + jo = json.loads(target) + break; + parseUrl = '' + # src="(\S+url=) + # playerConfig = self.config['player'] + # if jo['from'] in self.config['player']: + # playerConfig = self.config['player'][jo['from']] + # parseUrl = playerConfig['pu'] + jo['url'] + scriptUrl = 'https://zxzj.vip/static/player/{0}.js'.format(jo['from']) + scriptRsp = self.fetch(scriptUrl) + parseUrl = self.regStr(scriptRsp.text,'src="(\\S+url=)') + if len(parseUrl) > 0: + parseRsp = self.fetch(parseUrl+jo['url']) + realUrl = self.regStr(parseRsp.text,"(?<=urls\\s=\\s').*?(?=')",0) + if len(realUrl) > 0 : + result["parse"] = 0 + result["playUrl"] = "" + result["url"] = realUrl + result["header"] = json.dumps(self.header) + else: + result["parse"] = 1 + result["playUrl"] = "" + result["url"] = jo['url'] + result["header"] = json.dumps(self.header) + return result + def isVideoFormat(self,url): + pass + def manualVideoCheck(self): + pass + def localProxy(self,param): + return [200, "video/MP2T", action, ""] \ No newline at end of file diff --git a/txt/pycms0.json b/txt/pycms0.json index 642399e2731fe6361d8006344102abacdcbb9a0e..b95ea2e65f0e0247f68a7d8116e985c75997b5eb 100644 --- a/txt/pycms0.json +++ b/txt/pycms0.json @@ -1,6 +1,6 @@ { "wallpaper": "http://localhost:5705/pics", - "dr_count": 21, + "dr_count": 28, "mode": 0, "spider": "http://localhost:5705/liveslib", "drives": [ @@ -137,8 +137,8 @@ "name": "360影视(道长)", "type": 1, "api": "http://localhost:5705/vod?rule=360影视", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -150,6 +150,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_AnFuns", + "name": "AnFuns(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=AnFuns", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_cokemv", "name": "cokemv(道长)", @@ -159,6 +168,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_l0l", + "name": "l0l(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=l0l", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_LIBVIO", "name": "LIBVIO(道长)", @@ -204,6 +222,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_吸瓜", + "name": "吸瓜(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=吸瓜", + "searchable": 0, + "quickSearch": 0, + "filterable": 0 + }, { "key": "dr_喵喵", "name": "喵喵(道长)", @@ -231,6 +258,24 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_奇珍异兽", + "name": "奇珍异兽(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=奇珍异兽", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, + { + "key": "dr_小猫咪", + "name": "小猫咪(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=小猫咪", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_干饭影视", "name": "干饭影视(道长)", @@ -285,6 +330,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_腾云驾雾", + "name": "腾云驾雾(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=腾云驾雾", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_莫扎兔", "name": "莫扎兔(道长)", @@ -312,6 +366,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_追剧喵", + "name": "追剧喵(道长)", + "type": 1, + "api": "http://localhost:5705/vod?rule=追剧喵", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_鸭奈飞", "name": "鸭奈飞(道长)", @@ -320,11 +383,191 @@ "searchable": 1, "quickSearch": 1, "filterable": 0 + }, + { + "key": "py_ali", + "name": "py_ali(Pyramid)", + "type": 3, + "api": "py_ali", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_ali.py" + }, + { + "key": "py_bilibili", + "name": "py_bilibili(Pyramid)", + "type": 3, + "api": "py_bilibili", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_bilibili.py" + }, + { + "key": "py_bilimd", + "name": "py_bilimd(Pyramid)", + "type": 3, + "api": "py_bilimd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_bilimd.py" + }, + { + "key": "py_bilivd", + "name": "py_bilivd(Pyramid)", + "type": 3, + "api": "py_bilivd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_bilivd.py" + }, + { + "key": "py_cctv", + "name": "py_cctv(Pyramid)", + "type": 3, + "api": "py_cctv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_cctv.py" + }, + { + "key": "py_cokemv", + "name": "py_cokemv(Pyramid)", + "type": 3, + "api": "py_cokemv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_cokemv.py" + }, + { + "key": "py_czspp", + "name": "py_czspp(Pyramid)", + "type": 3, + "api": "py_czspp", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_czspp.py" + }, + { + "key": "py_douyu", + "name": "py_douyu(Pyramid)", + "type": 3, + "api": "py_douyu", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_douyu.py" + }, + { + "key": "py_genmov", + "name": "py_genmov(Pyramid)", + "type": 3, + "api": "py_genmov", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_genmov.py" + }, + { + "key": "py_gimytv", + "name": "py_gimytv(Pyramid)", + "type": 3, + "api": "py_gimytv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_gimytv.py" + }, + { + "key": "py_gitcafe", + "name": "py_gitcafe(Pyramid)", + "type": 3, + "api": "py_gitcafe", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_gitcafe.py" + }, + { + "key": "py_huya", + "name": "py_huya(Pyramid)", + "type": 3, + "api": "py_huya", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_huya.py" + }, + { + "key": "py_pansou", + "name": "py_pansou(Pyramid)", + "type": 3, + "api": "py_pansou", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_pansou.py" + }, + { + "key": "py_voflix", + "name": "py_voflix(Pyramid)", + "type": 3, + "api": "py_voflix", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_voflix.py" + }, + { + "key": "py_xmaomi", + "name": "py_xmaomi(Pyramid)", + "type": 3, + "api": "py_xmaomi", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_xmaomi.py" + }, + { + "key": "py_yiso", + "name": "py_yiso(Pyramid)", + "type": 3, + "api": "py_yiso", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_yiso.py" + }, + { + "key": "py_zhaozy", + "name": "py_zhaozy(Pyramid)", + "type": 3, + "api": "py_zhaozy", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_zhaozy.py" + }, + { + "key": "py_zxzj", + "name": "py_zxzj(Pyramid)", + "type": 3, + "api": "py_zxzj", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://localhost:5705/txt/py/py_zxzj.py" } ], "parses": [ { - "name": "免解嗅探", + "name": "🌐Ⓤ", "type": 0, "url": "", "header": { @@ -332,13 +575,75 @@ } }, { - "name": "免解JSON", + "name": "🌀Ⓙ", "type": 1, "url": "", "header": { "User-Agent": "Mozilla/5.0" } }, + { + "name": "轮询", + "url": "Sequence", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, + { + "name": "并发", + "url": "Parallel", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, { "name": "BT5V", "url": "https://rx.bt5v.com/json/jsonindex.php/?url=", @@ -462,6 +767,37 @@ "User-Agent": "Mozilla/5.0" } } + }, + { + "name": "虾米", + "url": "https://dm.xmflv.com:4433/?url=", + "type": 0, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } } ], "flags": [ diff --git a/txt/pycms1.json b/txt/pycms1.json index 12cdc8fed1cb6d8941cd8ef7a68857e07351ae8c..4e449711f4625d6e567c60d85241214f77b44c5d 100644 --- a/txt/pycms1.json +++ b/txt/pycms1.json @@ -1,6 +1,6 @@ { "wallpaper": "http://192.168.3.224:5705/pics", - "dr_count": 21, + "dr_count": 28, "mode": 1, "spider": "http://192.168.3.224:5705/liveslib", "drives": [ @@ -137,8 +137,8 @@ "name": "360影视(道长)", "type": 1, "api": "http://192.168.3.224:5705/vod?rule=360影视", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -150,6 +150,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_AnFuns", + "name": "AnFuns(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=AnFuns", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_cokemv", "name": "cokemv(道长)", @@ -159,6 +168,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_l0l", + "name": "l0l(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=l0l", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_LIBVIO", "name": "LIBVIO(道长)", @@ -204,6 +222,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_吸瓜", + "name": "吸瓜(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=吸瓜", + "searchable": 0, + "quickSearch": 0, + "filterable": 0 + }, { "key": "dr_喵喵", "name": "喵喵(道长)", @@ -231,6 +258,24 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_奇珍异兽", + "name": "奇珍异兽(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=奇珍异兽", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, + { + "key": "dr_小猫咪", + "name": "小猫咪(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=小猫咪", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_干饭影视", "name": "干饭影视(道长)", @@ -285,6 +330,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_腾云驾雾", + "name": "腾云驾雾(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=腾云驾雾", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_莫扎兔", "name": "莫扎兔(道长)", @@ -312,6 +366,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_追剧喵", + "name": "追剧喵(道长)", + "type": 1, + "api": "http://192.168.3.224:5705/vod?rule=追剧喵", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_鸭奈飞", "name": "鸭奈飞(道长)", @@ -320,11 +383,191 @@ "searchable": 1, "quickSearch": 1, "filterable": 0 + }, + { + "key": "py_ali", + "name": "py_ali(Pyramid)", + "type": 3, + "api": "py_ali", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_ali.py" + }, + { + "key": "py_bilibili", + "name": "py_bilibili(Pyramid)", + "type": 3, + "api": "py_bilibili", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_bilibili.py" + }, + { + "key": "py_bilimd", + "name": "py_bilimd(Pyramid)", + "type": 3, + "api": "py_bilimd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_bilimd.py" + }, + { + "key": "py_bilivd", + "name": "py_bilivd(Pyramid)", + "type": 3, + "api": "py_bilivd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_bilivd.py" + }, + { + "key": "py_cctv", + "name": "py_cctv(Pyramid)", + "type": 3, + "api": "py_cctv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_cctv.py" + }, + { + "key": "py_cokemv", + "name": "py_cokemv(Pyramid)", + "type": 3, + "api": "py_cokemv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_cokemv.py" + }, + { + "key": "py_czspp", + "name": "py_czspp(Pyramid)", + "type": 3, + "api": "py_czspp", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_czspp.py" + }, + { + "key": "py_douyu", + "name": "py_douyu(Pyramid)", + "type": 3, + "api": "py_douyu", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_douyu.py" + }, + { + "key": "py_genmov", + "name": "py_genmov(Pyramid)", + "type": 3, + "api": "py_genmov", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_genmov.py" + }, + { + "key": "py_gimytv", + "name": "py_gimytv(Pyramid)", + "type": 3, + "api": "py_gimytv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_gimytv.py" + }, + { + "key": "py_gitcafe", + "name": "py_gitcafe(Pyramid)", + "type": 3, + "api": "py_gitcafe", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_gitcafe.py" + }, + { + "key": "py_huya", + "name": "py_huya(Pyramid)", + "type": 3, + "api": "py_huya", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_huya.py" + }, + { + "key": "py_pansou", + "name": "py_pansou(Pyramid)", + "type": 3, + "api": "py_pansou", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_pansou.py" + }, + { + "key": "py_voflix", + "name": "py_voflix(Pyramid)", + "type": 3, + "api": "py_voflix", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_voflix.py" + }, + { + "key": "py_xmaomi", + "name": "py_xmaomi(Pyramid)", + "type": 3, + "api": "py_xmaomi", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_xmaomi.py" + }, + { + "key": "py_yiso", + "name": "py_yiso(Pyramid)", + "type": 3, + "api": "py_yiso", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_yiso.py" + }, + { + "key": "py_zhaozy", + "name": "py_zhaozy(Pyramid)", + "type": 3, + "api": "py_zhaozy", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_zhaozy.py" + }, + { + "key": "py_zxzj", + "name": "py_zxzj(Pyramid)", + "type": 3, + "api": "py_zxzj", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://192.168.3.224:5705/txt/py/py_zxzj.py" } ], "parses": [ { - "name": "免解嗅探", + "name": "🌐Ⓤ", "type": 0, "url": "", "header": { @@ -332,13 +575,75 @@ } }, { - "name": "免解JSON", + "name": "🌀Ⓙ", "type": 1, "url": "", "header": { "User-Agent": "Mozilla/5.0" } }, + { + "name": "轮询", + "url": "Sequence", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, + { + "name": "并发", + "url": "Parallel", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, { "name": "BT5V", "url": "https://rx.bt5v.com/json/jsonindex.php/?url=", @@ -462,6 +767,37 @@ "User-Agent": "Mozilla/5.0" } } + }, + { + "name": "虾米", + "url": "https://dm.xmflv.com:4433/?url=", + "type": 0, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } } ], "flags": [ diff --git a/txt/pycms2.json b/txt/pycms2.json index f59adba8117e78ed9dbe2ebe47b5f2bc6c53289c..8606bf9881346b2d4da4d69ca43e3b71ebcb3cf4 100644 --- a/txt/pycms2.json +++ b/txt/pycms2.json @@ -1,6 +1,6 @@ { "wallpaper": "http://cms.nokia.press/pics", - "dr_count": 21, + "dr_count": 28, "mode": 1, "spider": "http://cms.nokia.press/liveslib", "drives": [ @@ -137,8 +137,8 @@ "name": "360影视(道长)", "type": 1, "api": "http://cms.nokia.press/vod?rule=360影视", - "searchable": 0, - "quickSearch": 0, + "searchable": 1, + "quickSearch": 1, "filterable": 0 }, { @@ -150,6 +150,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_AnFuns", + "name": "AnFuns(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=AnFuns", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_cokemv", "name": "cokemv(道长)", @@ -159,6 +168,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_l0l", + "name": "l0l(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=l0l", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_LIBVIO", "name": "LIBVIO(道长)", @@ -204,6 +222,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_吸瓜", + "name": "吸瓜(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=吸瓜", + "searchable": 0, + "quickSearch": 0, + "filterable": 0 + }, { "key": "dr_喵喵", "name": "喵喵(道长)", @@ -231,6 +258,24 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_奇珍异兽", + "name": "奇珍异兽(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=奇珍异兽", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, + { + "key": "dr_小猫咪", + "name": "小猫咪(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=小猫咪", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_干饭影视", "name": "干饭影视(道长)", @@ -285,6 +330,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_腾云驾雾", + "name": "腾云驾雾(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=腾云驾雾", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_莫扎兔", "name": "莫扎兔(道长)", @@ -312,6 +366,15 @@ "quickSearch": 1, "filterable": 0 }, + { + "key": "dr_追剧喵", + "name": "追剧喵(道长)", + "type": 1, + "api": "http://cms.nokia.press/vod?rule=追剧喵", + "searchable": 1, + "quickSearch": 1, + "filterable": 0 + }, { "key": "dr_鸭奈飞", "name": "鸭奈飞(道长)", @@ -320,11 +383,191 @@ "searchable": 1, "quickSearch": 1, "filterable": 0 + }, + { + "key": "py_ali", + "name": "py_ali(Pyramid)", + "type": 3, + "api": "py_ali", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_ali.py" + }, + { + "key": "py_bilibili", + "name": "py_bilibili(Pyramid)", + "type": 3, + "api": "py_bilibili", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_bilibili.py" + }, + { + "key": "py_bilimd", + "name": "py_bilimd(Pyramid)", + "type": 3, + "api": "py_bilimd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_bilimd.py" + }, + { + "key": "py_bilivd", + "name": "py_bilivd(Pyramid)", + "type": 3, + "api": "py_bilivd", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_bilivd.py" + }, + { + "key": "py_cctv", + "name": "py_cctv(Pyramid)", + "type": 3, + "api": "py_cctv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_cctv.py" + }, + { + "key": "py_cokemv", + "name": "py_cokemv(Pyramid)", + "type": 3, + "api": "py_cokemv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_cokemv.py" + }, + { + "key": "py_czspp", + "name": "py_czspp(Pyramid)", + "type": 3, + "api": "py_czspp", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_czspp.py" + }, + { + "key": "py_douyu", + "name": "py_douyu(Pyramid)", + "type": 3, + "api": "py_douyu", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_douyu.py" + }, + { + "key": "py_genmov", + "name": "py_genmov(Pyramid)", + "type": 3, + "api": "py_genmov", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_genmov.py" + }, + { + "key": "py_gimytv", + "name": "py_gimytv(Pyramid)", + "type": 3, + "api": "py_gimytv", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_gimytv.py" + }, + { + "key": "py_gitcafe", + "name": "py_gitcafe(Pyramid)", + "type": 3, + "api": "py_gitcafe", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_gitcafe.py" + }, + { + "key": "py_huya", + "name": "py_huya(Pyramid)", + "type": 3, + "api": "py_huya", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_huya.py" + }, + { + "key": "py_pansou", + "name": "py_pansou(Pyramid)", + "type": 3, + "api": "py_pansou", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_pansou.py" + }, + { + "key": "py_voflix", + "name": "py_voflix(Pyramid)", + "type": 3, + "api": "py_voflix", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_voflix.py" + }, + { + "key": "py_xmaomi", + "name": "py_xmaomi(Pyramid)", + "type": 3, + "api": "py_xmaomi", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_xmaomi.py" + }, + { + "key": "py_yiso", + "name": "py_yiso(Pyramid)", + "type": 3, + "api": "py_yiso", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_yiso.py" + }, + { + "key": "py_zhaozy", + "name": "py_zhaozy(Pyramid)", + "type": 3, + "api": "py_zhaozy", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_zhaozy.py" + }, + { + "key": "py_zxzj", + "name": "py_zxzj(Pyramid)", + "type": 3, + "api": "py_zxzj", + "searchable": 1, + "quickSearch": 1, + "filterable": 0, + "ext": "http://cms.nokia.press/txt/py/py_zxzj.py" } ], "parses": [ { - "name": "免解嗅探", + "name": "🌐Ⓤ", "type": 0, "url": "", "header": { @@ -332,13 +575,75 @@ } }, { - "name": "免解JSON", + "name": "🌀Ⓙ", "type": 1, "url": "", "header": { "User-Agent": "Mozilla/5.0" } }, + { + "name": "轮询", + "url": "Sequence", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, + { + "name": "并发", + "url": "Parallel", + "type": 2, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } + }, { "name": "BT5V", "url": "https://rx.bt5v.com/json/jsonindex.php/?url=", @@ -462,6 +767,37 @@ "User-Agent": "Mozilla/5.0" } } + }, + { + "name": "虾米", + "url": "https://dm.xmflv.com:4433/?url=", + "type": 0, + "ext": { + "flag": [ + "qiyi", + "imgo", + "爱奇艺", + "奇艺", + "qq", + "腾讯", + "youku", + "优酷", + "pptv", + "PPTV", + "letv", + "乐视", + "bilibili", + "哔哩哔哩", + "哔哩", + "mgtv", + "芒果", + "sohu", + "xigua" + ], + "header": { + "User-Agent": "Mozilla/5.0" + } + } } ], "flags": [ diff --git a/utils/update.py b/utils/update.py index 4ae579a9bdbb171e96ccf6d9cf7a0141e13ab314..1ce6bfb5383ac9a07b368b184612abbde70887d7 100644 --- a/utils/update.py +++ b/utils/update.py @@ -96,7 +96,7 @@ def copy_to_update(): # print(f'升级失败,找不到目录{dr_path}') logger.info(f'升级失败,找不到目录{dr_path}') return False - paths = ['js','models','controllers','libs','static','templates','utils'] + paths = ['js','models','controllers','libs','static','templates','utils','txt'] for path in paths: force_copy_files(os.path.join(dr_path, path),os.path.join(base_path, path)) try: