dongchenys
9 months ago
committed by
Gitee
12 changed files with 2409 additions and 0 deletions
@ -0,0 +1,210 @@ |
|||
#coding=utf-8 |
|||
#!/usr/bin/python |
|||
import sys |
|||
sys.path.append('..') |
|||
from base.spider import Spider |
|||
import re |
|||
import math |
|||
import json |
|||
import time |
|||
import hashlib |
|||
import uuid |
|||
|
|||
class Spider(Spider): # 元类 默认的元类 type |
|||
def getName(self): |
|||
return "1905电影网" |
|||
def init(self,extend=""): |
|||
pass |
|||
def isVideoFormat(self,url): |
|||
pass |
|||
def manualVideoCheck(self): |
|||
pass |
|||
def homeContent(self,filter): |
|||
result = {} |
|||
cateManual = { |
|||
"电影": "n_1/o3p", |
|||
"微电影":"n_1_c_922/o3p", |
|||
"系列电影":"n_2/o3p", |
|||
"记录片":"c_927/o3p", |
|||
"晚会":"n_1_c_586/o3p", |
|||
"独家":"n_1_c_178/o3p", |
|||
"综艺":"n_1_c_1024/o3p", |
|||
"体育":"n_1_c_1053/o3p" |
|||
} |
|||
classes = [] |
|||
for k in cateManual: |
|||
classes.append({ |
|||
'type_name':k, |
|||
'type_id':cateManual[k] |
|||
}) |
|||
result['class'] = classes |
|||
return result |
|||
def homeVideoContent(self): |
|||
result = {} |
|||
url = 'https://www.1905.com/vod/cctv6/lst/' |
|||
headers = { |
|||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', |
|||
'Referer': 'https://www.1905.com/vod/list/n_1/o3p1.html', |
|||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' |
|||
} |
|||
rsp = self.fetch(url, headers=headers) |
|||
html = self.html(rsp.text) |
|||
aList = html.xpath("//div[@class='grid-2x']/a") |
|||
videos = [] |
|||
for a in aList: |
|||
aid = a.xpath("./@href")[0] #https://www.1905.com/vod/play/85646.shtml |
|||
if '//vip.1905.com' in str(aid): |
|||
continue #跳过VIP视频 |
|||
aid = self.regStr(reg=r'play/(.*?).sh', src=aid) # 85646 |
|||
img = a.xpath('./img/@src')[0] |
|||
title = a.xpath('./img/@alt')[0] |
|||
videos.append({ |
|||
"vod_id": aid, |
|||
"vod_name": title, |
|||
"vod_pic": img, |
|||
"vod_remarks": '' |
|||
}) |
|||
result['list'] = videos |
|||
return result |
|||
def categoryContent(self,tid,pg,filter,extend): |
|||
result = {} |
|||
url = 'https://www.1905.com/vod/list/{}{}.html'.format(tid, pg) |
|||
headers = { |
|||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', |
|||
'Referer': 'https://www.1905.com/vod/list/n_1/o3p1.html', |
|||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' |
|||
} |
|||
rsp = self.fetch(url, headers=headers) |
|||
html = self.html(rsp.text) |
|||
aList = html.xpath("//section[contains(@class,'search-list')]/div/a" if tid != u'n_2/o3p' else "//div[@class='mod']/div[1]/a") |
|||
videos = [] |
|||
limit = len(aList) |
|||
for a in aList: |
|||
aid = a.xpath("./@href")[0] # https://www.1905.com/vod/play/85646.shtml |
|||
aid = self.regStr(reg=r'play/(.*?).sh', src=aid) # 85646 |
|||
img = a.xpath('./img/@src')[0] |
|||
title = a.xpath('./@title')[0] |
|||
videos.append({ |
|||
"vod_id": aid, |
|||
"vod_name": title, |
|||
"vod_pic": img, |
|||
"vod_remarks": '' |
|||
}) |
|||
result['list'] = videos |
|||
result['page'] = pg |
|||
result['pagecount'] = 100 |
|||
result['limit'] = limit |
|||
result['total'] = 100 * limit |
|||
return result |
|||
def detailContent(self,array): |
|||
aid = array[0] |
|||
url = "https://www.1905.com/api/content/?callback=&m=Vod&a=getVodSidebar&id={0}&fomat=json".format(aid) |
|||
rsp = self.fetch(url) |
|||
root = json.loads(rsp.text) |
|||
title = root['title'] |
|||
pic = root['thumb'] |
|||
remark = root['commendreason'] |
|||
content = root['description'] |
|||
actor = root['starring'] |
|||
direct = root['direct'] |
|||
vod = { |
|||
"vod_id": aid, |
|||
"vod_name": title, |
|||
"vod_pic": pic, |
|||
"type_name": "", |
|||
"vod_year": "", |
|||
"vod_area": "", |
|||
"vod_remarks": remark, |
|||
"vod_actor": actor, |
|||
"vod_director":direct, |
|||
"vod_content": content |
|||
} |
|||
vodItems = [] |
|||
vodItems.append(title + "$" + aid) |
|||
#处理多集的电影 |
|||
series = root['info']['series_data'] |
|||
for ser in series: |
|||
vodItems.append(ser['title'] + "$" + ser['contentid']) |
|||
playList = [] |
|||
joinStr = '#'.join(vodItems) |
|||
playList.append(joinStr) |
|||
vod['vod_play_from'] = '默认最高画质' |
|||
vod['vod_play_url'] = '$$$'.join(playList) |
|||
result = { |
|||
'list': [ |
|||
vod |
|||
] |
|||
} |
|||
return result |
|||
def searchContent(self,key,quick): |
|||
result = {} |
|||
url = 'https://www.1905.com/search/index-p-type-all-q-{}.html'.format(key) |
|||
headers = { |
|||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', |
|||
'Referer': 'https://www.1905.com/vod/list/n_1/o3p1.html', |
|||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' |
|||
} |
|||
rsp = self.fetch(url, headers=headers) |
|||
html = self.html(rsp.text) |
|||
aList = html.xpath("//div[contains(@class,'movie_box')]/div/div") |
|||
videos = [] |
|||
for a in aList: |
|||
aid = a.xpath("./div/ul/li[contains(@class,'paly-tab-icon')]/a/@href")[0] #https://www.1905.com/vod/play/85646.shtml |
|||
if len(aid) == 0: |
|||
continue |
|||
aid = self.regStr(reg=r'play/(.*?).sh', src=aid) # 85646 |
|||
img = a.xpath('./div/div/a/img/@src')[0] |
|||
title = a.xpath('./div/a/img/@alt')[0] |
|||
videos.append({ |
|||
"vod_id": aid, |
|||
"vod_name": title, |
|||
"vod_pic": img, |
|||
"vod_remarks": '' |
|||
}) |
|||
result['list'] = videos |
|||
return result |
|||
def playerContent(self,flag,id,vipFlags): |
|||
result = {} |
|||
nonce = int(round(time.time() * 1000)) |
|||
expiretime = nonce + 600 |
|||
uid = str(uuid.uuid4()) |
|||
playerid = uid.replace("-", "")[5:20] |
|||
signature = 'cid={0}&expiretime={1}&nonce={2}&page=https%3A%2F%2Fwww.1905.com%2Fvod%2Fplay%2F{3}.shtml&playerid={4}&type=hls&uuid={5}.dde3d61a0411511d'.format(id,expiretime,nonce,id,playerid,uid) |
|||
signature = hashlib.sha1(signature.encode()).hexdigest() |
|||
url = 'https://profile.m1905.com/mvod/getVideoinfo.php?nonce={0}&expiretime={1}&cid={2}&uuid={3}&playerid={4}&page=https%3A%2F%2Fwww.1905.com%2Fvod%2Fplay%2F{5}.shtml&type=hls&signature={6}&callback='.format(nonce,expiretime,id,uid,playerid,id,signature) |
|||
headers = { |
|||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', |
|||
'Referer': 'https://www.1905.com/vod/list/n_1/o3p1.html', |
|||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' |
|||
} |
|||
rsp = self.fetch(url,headers=headers) |
|||
jo = json.loads(rsp.text.replace("(", "").replace(")", "")) |
|||
data = jo['data']['sign'] |
|||
sign = '' |
|||
qualityStr = '' |
|||
if 'uhd' in data.keys(): |
|||
sign = data['uhd']['sign'] |
|||
qualityStr = 'uhd' |
|||
elif 'hd' in data.keys(): |
|||
sign = data['hd']['sign'] |
|||
qualityStr = 'hd' |
|||
elif 'sd' in data.keys(): |
|||
sign = data['sd']['sign'] |
|||
qualityStr = 'sd' |
|||
host = jo['data']['quality'][qualityStr]['host'] |
|||
path = jo['data']['path'][qualityStr]['path'] |
|||
playUrl = host + sign + path |
|||
result["parse"] = 0 |
|||
result["playUrl"] = '' |
|||
result["url"] = playUrl |
|||
result["header"] = '' |
|||
return result |
|||
|
|||
config = { |
|||
"player": {}, |
|||
"filter": {} |
|||
} |
|||
header = {} |
|||
|
|||
def localProxy(self,param): |
|||
return [200, "video/MP2T", action, ""] |
@ -0,0 +1,461 @@ |
|||
#coding=utf-8 |
|||
#!/usr/bin/python |
|||
import sys |
|||
sys.path.append('..') |
|||
from base.spider import Spider |
|||
import json |
|||
import time |
|||
import base64 |
|||
import re |
|||
from urllib import request, parse |
|||
import urllib |
|||
import urllib.request |
|||
import time |
|||
|
|||
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 |
|||
def categoryContent(self,tid,pg,filter,extend): |
|||
result = {} |
|||
month = ""#月 |
|||
year = ""#年 |
|||
area=''#地区 |
|||
channel=''#频道 |
|||
datafl=''#类型 |
|||
letter=''#字母 |
|||
pagecount=24 |
|||
if tid=='动画片': |
|||
id=urllib.parse.quote(tid) |
|||
if 'datadq-area' in extend.keys(): |
|||
area=urllib.parse.quote(extend['datadq-area']) |
|||
if 'dataszm-letter' in extend.keys(): |
|||
letter=extend['dataszm-letter'] |
|||
if 'datafl-sc' in extend.keys(): |
|||
datafl=urllib.parse.quote(extend['datafl-sc']) |
|||
url='https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955899450127&area={0}&sc={4}&fc={1}&letter={2}&p={3}&n=24&serviceId=tvcctv&topv=1&t=json'.format(area,id,letter,pg,datafl) |
|||
elif tid=='纪录片': |
|||
id=urllib.parse.quote(tid) |
|||
if 'datapd-channel' in extend.keys(): |
|||
channel=urllib.parse.quote(extend['datapd-channel']) |
|||
if 'datafl-sc' in extend.keys(): |
|||
datafl=urllib.parse.quote(extend['datafl-sc']) |
|||
if 'datanf-year' in extend.keys(): |
|||
year=extend['datanf-year'] |
|||
if 'dataszm-letter' in extend.keys(): |
|||
letter=extend['dataszm-letter'] |
|||
url='https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955924871139&fc={0}&channel={1}&sc={2}&year={3}&letter={4}&p={5}&n=24&serviceId=tvcctv&topv=1&t=json'.format(id,channel,datafl,year,letter,pg) |
|||
elif tid=='电视剧': |
|||
id=urllib.parse.quote(tid) |
|||
if 'datafl-sc' in extend.keys(): |
|||
datafl=urllib.parse.quote(extend['datafl-sc']) |
|||
if 'datanf-year' in extend.keys(): |
|||
year=extend['datanf-year'] |
|||
if 'dataszm-letter' in extend.keys(): |
|||
letter=extend['dataszm-letter'] |
|||
url='https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955853485115&area={0}&sc={1}&fc={2}&year={3}&letter={4}&p={5}&n=24&serviceId=tvcctv&topv=1&t=json'.format(area,datafl,id,year,letter,pg) |
|||
elif tid=='特别节目': |
|||
id=urllib.parse.quote(tid) |
|||
if 'datapd-channel' in extend.keys(): |
|||
channel=urllib.parse.quote(extend['datapd-channel']) |
|||
if 'datafl-sc' in extend.keys(): |
|||
datafl=urllib.parse.quote(extend['datafl-sc']) |
|||
if 'dataszm-letter' in extend.keys(): |
|||
letter=extend['dataszm-letter'] |
|||
url='https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955953877151&channel={0}&sc={1}&fc={2}&bigday=&letter={3}&p={4}&n=24&serviceId=tvcctv&topv=1&t=json'.format(channel,datafl,id,letter,pg) |
|||
elif tid=='节目大全': |
|||
cid=''#频道 |
|||
if 'cid' in extend.keys(): |
|||
cid=extend['cid'] |
|||
fc=''#分类 |
|||
if 'fc' in extend.keys(): |
|||
fc=extend['fc'] |
|||
fl=''#字母 |
|||
if 'fl' in extend.keys(): |
|||
fl=extend['fl'] |
|||
url = 'https://api.cntv.cn/lanmu/columnSearch?&fl={0}&fc={1}&cid={2}&p={3}&n=20&serviceId=tvcctv&t=json&cb=ko'.format(fl,fc,cid,pg) |
|||
pagecount=20 |
|||
else: |
|||
url = 'https://tv.cctv.com/epg/index.shtml' |
|||
|
|||
videos=[] |
|||
htmlText =self.webReadFile(urlStr=url,header=self.header) |
|||
if tid=='节目大全': |
|||
index=htmlText.rfind(');') |
|||
if index>-1: |
|||
htmlText=htmlText[3:index] |
|||
videos =self.get_list1(html=htmlText,tid=tid) |
|||
else: |
|||
videos =self.get_list(html=htmlText,tid=tid) |
|||
#print(videos) |
|||
|
|||
result['list'] = videos |
|||
result['page'] = pg |
|||
result['pagecount'] = 9999 if len(videos)>=pagecount else pg |
|||
result['limit'] = 90 |
|||
result['total'] = 999999 |
|||
return result |
|||
def detailContent(self,array): |
|||
result={} |
|||
aid = array[0].split('###') |
|||
tid = aid[0] |
|||
logo = aid[3] |
|||
lastVideo = aid[2] |
|||
title = aid[1] |
|||
id= aid[4] |
|||
|
|||
vod_year= aid[5] |
|||
actors= aid[6] |
|||
brief= aid[7] |
|||
fromId='CCTV' |
|||
if tid=="节目大全": |
|||
lastUrl = 'https://api.cntv.cn/video/videoinfoByGuid?guid={0}&serviceId=tvcctv'.format(id) |
|||
htmlTxt = self.webReadFile(urlStr=lastUrl,header=self.header) |
|||
topicId=json.loads(htmlTxt)['ctid'] |
|||
Url = "https://api.cntv.cn/NewVideo/getVideoListByColumn?id={0}&d=&p=1&n=100&sort=desc&mode=0&serviceId=tvcctv&t=json".format(topicId) |
|||
htmlTxt = self.webReadFile(urlStr=Url,header=self.header) |
|||
else: |
|||
Url='https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id={0}&serviceId=tvcctv&p=1&n=100&mode=0&pub=1'.format(id) |
|||
jRoot = '' |
|||
videoList = [] |
|||
try: |
|||
if tid=="搜索": |
|||
fromId='中央台' |
|||
videoList=[title+"$"+lastVideo] |
|||
else: |
|||
htmlTxt=self.webReadFile(urlStr=Url,header=self.header) |
|||
jRoot = json.loads(htmlTxt) |
|||
data=jRoot['data'] |
|||
jsonList=data['list'] |
|||
videoList=self.get_EpisodesList(jsonList=jsonList) |
|||
if len(videoList)<1: |
|||
htmlTxt=self.webReadFile(urlStr=lastVideo,header=self.header) |
|||
if tid=="电视剧" or tid=="纪录片": |
|||
patternTxt=r"'title':\s*'(?P<title>.+?)',\n{0,1}\s*'brief':\s*'(.+?)',\n{0,1}\s*'img':\s*'(.+?)',\n{0,1}\s*'url':\s*'(?P<url>.+?)'" |
|||
elif tid=="特别节目": |
|||
patternTxt=r'class="tp1"><a\s*href="(?P<url>https://.+?)"\s*target="_blank"\s*title="(?P<title>.+?)"></a></div>' |
|||
elif tid=="动画片": |
|||
patternTxt=r"'title':\s*'(?P<title>.+?)',\n{0,1}\s*'img':\s*'(.+?)',\n{0,1}\s*'brief':\s*'(.+?)',\n{0,1}\s*'url':\s*'(?P<url>.+?)'" |
|||
elif tid=="节目大全": |
|||
patternTxt=r'href="(?P<url>.+?)" target="_blank" alt="(?P<title>.+?)" title=".+?">' |
|||
videoList=self.get_EpisodesList_re(htmlTxt=htmlTxt,patternTxt=patternTxt) |
|||
fromId='央视' |
|||
except: |
|||
pass |
|||
if len(videoList) == 0: |
|||
return {} |
|||
vod = { |
|||
"vod_id":array[0], |
|||
"vod_name":title, |
|||
"vod_pic":logo, |
|||
"type_name":tid, |
|||
"vod_year":vod_year, |
|||
"vod_area":"", |
|||
"vod_remarks":'', |
|||
"vod_actor":actors, |
|||
"vod_director":'', |
|||
"vod_content":brief |
|||
} |
|||
vod['vod_play_from'] = fromId |
|||
vod['vod_play_url'] = "#".join(videoList) |
|||
result = { |
|||
'list':[ |
|||
vod |
|||
] |
|||
} |
|||
return result |
|||
def get_lineList(self,Txt,mark,after): |
|||
circuit=[] |
|||
origin=Txt.find(mark) |
|||
while origin>8: |
|||
end=Txt.find(after,origin) |
|||
circuit.append(Txt[origin:end]) |
|||
origin=Txt.find(mark,end) |
|||
return circuit |
|||
def get_RegexGetTextLine(self,Text,RegexText,Index): |
|||
returnTxt=[] |
|||
pattern = re.compile(RegexText, re.M|re.S) |
|||
ListRe=pattern.findall(Text) |
|||
if len(ListRe)<1: |
|||
return returnTxt |
|||
for value in ListRe: |
|||
returnTxt.append(value) |
|||
return returnTxt |
|||
def searchContent(self,key,quick): |
|||
key=urllib.parse.quote(key) |
|||
Url='https://search.cctv.com/ifsearch.php?page=1&qtext={0}&sort=relevance&pageSize=20&type=video&vtime=-1&datepid=1&channel=&pageflag=0&qtext_str={0}'.format(key) |
|||
htmlTxt=self.webReadFile(urlStr=Url,header=self.header) |
|||
videos=self.get_list_search(html=htmlTxt,tid='搜索') |
|||
result = { |
|||
'list':videos |
|||
} |
|||
return result |
|||
def playerContent(self,flag,id,vipFlags): |
|||
result = {} |
|||
url='' |
|||
parse=0 |
|||
headers = { |
|||
'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1' |
|||
} |
|||
if flag=='CCTV': |
|||
url=self.get_m3u8(urlTxt=id) |
|||
else: |
|||
try: |
|||
html=self.webReadFile(urlStr=id,header=self.header) |
|||
guid=self.get_RegexGetText(Text=html,RegexText=r'var\sguid\s*=\s*"(.+?)";',Index=1) |
|||
url=self.get_m3u8(urlTxt=guid) |
|||
except : |
|||
url=id |
|||
parse=1 |
|||
if url.find('https:')<0: |
|||
url=id |
|||
parse=1 |
|||
result["parse"] = parse#1=嗅探,0=播放 |
|||
result["playUrl"] = '' |
|||
result["url"] = url |
|||
result["header"] =headers |
|||
return result |
|||
config = { |
|||
"player": {}, |
|||
"filter": { |
|||
"电视剧":[ |
|||
{"key":"datafl-sc","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":"其他"}]}, |
|||
{"key":"datadq-area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"中国香港","v":"香港"},{"n":"美国","v":"美国"},{"n":"欧洲","v":"欧洲"},{"n":"泰国","v":"泰国"}]}, |
|||
{"key":"datanf-year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"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"},{"n":"1999","v":"1999"},{"n":"1998","v":"1998"},{"n":"1997","v":"1997"}]}, |
|||
{"key":"dataszm-letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"C","v":"C"},{"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":"datafl-sc","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":"其他"}]}, |
|||
{"key":"datadq-area","name":"地区","value":[{"n":"全部","v":""},{"n":"中国大陆","v":"中国大陆"},{"n":"美国","v":"美国"},{"n":"欧洲","v":"欧洲"}]}, |
|||
{"key":"dataszm-letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"C","v":"C"},{"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":"datapd-channel","name":"频道","value":[{"n":"全部","v":""},{"n":"CCTV{1 综合","v":"CCTV{1 综合"},{"n":"CCTV{2 财经","v":"CCTV{2 财经"},{"n":"CCTV{3 综艺","v":"CCTV{3 综艺"},{"n":"CCTV{4 中文国际","v":"CCTV{4 中文国际"},{"n":"CCTV{5 体育","v":"CCTV{5 体育"},{"n":"CCTV{6 电影","v":"CCTV{6 电影"},{"n":"CCTV{7 国防军事","v":"CCTV{7 国防军事"},{"n":"CCTV{8 电视剧","v":"CCTV{8 电视剧"},{"n":"CCTV{9 纪录","v":"CCTV{9 纪录"},{"n":"CCTV{10 科教","v":"CCTV{10 科教"},{"n":"CCTV{11 戏曲","v":"CCTV{11 戏曲"},{"n":"CCTV{12 社会与法","v":"CCTV{12 社会与法"},{"n":"CCTV{13 新闻","v":"CCTV{13 新闻"},{"n":"CCTV{14 少儿","v":"CCTV{14 少儿"},{"n":"CCTV{15 音乐","v":"CCTV{15 音乐"},{"n":"CCTV{17 农业农村","v":"CCTV{17 农业农村"}]}, |
|||
{"key":"datafl-sc","name":"类型","value":[{"n":"全部","v":""},{"n":"人文历史","v":"人文历史"},{"n":"人物","v":"人物"},{"n":"军事","v":"军事"},{"n":"探索","v":"探索"},{"n":"社会","v":"社会"},{"n":"时政","v":"时政"},{"n":"经济","v":"经济"},{"n":"科技","v":"科技"}]}, |
|||
{"key":"datanf-year","name":"年份","value":[{"n":"全部","v":""},{"n":"2023","v":"2023"},{"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"}]}, |
|||
{"key":"dataszm-letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"C","v":"C"},{"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":"datapd-channel","name":"频道","value":[{"n":"全部","v":""},{"n":"CCTV{1 综合","v":"CCTV{1 综合"},{"n":"CCTV{2 财经","v":"CCTV{2 财经"},{"n":"CCTV{3 综艺","v":"CCTV{3 综艺"},{"n":"CCTV{4 中文国际","v":"CCTV{4 中文国际"},{"n":"CCTV{5 体育","v":"CCTV{5 体育"},{"n":"CCTV{6 电影","v":"CCTV{6 电影"},{"n":"CCTV{7 国防军事","v":"CCTV{7 国防军事"},{"n":"CCTV{8 电视剧","v":"CCTV{8 电视剧"},{"n":"CCTV{9 纪录","v":"CCTV{9 纪录"},{"n":"CCTV{10 科教","v":"CCTV{10 科教"},{"n":"CCTV{11 戏曲","v":"CCTV{11 戏曲"},{"n":"CCTV{12 社会与法","v":"CCTV{12 社会与法"},{"n":"CCTV{13 新闻","v":"CCTV{13 新闻"},{"n":"CCTV{14 少儿","v":"CCTV{14 少儿"},{"n":"CCTV{15 音乐","v":"CCTV{15 音乐"},{"n":"CCTV{17 农业农村","v":"CCTV{17 农业农村"}]}, |
|||
{"key":"datafl-sc","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":"其他"}]}, |
|||
{"key":"dataszm-letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"C","v":"C"},{"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":"cid","name":"频道","value":[{"n":"全部","v":""},{"n":"CCTV-1综合","v":"EPGC1386744804340101"},{"n":"CCTV-2财经","v":"EPGC1386744804340102"},{"n":"CCTV-3综艺","v":"EPGC1386744804340103"},{"n":"CCTV-4中文国际","v":"EPGC1386744804340104"},{"n":"CCTV-5体育","v":"EPGC1386744804340107"},{"n":"CCTV-6电影","v":"EPGC1386744804340108"},{"n":"CCTV-7国防军事","v":"EPGC1386744804340109"},{"n":"CCTV-8电视剧","v":"EPGC1386744804340110"},{"n":"CCTV-9纪录","v":"EPGC1386744804340112"},{"n":"CCTV-10科教","v":"EPGC1386744804340113"},{"n":"CCTV-11戏曲","v":"EPGC1386744804340114"},{"n":"CCTV-12社会与法","v":"EPGC1386744804340115"},{"n":"CCTV-13新闻","v":"EPGC1386744804340116"},{"n":"CCTV-14少儿","v":"EPGC1386744804340117"},{"n":"CCTV-15音乐","v":"EPGC1386744804340118"},{"n":"CCTV-16奥林匹克","v":"EPGC1634630207058998"},{"n":"CCTV-17农业农村","v":"EPGC1563932742616872"},{"n":"CCTV-5+体育赛事","v":"EPGC1468294755566101"}]},{"key":"fc","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":"fl","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"}]},{"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":"month","name":"月份","value":[{"n":"全部","v":""},{"n":"12","v":"12"},{"n":"11","v":"11"},{"n":"10","v":"10"},{"n":"09","v":"09"},{"n":"08","v":"08"},{"n":"07","v":"07"},{"n":"06","v":"06"},{"n":"05","v":"05"},{"n":"04","v":"04"},{"n":"03","v":"03"},{"n":"02","v":"02"},{"n":"01","v":"01"}]}] |
|||
} |
|||
} |
|||
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", |
|||
"Host": "tv.cctv.com", |
|||
"Referer": "https://tv.cctv.com/" |
|||
} |
|||
|
|||
def localProxy(self,param): |
|||
return [200, "video/MP2T", action, ""] |
|||
#-----------------------------------------------自定义函数----------------------------------------------- |
|||
#访问网页 |
|||
def webReadFile(self,urlStr,header): |
|||
html='' |
|||
req=urllib.request.Request(url=urlStr)#,headers=header |
|||
with urllib.request.urlopen(req) as response: |
|||
html = response.read().decode('utf-8') |
|||
return html |
|||
#判断网络地址是否存在 |
|||
def TestWebPage(self,urlStr,header): |
|||
html='' |
|||
req=urllib.request.Request(url=urlStr,method='HEAD')#,headers=header |
|||
with urllib.request.urlopen(req) as response: |
|||
html = response.getcode () |
|||
return html |
|||
#正则取文本 |
|||
def get_RegexGetText(self,Text,RegexText,Index): |
|||
returnTxt="" |
|||
Regex=re.search(RegexText, Text, re.M|re.S) |
|||
if Regex is None: |
|||
returnTxt="" |
|||
else: |
|||
returnTxt=Regex.group(Index) |
|||
return returnTxt |
|||
#取集数 |
|||
def get_EpisodesList(self,jsonList): |
|||
videos=[] |
|||
for vod in jsonList: |
|||
url = vod['guid'] |
|||
title =vod['title'] |
|||
if len(url) == 0: |
|||
continue |
|||
videos.append(title+"$"+url) |
|||
return videos |
|||
#取集数 |
|||
def get_EpisodesList_re(self,htmlTxt,patternTxt): |
|||
ListRe=re.finditer(patternTxt, htmlTxt, re.M|re.S) |
|||
videos=[] |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =vod.group('title') |
|||
if len(url) == 0: |
|||
continue |
|||
videos.append(title+"$"+url) |
|||
return videos |
|||
#取剧集区 |
|||
def get_lineList(self,Txt,mark,after): |
|||
circuit=[] |
|||
origin=Txt.find(mark) |
|||
while origin>8: |
|||
end=Txt.find(after,origin) |
|||
circuit.append(Txt[origin:end]) |
|||
origin=Txt.find(mark,end) |
|||
return circuit |
|||
#正则取文本,返回数组 |
|||
def get_RegexGetTextLine(self,Text,RegexText,Index): |
|||
returnTxt=[] |
|||
pattern = re.compile(RegexText, re.M|re.S) |
|||
ListRe=pattern.findall(Text) |
|||
if len(ListRe)<1: |
|||
return returnTxt |
|||
for value in ListRe: |
|||
returnTxt.append(value) |
|||
return returnTxt |
|||
#删除html标签 |
|||
def removeHtml(self,txt): |
|||
soup = re.compile(r'<[^>]+>',re.S) |
|||
txt =soup.sub('', txt) |
|||
return txt.replace(" "," ") |
|||
#取m3u8 |
|||
def get_m3u8(self,urlTxt): |
|||
url = "https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={0}".format(urlTxt) |
|||
html=self.webReadFile(urlStr=url,header=self.header) |
|||
jo =json.loads(html) |
|||
link = jo['hls_url'].strip() |
|||
html = self.webReadFile(urlStr=link,header=self.header) |
|||
content = html.strip() |
|||
arr = content.split('\n') |
|||
urlPrefix = self.get_RegexGetText(Text=link,RegexText='(http[s]?://[a-zA-z0-9.]+)/',Index=1) |
|||
subUrl = arr[-1].split('/') |
|||
subUrl[3] = '1200' |
|||
subUrl[-1] = '1200.m3u8' |
|||
hdUrl = urlPrefix + '/'.join(subUrl) |
|||
|
|||
url = urlPrefix + arr[-1] |
|||
|
|||
hdRsp = self.TestWebPage(urlStr=hdUrl,header=self.header) |
|||
if hdRsp == 200: |
|||
url = hdUrl |
|||
else: |
|||
url='' |
|||
return url |
|||
#搜索 |
|||
def get_list_search(self,html,tid): |
|||
jRoot = json.loads(html) |
|||
jsonList=jRoot['list'] |
|||
videos=[] |
|||
for vod in jsonList: |
|||
url = vod['urllink'] |
|||
title =self.removeHtml(txt=vod['title']) |
|||
img=vod['imglink'] |
|||
id=vod['id'] |
|||
brief=vod['channel'] |
|||
year=vod['uploadtime'] |
|||
if len(url) == 0: |
|||
continue |
|||
guid="{0}###{1}###{2}###{3}###{4}###{5}###{6}###{7}".format(tid,title,url,img,id,year,'',brief) |
|||
videos.append({ |
|||
"vod_id":guid, |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":year |
|||
}) |
|||
return videos |
|||
return videos |
|||
def get_list1(self,html,tid): |
|||
jRoot = json.loads(html) |
|||
videos = [] |
|||
data=jRoot['response'] |
|||
if data is None: |
|||
return [] |
|||
jsonList=data['docs'] |
|||
for vod in jsonList: |
|||
id = vod['lastVIDE']['videoSharedCode'] |
|||
title =vod['column_name'] |
|||
url=vod['column_website'] |
|||
img=vod['column_logo'] |
|||
year=vod['column_playdate'] |
|||
brief=vod['column_brief'] |
|||
actors='' |
|||
if len(url) == 0: |
|||
continue |
|||
guid="{0}###{1}###{2}###{3}###{4}###{5}###{6}###{7}".format(tid,title,url,img,id,year,actors,brief) |
|||
#print(vod_id) |
|||
videos.append({ |
|||
"vod_id":guid, |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":'' |
|||
}) |
|||
#print(videos) |
|||
return videos |
|||
#分类取结果 |
|||
def get_list(self,html,tid): |
|||
jRoot = json.loads(html) |
|||
videos = [] |
|||
data=jRoot['data'] |
|||
if data is None: |
|||
return [] |
|||
jsonList=data['list'] |
|||
for vod in jsonList: |
|||
url = vod['url'] |
|||
title =vod['title'] |
|||
img=vod['image'] |
|||
id=vod['id'] |
|||
try: |
|||
brief=vod['brief'] |
|||
except: |
|||
brief='' |
|||
try: |
|||
year=vod['year'] |
|||
except: |
|||
year='' |
|||
try: |
|||
actors=vod['actors'] |
|||
except: |
|||
actors='' |
|||
if len(url) == 0: |
|||
continue |
|||
guid="{0}###{1}###{2}###{3}###{4}###{5}###{6}###{7}".format(tid,title,url,img,id,year,actors,brief) |
|||
#print(vod_id) |
|||
videos.append({ |
|||
"vod_id":guid, |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":'' |
|||
}) |
|||
return videos |
@ -0,0 +1,285 @@ |
|||
#coding=utf-8 |
|||
#!/usr/bin/python |
|||
import sys |
|||
sys.path.append('..') |
|||
from base.spider import Spider |
|||
import re |
|||
from urllib import request, parse |
|||
import urllib |
|||
import urllib.request |
|||
import json |
|||
class Spider(Spider): # 元类 默认的元类 type |
|||
def getName(self): |
|||
return "卡通站(kt30)" |
|||
def init(self,extend=""): |
|||
pass |
|||
def isVideoFormat(self,url): |
|||
pass |
|||
def manualVideoCheck(self): |
|||
pass |
|||
def homeContent(self,filter): |
|||
result = {} |
|||
cateManual = { |
|||
"日本动漫": "r", |
|||
"国产动漫": "g", |
|||
"港台动漫": "gm", |
|||
"动画电影": "v", |
|||
"欧美动漫": "o" |
|||
} |
|||
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): |
|||
htmlTxt = self.webReadFile(urlStr="http://kt30.com/",header=self.header) |
|||
videos = self.get_list(html=htmlTxt,patternTxt=r'a class="stui-vodlist__thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)".+?"><span class="play hidden-xs"></span><span class="pic-text text-right">(?P<renew>.+?)</span></a>') |
|||
result = { |
|||
'list': videos |
|||
} |
|||
return result |
|||
|
|||
def categoryContent(self,tid,pg,filter,extend): |
|||
result = {} |
|||
year='0'#年份 |
|||
types='0'#类型 |
|||
area='all'#地区 |
|||
url = 'http://kt30.com/{0}/index_{1}.html'.format(tid,pg) |
|||
htmlTxt=self.webReadFile(urlStr=url,header=self.header) |
|||
videos=[] |
|||
videos = self.get_list(html=htmlTxt,patternTxt=r'<a class="stui-vodlist__thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)".+?"><span class="play hidden-xs"></span><span class="pic-text text-right">(?P<renew>.+?)</span></a>') |
|||
numvL = len(videos) |
|||
result['list'] = videos |
|||
result['page'] = pg |
|||
result['pagecount'] = pg if numvL<17 else 9999 |
|||
result['limit'] = numvL |
|||
result['total'] = numvL |
|||
return result |
|||
|
|||
def detailContent(self,array): |
|||
aid = array[0].split('###') |
|||
idUrl=aid[1] |
|||
title=aid[0] |
|||
pic=aid[2] |
|||
playFrom = [] |
|||
vodItems = [] |
|||
videoList=[] |
|||
htmlTxt = self.webReadFile(urlStr=idUrl,header=self.header) |
|||
if len(htmlTxt)<5: |
|||
return {'list': []} |
|||
line=self.get_RegexGetTextLine(Text=htmlTxt,RegexText=r'</span><h3 class="title">(.+?)</h3></div>',Index=1) |
|||
playFrom=[self.removeHtml(txt=vod) for vod in line] |
|||
|
|||
if len(line)<1: |
|||
return {'list': []} |
|||
circuit=self.get_lineList(Txt=htmlTxt,mark='<ul class="stui-content__playlist',after='</ul>') |
|||
# print(circuit[0]) |
|||
# return |
|||
for vod in circuit: |
|||
vodItems = self.get_EpisodesList(html=vod,RegexText=r'<a href="(?P<url>.+?)">(?P<title>.+?)</a>') |
|||
joinStr = "#".join(vodItems) |
|||
videoList.append(joinStr) |
|||
|
|||
temporary=self.get_RegexGetTextLine(Text=htmlTxt,RegexText=r'<a href="/vodsearch/----%|\w+?---------.html" target="_blank">(.+?)</a>',Index=1) |
|||
typeName="/".join(temporary) |
|||
year=self.get_RegexGetText(Text=htmlTxt,RegexText=r'<a href="/vodsearch/-------------\d{4}.html" target="_blank">(\d{4})</a>',Index=1) |
|||
temporary=self.get_RegexGetTextLine(Text=htmlTxt,RegexText=r'<a href="/vodsearch/-.+?------------.html" target="_blank">(.+?)</a>',Index=1) |
|||
act="/".join(temporary) |
|||
temporary=self.get_RegexGetTextLine(Text=htmlTxt,RegexText=r'<a href="/vodsearch/-----%+?|\w+?--------.html" target="_blank">(.+?)</a>',Index=1) |
|||
dir="/".join(temporary) |
|||
area=self.get_RegexGetText(Text=htmlTxt,RegexText=r'地区:</b>(.*?)<b>',Index=1) |
|||
|
|||
#area=self.get_RegexGetText(Text=htmlTxt,RegexText=r'>语言:\s{0,4}(.*?)</p>',Index=1) |
|||
cont=self.get_RegexGetText(Text=htmlTxt,RegexText=r'简介:(.+?)<a href="#desc">详情',Index=1) |
|||
|
|||
|
|||
vod = { |
|||
"vod_id": array[0], |
|||
"vod_name": title, |
|||
"vod_pic": pic, |
|||
"type_name": self.removeHtml(txt=typeName), |
|||
"vod_year": year, |
|||
"vod_area": self.removeHtml(txt=area), |
|||
"vod_remarks": "", |
|||
"vod_actor": self.removeHtml(txt=act), |
|||
"vod_director": self.removeHtml(txt=dir), |
|||
"vod_content": self.removeHtml(txt=cont) |
|||
} |
|||
vod['vod_play_from'] = '$$$'.join(playFrom) |
|||
vod['vod_play_url'] = "$$$".join(videoList) |
|||
|
|||
result = { |
|||
'list': [ |
|||
vod |
|||
] |
|||
} |
|||
return result |
|||
|
|||
def verifyCode(self): |
|||
pass |
|||
|
|||
def searchContent(self,key,quick): |
|||
Url='http://kt30.com/vodsearch/-------------.html?wd={0}'.format(urllib.parse.quote(key)) |
|||
htmlTxt = self.webReadFile(urlStr=Url,header=self.header) |
|||
videos = self.get_list(html=htmlTxt,patternTxt=r'<a class="v-thumb stui-vodlist__thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)".+?</span><span class="pic-text text-right">(?P<renew>.+?)</span></a>') |
|||
result = { |
|||
'list': videos |
|||
} |
|||
return result |
|||
|
|||
def playerContent(self,flag,id,vipFlags): |
|||
result = {} |
|||
parse=1 |
|||
jx=0 |
|||
url=id |
|||
htmlTxt=self.webReadFile(urlStr=url,header=self.header) |
|||
temporary=self.get_lineList(Txt=htmlTxt,mark=r'var player_aaaa=',after='</script>') |
|||
|
|||
if len(temporary)>0: |
|||
jRoot=json.loads(temporary[0][16:]) |
|||
url=jRoot['url'] |
|||
if len(url)<5: |
|||
url=id |
|||
else: |
|||
parse=0 |
|||
result["parse"] = parse#1=嗅探,0=播放 |
|||
result["playUrl"] = '' |
|||
result["url"] = url |
|||
result['jx'] = jx#1=VIP解析,0=不解析 |
|||
result["header"] = '' |
|||
return result |
|||
config = { |
|||
"player": {}, |
|||
"filter": {} |
|||
} |
|||
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", |
|||
'Host': 'kt30.com', |
|||
"Referer": "http://kt30.com/" |
|||
} |
|||
|
|||
def localProxy(self,param): |
|||
return [200, "video/MP2T", action, ""] |
|||
#-----------------------------------------------自定义函数----------------------------------------------- |
|||
#访问网页 |
|||
def webReadFile(self,urlStr,header): |
|||
html='' |
|||
req=urllib.request.Request(url=urlStr,headers=header)#,headers=header |
|||
with urllib.request.urlopen(req) as response: |
|||
html = response.read().decode('utf-8') |
|||
return html |
|||
#正则取文本 |
|||
def get_RegexGetText(self,Text,RegexText,Index): |
|||
returnTxt="" |
|||
Regex=re.search(RegexText, Text, re.M|re.S) |
|||
if Regex is None: |
|||
returnTxt="" |
|||
else: |
|||
returnTxt=Regex.group(Index) |
|||
return returnTxt |
|||
#取集数 |
|||
def get_EpisodesList(self,html,RegexText): |
|||
ListRe=re.finditer(RegexText, html, re.M|re.S) |
|||
videos = [] |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =vod.group('title') |
|||
if len(url) == 0: |
|||
continue |
|||
if url.find('http:') <0: |
|||
url='http://kt30.com'+url |
|||
videos.append(title+"$"+url) |
|||
return videos |
|||
#取剧集区 |
|||
def get_lineList(self,Txt,mark,after): |
|||
circuit=[] |
|||
origin=Txt.find(mark) |
|||
|
|||
while origin>8: |
|||
end=Txt.find(after,origin) |
|||
circuit.append(Txt[origin:end]) |
|||
origin=Txt.find(mark,end) |
|||
return circuit |
|||
#正则取文本,返回数组 |
|||
def get_RegexGetTextLine(self,Text,RegexText,Index): |
|||
returnTxt=[] |
|||
ListRe=istRe=re.finditer(RegexText, Text, re.M|re.S) |
|||
for value in ListRe: |
|||
t=value.group(Index) |
|||
if t==None: |
|||
continue |
|||
returnTxt.append(t) |
|||
return returnTxt |
|||
#分类取结果 |
|||
def get_list(self,html,patternTxt): |
|||
ListRe=re.finditer(patternTxt, html, re.M|re.S) |
|||
videos = [] |
|||
head="http://kt30.com" |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =self.removeHtml(txt=vod.group('title')) |
|||
img =vod.group('img') |
|||
renew=vod.group('renew') |
|||
if len(url) == 0: |
|||
continue |
|||
if len(img)<5: |
|||
img='https://agit.ai/lanhaidixingren/Tvbox/raw/branch/master/CoverError.png' |
|||
if self.get_RegexGetText(Text=img,RegexText='(https{0,1}:)',Index=1)=='': |
|||
img=head+img |
|||
# print(title) |
|||
videos.append({ |
|||
"vod_id":"{0}###{1}###{2}".format(title,head+url,img), |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":renew |
|||
}) |
|||
return videos |
|||
#删除html标签 |
|||
def removeHtml(self,txt): |
|||
soup = re.compile(r'<[^>]+>',re.S) |
|||
txt =soup.sub('', txt) |
|||
return txt.replace(" "," ") |
|||
#番剧 |
|||
def get_list_fanju(self,html): |
|||
ListRe=re.finditer('class="jtxqj"><a href="(?P<url>.+?)" title="(?P<title>.+?)" target="_self">(?P<renew>.+?)</a>', html, re.M|re.S) |
|||
videos = [] |
|||
head="http://ktkkt8.com" |
|||
img='https://agit.ai/lanhaidixingren/Tvbox/raw/branch/master/%E5%B0%81%E9%9D%A2.jpeg' |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =self.removeHtml(txt=vod.group('title')) |
|||
renew=vod.group('renew') |
|||
if len(url) == 0: |
|||
continue |
|||
videos.append({ |
|||
"vod_id":"{0}###{1}###{2}".format(title,head+url,img), |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":renew |
|||
}) |
|||
return videos |
|||
|
|||
# T=Spider() |
|||
# l=T.homeVideoContent() |
|||
# l=T.searchContent(key='柯南',quick='') |
|||
# l=T.categoryContent(tid='r',pg='1',filter=False,extend={}) |
|||
# for x in l['list']: |
|||
# print(x['vod_id']) |
|||
# mubiao= l['list'][1]['vod_id'] |
|||
# playTabulation=T.detailContent(array=[mubiao,]) |
|||
# # print(playTabulation) |
|||
# vod_play_from=playTabulation['list'][0]['vod_play_from'] |
|||
# vod_play_url=playTabulation['list'][0]['vod_play_url'] |
|||
# url=vod_play_url.split('$$$') |
|||
# vod_play_from=vod_play_from.split('$$$')[0] |
|||
# url=url[0].split('$') |
|||
# url=url[1].split('#')[0] |
|||
# print(url) |
|||
# m3u8=T.playerContent(flag=vod_play_from,id=url,vipFlags=True) |
|||
# print(m3u8) |
@ -0,0 +1,298 @@ |
|||
#coding=utf-8 |
|||
#!/usr/bin/python |
|||
import sys |
|||
sys.path.append('..') |
|||
from base.spider import Spider |
|||
import json |
|||
import time |
|||
import base64 |
|||
import re |
|||
from urllib import request, parse |
|||
import urllib |
|||
import urllib.request |
|||
import time |
|||
|
|||
|
|||
class Spider(Spider): # 元类 默认的元类 type |
|||
def getName(self): |
|||
return "樱花动漫6"#6才是本体 |
|||
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", |
|||
"欧美动漫":"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): |
|||
htmlTxt=self.custom_webReadFile(urlStr='https://yhdm6.top/') |
|||
videos = self.custom_list(html=htmlTxt,patternTxt=r'<a class="vodlist_thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)".+?><span class=".*?<span class="pic_text text_right">(?P<renew>.+?)</span></a>') |
|||
result = { |
|||
'list':videos |
|||
} |
|||
return result |
|||
def categoryContent(self,tid,pg,filter,extend): |
|||
result = {} |
|||
videos=[] |
|||
types="" |
|||
if 'types' in extend.keys(): |
|||
if extend['types'].find('全部')<0: |
|||
types='class/{0}/'.format(urllib.parse.quote(extend['types'])) |
|||
letter='' |
|||
if 'letter' in extend.keys(): |
|||
if extend['letter'].find('全部')<0: |
|||
letter='letter/{0}/'.format(extend['letter']) |
|||
year='' |
|||
if 'year' in extend.keys(): |
|||
if extend['year'].find('全部')<0: |
|||
year='/year/{0}'.format(extend['year']) |
|||
by='' |
|||
if 'by' in extend.keys(): |
|||
by='by/{0}/'.format(extend['by']) |
|||
Url='https://yhdm6.top/index.php/vod/show/{2}{3}id/{0}/{5}{1}{4}.html'.format(tid,'page/'+pg,by,types,year,letter) |
|||
# print(url) |
|||
#https://yhdm6.top/index.php/vod/show/by/score/class/%E7%A7%91%E5%B9%BB/id/3/letter/W/year/2022.html |
|||
htmlTxt=self.custom_webReadFile(urlStr=Url) |
|||
videos = self.custom_list(html=htmlTxt,patternTxt=r'<a class="vodlist_thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)"><span class="play hidden_xs"></span><span class="pic_text text_right">(?P<renew>.+?)</span></a>') |
|||
result['list'] = videos |
|||
result['page'] = pg |
|||
result['pagecount'] = pg if len(videos)<60 else int(pg)+1 |
|||
result['limit'] = 90 |
|||
result['total'] = 999999 |
|||
return result |
|||
def detailContent(self,array): |
|||
aid = array[0].split('###') |
|||
idUrl=aid[1] |
|||
title=aid[0] |
|||
pic=aid[2] |
|||
url=idUrl |
|||
htmlTxt = self.custom_webReadFile(urlStr=url,codeName='utf-8') |
|||
|
|||
|
|||
line=self.custom_RegexGetTextLine(Text=htmlTxt,RegexText=r'<a href="javascript:void\(0\);" alt="(.+?)">',Index=1) |
|||
if len(line)<1: |
|||
return {'list': []} |
|||
playFrom = [] |
|||
videoList=[] |
|||
vodItems = [] |
|||
circuit=self.custom_lineList(Txt=htmlTxt,mark=r'<ul class="content_playlist',after='</ul>') |
|||
playFrom=line |
|||
for v in circuit: |
|||
vodItems = self.custom_EpisodesList(html=v,RegexText=r'<li><a href="(?P<url>.+?)">(?P<title>.+?)</a></li>') |
|||
joinStr = "#".join(vodItems) |
|||
videoList.append(joinStr) |
|||
|
|||
vod_play_from='$$$'.join(playFrom) |
|||
vod_play_url = "$$$".join(videoList) |
|||
|
|||
typeName=self.custom_RegexGetText(Text=htmlTxt,RegexText=r'<a href="/index.php/vod/search/class/.+?" target="_blank">(.+?)</a>',Index=1) |
|||
year=self.custom_RegexGetText(Text=htmlTxt,RegexText=r'<a href="/index.php/vod/search/year/\d{4}.html" target="_blank">(\d{4})</a>',Index=1) |
|||
area=typeName |
|||
act=self.custom_RegexGetText(Text=htmlTxt,RegexText=r'<a href="/index.php/vod/search/actor/.+?.html" target="_blank">(.+?)</a>',Index=1) |
|||
temporary=self.custom_RegexGetTextLine(Text=htmlTxt,RegexText=r'<a href="/index.php/vod/search/director/.+?.html" target="_blank">(.+?)</a>',Index=1) |
|||
dir='/'.join(temporary) |
|||
cont=self.custom_RegexGetText(Text=htmlTxt,RegexText=r'剧情介绍</h2>(.+?)</span>',Index=1) |
|||
vod = { |
|||
"vod_id": array[0], |
|||
"vod_name": title, |
|||
"vod_pic": pic, |
|||
"type_name":self.custom_removeHtml(txt=typeName), |
|||
"vod_year": self.custom_removeHtml(txt=year), |
|||
"vod_area": area, |
|||
"vod_remarks": '', |
|||
"vod_actor": self.custom_removeHtml(txt=act), |
|||
"vod_director": self.custom_removeHtml(txt=dir), |
|||
"vod_content": self.custom_removeHtml(txt=cont) |
|||
} |
|||
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://yhdm6.top/index.php/vod/search.html?wd={0}&submit='.format(urllib.parse.quote(key)) |
|||
htmlTxt=self.custom_webReadFile(urlStr=url) |
|||
videos = self.custom_list(html=htmlTxt,patternTxt=r'<a class="vodlist_thumb lazyload" href="(?P<url>.+?)" title="(?P<title>.+?)" data-original="(?P<img>.+?)".+?><span class=".*?<span class="pic_text text_right">(?P<renew>.+?)</span></a>') |
|||
result = { |
|||
'list':videos |
|||
} |
|||
return result |
|||
def playerContent(self,flag,id,vipFlags): |
|||
result = {} |
|||
Url=id |
|||
htmlTxt =self.custom_webReadFile(urlStr=Url,codeName='utf-8') |
|||
parse=0 |
|||
UrlStr='' |
|||
temporary=self.custom_lineList(Txt=htmlTxt,mark=r'var player_aaaa=',after=r'}</script>') |
|||
if len(temporary)==1: |
|||
jo=json.loads(temporary[0][16:]+"}") |
|||
UrlStr=urllib.parse.unquote(jo['url']) |
|||
if UrlStr.find('.m3u8')<2: |
|||
Url=id |
|||
parse=1 |
|||
else: |
|||
Url=UrlStr |
|||
result["parse"] = parse#0=直接播放、1=嗅探 |
|||
result["playUrl"] ='' |
|||
result["url"] = Url |
|||
# result['jx'] = jx#VIP解析,0=不解析、1=解析 |
|||
result["header"] = '' |
|||
return result |
|||
|
|||
|
|||
config = { |
|||
"player": {}, |
|||
"filter": { |
|||
"1":[ |
|||
{"key":"types","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":"year","name":"年份:","value":[{"n":"全部","v":"全部"},{"n":"2023","v":"2023"},{"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":"letter","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":"by","name":"排序:","value":[{"n":"按最新","v":"time"},{"n":"按最热","v":"按最热"},{"n":"按评分","v":"按评分"}]} |
|||
], |
|||
"4":[ |
|||
{"key":"types","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":"year","name":"年份:","value":[{"n":"全部","v":"全部"},{"n":"2023","v":"2023"},{"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":"letter","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":"by","name":"排序:","value":[{"n":"按最新","v":"time"},{"n":"按最热","v":"hits"},{"n":"按评分","v":"score"}]} |
|||
], |
|||
"2":[ |
|||
{"key":"types","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":"year","name":"年份:","value":[{"n":"全部","v":"全部"},{"n":"2023","v":"2023"},{"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":"letter","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":"by","name":"排序:","value":[{"n":"按最新","v":"time"},{"n":"按最热","v":"hits"},{"n":"按评分","v":"score"}]} |
|||
], |
|||
"3":[ |
|||
{"key":"types","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":"year","name":"年份:","value":[{"n":"全部","v":"全部"},{"n":"2023","v":"2023"},{"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":"letter","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":"by","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/94.0.4606.54 Safari/537.36' |
|||
} |
|||
def localProxy(self,param): |
|||
return [200, "video/MP2T", action, ""] |
|||
#-----------------------------------------------自定义函数----------------------------------------------- |
|||
#正则取文本 |
|||
def custom_RegexGetText(self,Text,RegexText,Index): |
|||
returnTxt="" |
|||
Regex=re.search(RegexText, Text, re.M|re.S) |
|||
if Regex is None: |
|||
returnTxt="" |
|||
else: |
|||
returnTxt=Regex.group(Index) |
|||
return returnTxt |
|||
#分类取结果 |
|||
def custom_list(self,html,patternTxt): |
|||
ListRe=re.finditer(patternTxt, html, re.M|re.S) |
|||
videos = [] |
|||
head="https://yhdm6.top" |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =self.custom_removeHtml(txt=vod.group('title')) |
|||
img =vod.group('img') |
|||
renew=vod.group('renew') |
|||
if len(url) == 0: |
|||
continue |
|||
# print(renew) |
|||
videos.append({ |
|||
"vod_id":"{0}###{1}###{2}".format(title,head+url,img), |
|||
"vod_name":title, |
|||
"vod_pic":img, |
|||
"vod_remarks":renew |
|||
}) |
|||
return videos |
|||
#删除html标签 |
|||
def custom_removeHtml(self,txt): |
|||
soup = re.compile(r'<[^>]+>',re.S) |
|||
txt =soup.sub('', txt) |
|||
return txt.replace(" "," ") |
|||
#访问网页 |
|||
def custom_webReadFile(self,urlStr,header=None,codeName='utf-8'): |
|||
html='' |
|||
if header==None: |
|||
header={ |
|||
"Referer":urlStr, |
|||
'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', |
|||
"Host":self.custom_RegexGetText(Text=urlStr,RegexText='https*://(.*?)(/|$)',Index=1) |
|||
} |
|||
# import ssl |
|||
# ssl._create_default_https_context = ssl._create_unverified_context#全局取消证书验证 |
|||
req=urllib.request.Request(url=urlStr,headers=header)#,headers=header |
|||
with urllib.request.urlopen(req) as response: |
|||
html = response.read().decode(codeName) |
|||
return html |
|||
#判断是否要调用vip解析 |
|||
def ifJx(self,urlTxt): |
|||
Isjiexi=0 |
|||
RegexTxt=r'(youku.com|v.qq|bilibili|iqiyi.com)' |
|||
if self.get_RegexGetText(Text=urlTxt,RegexText=RegexTxt,Index=1)!='': |
|||
Isjiexi=1 |
|||
return Isjiexi |
|||
#取集数 |
|||
def custom_EpisodesList(self,html,RegexText): |
|||
ListRe=re.finditer(RegexText, html, re.M|re.S) |
|||
videos = [] |
|||
head="https://yhdm6.top" |
|||
for vod in ListRe: |
|||
url = vod.group('url') |
|||
title =vod.group('title') |
|||
if len(url) == 0: |
|||
continue |
|||
videos.append(title+"$"+head+url) |
|||
return videos |
|||
#取剧集区 |
|||
def custom_lineList(self,Txt,mark,after): |
|||
circuit=[] |
|||
origin=Txt.find(mark) |
|||
while origin>8: |
|||
end=Txt.find(after,origin) |
|||
circuit.append(Txt[origin:end]) |
|||
origin=Txt.find(mark,end) |
|||
return circuit |
|||
#正则取文本,返回数组 |
|||
def custom_RegexGetTextLine(self,Text,RegexText,Index): |
|||
returnTxt=[] |
|||
pattern = re.compile(RegexText, re.M|re.S) |
|||
ListRe=pattern.findall(Text) |
|||
if len(ListRe)<1: |
|||
return returnTxt |
|||
for value in ListRe: |
|||
returnTxt.append(value) |
|||
return returnTxt |
|||
# T=Spider() |
|||
# l=T.searchContent(key='柯南',quick='') |
|||
# l=T.homeVideoContent() |
|||
# extend={'types':'科幻',"by":"score"} |
|||
# l=T.categoryContent(tid='1',pg='1',filter=False,extend={}) |
|||
# for x in l['list']: |
|||
# print(x['vod_name']) |
|||
# mubiao= '机动警察###https://yhdm6.top/index.php/vod/detail/id/18293.html###https://pic.lzzypic.com/upload/vod/20230825-1/c4b3a6eb89c83879b81e5aa996d5e212.jpg' |
|||
# playTabulation=T.detailContent(array=[mubiao,]) |
|||
# print(playTabulation) |
|||
# m3u8=T.playerContent(flag='',id='https://yhdm6.top/index.php/vod/play/id/18293/sid/1/nid/6.html',vipFlags=True) |
|||
# print(m3u8) |
|||
# print(T.config['filter']) |
@ -0,0 +1,36 @@ |
|||
var rule = { |
|||
title:'腾云驾雾', |
|||
host:'https://v.%71%71.com', |
|||
homeUrl:'/x/bu/pagesheet/list?_all=1&append=1&channel=choice&listpage=1&offset=0&pagesize=20', |
|||
detailUrl:'https://node.video.%71%71.com/x/api/float_vinfo2?cid=fyid', |
|||
searchUrl:'/x/search/?q=**&stag=fypage', |
|||
searchable:2, |
|||
filterable:1, |
|||
multi:1, |
|||
url:'/x/bu/pagesheet/list?_all=1&append=1&channel=fyclass&listpage=1&offset=((fypage-1)*20)&pagesize=20', |
|||
headers:{ |
|||
'User-Agent':'PC_UA' |
|||
}, |
|||
timeout:5000, |
|||
cate_exclude:'会员|游戏|全部', |
|||
class_name:'电影&电视剧&综艺&动漫&少儿&纪录片', |
|||
class_url:'movie&tv&variety&cartoon&child&doco', |
|||
limit:20, |
|||
play_parse: true, |
|||
lazy:`js:
|
|||
let parseurl = 'http://119.91.31.224:9003/txqq.php?url='; |
|||
let response = JSON.parse(request(parseurl + input)); |
|||
if (response.code == 200){ |
|||
input = { |
|||
jx: 0, |
|||
parse: 0, |
|||
url: response.url |
|||
} |
|||
} |
|||
`,
|
|||
|
|||
推荐:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float', |
|||
一级:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float', |
|||
二级:'js:VOD={};let d=[];let video_list=[];let video_lists=[];let list=[];let QZOutputJson;let html=fetch(input,fetch_params);let sourceId=/get_playsource/.test(input)?input.match(/id=(\\d*?)&/)[1]:input.split("cid=")[1];let cid=sourceId;let detailUrl="https://v.%71%71.com/detail/m/"+cid+".html";log("详情页:"+detailUrl);var pdfh=jsp.pdfh;var pd=jsp.pd;try{let json=JSON.parse(html);VOD={vod_url:input,vod_name:json.c.title,type_name:json.typ.join(","),vod_actor:json.nam.join(","),vod_year:json.c.year,vod_content:json.c.description,vod_remarks:json.rec,vod_pic:urljoin2(input,json.c.pic)}}catch(e){log("解析片名海报等基础信息发生错误:"+e.message)}if(/get_playsource/.test(input)){eval(html);let indexList=QZOutputJson.PlaylistItem.indexList;indexList.forEach(function(it){let dataUrl="https://s.video.qq.com/get_playsource?id="+sourceId+"&plat=2&type=4&data_type=3&range="+it+"&video_type=10&plname=qq&otype=json";eval(fetch(dataUrl,fetch_params));let vdata=QZOutputJson.PlaylistItem.videoPlayList;vdata.forEach(function(item){d.push({title:item.title,pic_url:item.pic,desc:item.episode_number+"\\t\\t\\t播放量:"+item.thirdLine,url:item.playUrl})});video_lists=video_lists.concat(vdata)})}else{let json=JSON.parse(html);video_lists=json.c.video_ids;let url="https://v.qq.com/x/cover/"+sourceId+".html";if(video_lists.length===1){let vid=video_lists[0];url="https://v.qq.com/x/cover/"+cid+"/"+vid+".html";d.push({title:"在线播放",url:url})}else if(video_lists.length>1){for(let i=0;i<video_lists.length;i+=30){video_list.push(video_lists.slice(i,i+30))}video_list.forEach(function(it,idex){let o_url="https://union.video.qq.com/fcgi-bin/data?otype=json&tid=682&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist="+it.join(",");let o_html=fetch(o_url,fetch_params);eval(o_html);QZOutputJson.results.forEach(function(it1){it1=it1.fields;let url="https://v.qq.com/x/cover/"+cid+"/"+it1.vid+".html";d.push({title:it1.title,pic_url:it1.pic160x90.replace("/160",""),desc:it1.video_checkup_time,url:url,type:it1.category_map&&it1.category_map.length>1?it1.category_map[1]:""})})})}}let yg=d.filter(function(it){return it.type&&it.type!=="正片"});let zp=d.filter(function(it){return!(it.type&&it.type!=="正片")});VOD.vod_play_from=yg.length<1?"qq":"qq$$$qq 预告及花絮";VOD.vod_play_url=yg.length<1?d.map(function(it){return it.title+"$"+it.url}).join("#"):[zp,yg].map(function(it){return it.map(function(its){return its.title+"$"+its.url}).join("#")}).join("$$$");', |
|||
搜索:'js:let d=[];pdfa=jsp.pdfa;pdfh=jsp.pdfh;pd=jsp.pd;let html=request(input);let baseList=pdfa(html,"body&&.result_item_v");baseList.forEach(function(it){let longText=pdfh(it,".result_title&&Text");let shortText=pdfh(it,".sub&&Text");let fromTag=pdfh(it,".result_source&&Text");let score=pdfh(it,".result_score&&Text");let content=pdfh(it,".desc_text&&Text");let url=pdfh(it,".result_title&&a&&href");let img=pd(it,".figure_pic&&src");url="https://node.video.qq.com/x/api/float_vinfo2?cid="+url.match(/.*\\/(.*?)\\.html/)[1];log(shortText+"|"+url);if(fromTag.match(/腾讯/)){d.push({title:longText.split(shortText)[0],img:img,url:url,content:content,desc:"⭐"+longText.split(shortText)[1]+"-"+shortText+" "+score})}});setResult(d);', |
|||
} |
39
libs/优酷.js
File diff suppressed because one or more lines are too long
View File
File diff suppressed because one or more lines are too long
View File
1
libs/协议.js
File diff suppressed because one or more lines are too long
View File
File diff suppressed because one or more lines are too long
View File
@ -0,0 +1,36 @@ |
|||
var rule = { |
|||
title:'武享吧', |
|||
host:'https://www.hula8.net', |
|||
url: '/fyclass/page/fypage', |
|||
searchUrl: '/page/fypage/?s=**', |
|||
searchable:2, |
|||
quickSearch:0, |
|||
headers:{ |
|||
'User-Agent': 'PC_UA', |
|||
'Referer': 'https://www.hula8.net/', |
|||
'Cookie':'esc_search_captcha=1;result=12' |
|||
}, |
|||
timeout:5000,//网站的全局请求超时,默认是3000毫秒
|
|||
class_parse: '#menu-xinjian&&li;a&&Text;a&&href;net/(.*)', |
|||
play_parse:true, |
|||
cate_exclude:'首 页|赛事预告|美国格斗赛|亚洲格斗赛|其他格斗赛|日本搏击赛|裸拳赛', |
|||
limit:6, |
|||
推荐: 'div.apc-grid-item;*;*;.views&&Text;a&&href', |
|||
一级: '.site-main&&article;img&&alt;img&&data-original;.grid-inf-l&&Text;a&&href', |
|||
二级: { |
|||
"title": "h1&&Text;.module-info-tag&&Text", |
|||
"img": ".aligncenter&&data-original", |
|||
"desc": ";;;.views:eq(0)&&Text;", |
|||
"content": "h1&&Text", |
|||
"tabs": "js:TABS=['喵喵在线']", |
|||
"lists": `js:
|
|||
var html = JSON.parse(request(input).match(/var bevideo_vids_.*?=({[\\s\\S]*?});/)[1]); |
|||
let list = []; |
|||
list = html.m3u8dplayer.map(function(item) { |
|||
return item.pre + "$" + item.video |
|||
}); |
|||
LISTS = [list]; |
|||
`
|
|||
}, |
|||
搜索: '*;*;*;.entry-meta&&Text;*', |
|||
} |
@ -0,0 +1,274 @@ |
|||
if (typeof Object.assign != 'function') { |
|||
Object.assign = function () { |
|||
var target = arguments[0]; |
|||
for (var i = 1; i < arguments.length; i++) { |
|||
var source = arguments[i]; |
|||
for (var key in source) { |
|||
if (Object.prototype.hasOwnProperty.call(source, key)) { |
|||
target[key] = source[key]; |
|||
} |
|||
} |
|||
} |
|||
return target; |
|||
}; |
|||
} |
|||
function getMubans() { |
|||
var mubanDict = { // 模板字典
|
|||
mxpro: { |
|||
title: '', |
|||
host: '', |
|||
// homeUrl:'/',
|
|||
url: '/vodshow/fyclass--------fypage---.html', |
|||
searchUrl: '/vodsearch/**----------fypage---.html', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
|||
'User-Agent': 'MOBILE_UA', |
|||
// "Cookie": "searchneed=ok"
|
|||
}, |
|||
class_parse: '.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href', |
|||
二级: { |
|||
"title": "h1&&Text;.module-info-tag&&Text", |
|||
"img": ".lazyload&&data-original", |
|||
"desc": ".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text", |
|||
"content": ".module-info-introduction&&Text", |
|||
"tabs": ".module-tab-item", |
|||
"lists": ".module-play-list:eq(#id) a" |
|||
}, |
|||
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text', |
|||
}, |
|||
mxone5: { |
|||
title: '', |
|||
host: '', |
|||
url: '/show/fyclass--------fypage---.html', |
|||
searchUrl: '/search/**----------fypage---.html', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?).html', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href', |
|||
二级: { |
|||
"title": "h1&&Text;.tag-link&&Text", |
|||
"img": ".module-item-pic&&img&&data-src", |
|||
"desc": ".video-info-items:eq(0)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(2)&&Text;.video-info-items:eq(3)&&Text", |
|||
"content": ".vod_content&&Text", |
|||
"tabs": ".module-tab-item", |
|||
"lists": ".module-player-list:eq(#id)&&.scroll-content&&a" |
|||
}, |
|||
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href', |
|||
}, |
|||
首图: { |
|||
title: '', |
|||
host: '', |
|||
url: '/vodshow/fyclass--------fypage---/', |
|||
searchUrl: '/vodsearch/**----------fypage---.html', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
|||
'User-Agent': 'MOBILE_UA', |
|||
// "Cookie": "searchneed=ok"
|
|||
}, |
|||
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href', |
|||
二级: { |
|||
"title": ".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text", |
|||
"img": ".myui-content__thumb .lazyload&&data-original", |
|||
"desc": ".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text", |
|||
"content": ".content&&Text", |
|||
"tabs": ".nav-tabs:eq(0) li", |
|||
"lists": ".myui-content__list:eq(#id) li" |
|||
}, |
|||
搜索: '#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', |
|||
}, |
|||
首图2: { |
|||
title: '', |
|||
host: '', |
|||
url: '/list/fyclass-fypage.html', |
|||
searchUrl: '/vodsearch/**----------fypage---.html', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: { |
|||
'User-Agent': 'UC_UA', |
|||
// "Cookie": ""
|
|||
}, |
|||
// class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
|
|||
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href', |
|||
二级: { |
|||
"title": ".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text", |
|||
"img": ".stui-content__thumb .lazyload&&data-original", |
|||
"desc": ".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text", |
|||
"content": ".detail&&Text", |
|||
"tabs": ".stui-vodlist__head h3", |
|||
"lists": ".stui-content__playlist:eq(#id) li" |
|||
}, |
|||
搜索: 'ul.stui-vodlist__media:eq(0) li,ul.stui-vodlist:eq(0) li,#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', |
|||
搜索1: 'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', |
|||
搜索2: 'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', |
|||
}, |
|||
默认: { |
|||
title: '', |
|||
host: '', |
|||
url: '/vodshow/fyclass--------fypage---.html', |
|||
searchUrl: '/vodsearch/-------------.html?wd=**', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: { |
|||
'User-Agent': 'MOBILE_UA', |
|||
}, |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
double: true, // 推荐内容是否双层定位
|
|||
}, |
|||
vfed: { |
|||
title: '', |
|||
host: '', |
|||
url: '/index.php/vod/show/id/fyclass/page/fypage.html', |
|||
searchUrl: '/index.php/vod/search/page/fypage/wd/**.html', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: { |
|||
'User-Agent': 'UC_UA', |
|||
}, |
|||
// class_parse:'.fed-pops-navbar&&ul.fed-part-rows&&a.fed-part-eone:gt(0):lt(5);a&&Text;a&&href;.*/(.*?).html',
|
|||
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href', |
|||
二级: { |
|||
"title": "h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text", |
|||
"img": ".fed-list-info&&a&&data-original", |
|||
"desc": ".fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text", |
|||
"content": ".fed-part-esan&&Text", |
|||
"tabs": ".fed-drop-boxs&&.fed-part-rows&&li", |
|||
"lists": ".fed-play-item:eq(#id)&&ul:eq(1)&&li" |
|||
}, |
|||
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text', |
|||
}, |
|||
海螺3: { |
|||
title: '', |
|||
host: '', |
|||
searchUrl: '/v_search/**----------fypage---.html', |
|||
url: '/vod_____show/fyclass--------fypage---.html', |
|||
headers: { |
|||
'User-Agent': 'MOBILE_UA' |
|||
}, |
|||
timeout: 5000, |
|||
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html', |
|||
cate_exclude: '明星|专题|最新|排行', |
|||
limit: 40, |
|||
play_parse: true, |
|||
lazy: '', |
|||
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href', |
|||
double: true, |
|||
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href', |
|||
二级: { |
|||
"title": ".hl-infos-title&&Text;.hl-text-conch&&Text", |
|||
"img": ".hl-lazy&&data-original", |
|||
"desc": ".hl-infos-content&&.hl-text-conch&&Text", |
|||
"content": ".hl-content-text&&Text", |
|||
"tabs": ".hl-tabs&&a", |
|||
"lists": ".hl-plays-list:eq(#id)&&li" |
|||
}, |
|||
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
}, |
|||
海螺2: { |
|||
title: '', |
|||
host: '', |
|||
searchUrl: '/index.php/vod/search/page/fypage/wd/**/', |
|||
url: '/index.php/vod/show/id/fyclass/page/fypage/', |
|||
headers: { |
|||
'User-Agent': 'MOBILE_UA' |
|||
}, |
|||
timeout: 5000, |
|||
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/', |
|||
limit: 40, |
|||
play_parse: true, |
|||
lazy: '', |
|||
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href', |
|||
double: true, |
|||
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href', |
|||
二级: { |
|||
"title": "h2&&Text;.deployment&&Text", |
|||
"img": ".lazy&&data-original", |
|||
"desc": ".deployment&&Text", |
|||
"content": ".ec-show&&Text", |
|||
"tabs": "#tag&&a", |
|||
"lists": ".play_list_box:eq(#id)&&li" |
|||
}, |
|||
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
}, |
|||
短视: { |
|||
title: '', |
|||
host: '', |
|||
// homeUrl:'/',
|
|||
url: '/channel/fyclass-fypage.html', |
|||
searchUrl: '/search.html?wd=**', |
|||
searchable: 2,//是否启用全局搜索,
|
|||
quickSearch: 0,//是否启用快速搜索,
|
|||
filterable: 0,//是否启用分类筛选,
|
|||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
|||
'User-Agent': 'MOBILE_UA', |
|||
// "Cookie": "searchneed=ok"
|
|||
}, |
|||
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html', |
|||
cate_exclude: '解析|动态', |
|||
play_parse: true, |
|||
lazy: '', |
|||
limit: 6, |
|||
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href', |
|||
double: true, // 推荐内容是否双层定位
|
|||
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href', |
|||
二级: { |
|||
"title": "h1&&Text;.content-rt&&p:eq(0)&&Text", |
|||
"img": ".img&&img&&data-src", |
|||
"desc": ".content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text", |
|||
"content": ".zkjj_a&&Text", |
|||
"tabs": ".py-tabs&&option", |
|||
"lists": ".player:eq(#id) li" |
|||
}, |
|||
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href', |
|||
} |
|||
|
|||
}; |
|||
return JSON.parse(JSON.stringify(mubanDict)); |
|||
} |
|||
var mubanDict = getMubans(); |
|||
var muban = getMubans(); |
|||
export default {muban,getMubans}; |
34
libs/百忙无果.js
File diff suppressed because one or more lines are too long
View File
File diff suppressed because one or more lines are too long
View File
@ -0,0 +1,39 @@ |
|||
var rule = { |
|||
title:'腾云驾雾', |
|||
host:'https://v.%71%71.com', |
|||
// homeUrl:'/channel/choice?listpage=1&channel=choice&sort=18&_all=1',
|
|||
homeUrl:'/x/bu/pagesheet/list?_all=1&append=1&channel=choice&listpage=1&offset=0&pagesize=21&iarea=-1&sort=18', |
|||
detailUrl:'https://node.video.%71%71.com/x/api/float_vinfo2?cid=fyid', |
|||
// searchUrl:'https://node.video.%71%71.com/x/api/msearch?keyWord=**',
|
|||
searchUrl:'/x/search/?q=**&stag=fypage', |
|||
// searchUrl:'http://s.video.qq.com/smartbox?plat=2&ver=0&num=29&otype=json&query=**',
|
|||
searchable:2, |
|||
filterable:1, |
|||
multi:1, |
|||
// url:'/channel/fyclass?listpage=fypage&channel=fyclass&sort=18&_all=1',
|
|||
url:'/x/bu/pagesheet/list?_all=1&append=1&channel=fyclass&listpage=1&offset=((fypage-1)*21)&pagesize=21&iarea=-1', |
|||
filter_url:'sort={{fl.sort or 18}}&year={{fl.year}}&pay={{fl.pay}}', |
|||
filter:{'choice': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'tv': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'movie': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'variety': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'cartoon': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'child': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}], 'doco': [{'key': 'sort', 'name': '排序', 'value': [{'n': '最热', 'v': '18'}, {'n': '最新', 'v': '19'}, {'n': '好评', 'v': '16'}, {'n': '高分好评', 'v': '21'}]}, {'key': 'pay', 'name': '资费', 'value': [{'n': '全部', 'v': '-1'}, {'n': '免费', 'v': '867'}, {'n': '会员', 'v': '6'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': '-1'}, {'n': '2023', 'v': '2023'}, {'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'}]}]}, |
|||
headers:{ |
|||
'User-Agent':'PC_UA' |
|||
}, |
|||
timeout:5000, |
|||
// class_parse:'.site_channel a;a&&Text;a&&href;channel/(.*)',
|
|||
cate_exclude:'会员|游戏|全部', |
|||
class_name:'精选&电视剧&电影&综艺&动漫&少儿&纪录片', |
|||
class_url:'choice&tv&movie&variety&cartoon&child&doco', |
|||
limit:20, |
|||
// play_parse:true,
|
|||
// 手动调用解析请求json的url,此lazy不方便
|
|||
lazy:'js:input="https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input', |
|||
推荐:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float', |
|||
一级:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float', |
|||
// 二级:{is_json:1,"title":"data.title;data.moviecategory[0]+data.moviecategory[1]","img":"data.cdncover","desc":"data.area[0];data.director[0]","content":"data.description","tabs":"data.playlink_sites;data.playlinksdetail.#idv.quality","lists":"data.playlinksdetail.#idv.default_url"},
|
|||
// 二级:{is_json:1,"title":"data.title;data.moviecategory[0]+data.moviecategory[1]","img":"data.cdncover","desc":"data.area[0];data.director[0]","content":"data.description","tabs":"data.playlink_sites","lists":"data.playlinksdetail.#idv.default_url"},
|
|||
二级:'', |
|||
二级:'js:VOD={};let d=[];let video_list=[];let video_lists=[];let list=[];let QZOutputJson;let html=fetch(input,fetch_params);let sourceId=/get_playsource/.test(input)?input.match(/id=(\\d*?)&/)[1]:input.split("cid=")[1];let cid=sourceId;let detailUrl="https://v.%71%71.com/detail/m/"+cid+".html";log("详情页:"+detailUrl);var pdfh=jsp.pdfh;var pd=jsp.pd;try{let json=JSON.parse(html);VOD={vod_url:input,vod_name:json.c.title,type_name:json.typ.join(","),vod_actor:json.nam.join(","),vod_year:json.c.year,vod_content:json.c.description,vod_remarks:json.rec,vod_pic:urljoin2(input,json.c.pic)}}catch(e){log("解析片名海报等基础信息发生错误:"+e.message)}if(/get_playsource/.test(input)){eval(html);let indexList=QZOutputJson.PlaylistItem.indexList;indexList.forEach(function(it){let dataUrl="https://s.video.qq.com/get_playsource?id="+sourceId+"&plat=2&type=4&data_type=3&range="+it+"&video_type=10&plname=qq&otype=json";eval(fetch(dataUrl,fetch_params));let vdata=QZOutputJson.PlaylistItem.videoPlayList;vdata.forEach(function(item){d.push({title:item.title,pic_url:item.pic,desc:item.episode_number+"\\t\\t\\t播放量:"+item.thirdLine,url:item.playUrl})});video_lists=video_lists.concat(vdata)})}else{let json=JSON.parse(html);video_lists=json.c.video_ids;let url="https://v.qq.com/x/cover/"+sourceId+".html";if(video_lists.length===1){let vid=video_lists[0];url="https://v.qq.com/x/cover/"+cid+"/"+vid+".html";d.push({title:"在线播放",url:url})}else if(video_lists.length>1){for(let i=0;i<video_lists.length;i+=30){video_list.push(video_lists.slice(i,i+30))}video_list.forEach(function(it,idex){let o_url="https://union.video.qq.com/fcgi-bin/data?otype=json&tid=682&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist="+it.join(",");let o_html=fetch(o_url,fetch_params);eval(o_html);QZOutputJson.results.forEach(function(it1){it1=it1.fields;let url="https://v.qq.com/x/cover/"+cid+"/"+it1.vid+".html";d.push({title:it1.title,pic_url:it1.pic160x90.replace("/160",""),desc:it1.video_checkup_time,url:url,type:it1.category_map&&it1.category_map.length>1?it1.category_map[1]:""})})})}}let yg=d.filter(function(it){return it.type&&it.type!=="正片"});let zp=d.filter(function(it){return!(it.type&&it.type!=="正片")});VOD.vod_play_from=yg.length<1?"qq":"qq$$$qq 预告及花絮";VOD.vod_play_url=yg.length<1?d.map(function(it){return it.title+"$"+it.url}).join("#"):[zp,yg].map(function(it){return it.map(function(its){return its.title+"$"+its.url}).join("#")}).join("$$$");', |
|||
// 二级:'js:VOD={};let d=[];let video_list=[];let video_lists=[];let list=[];let QZOutputJson;let html=fetch(input,fetch_params);let sourceId=/get_playsource/.test(input)?input.match(/id=(\\d*?)&/)[1]:input.split("cid=")[1];let cid=sourceId;let detailUrl="https://v.%71%71.com/detail/m/"+cid+".html";log("详情页:"+detailUrl);var pdfh=jsp.pdfh;var pd=jsp.pd;try{let json=JSON.parse(html);VOD={vod_url:input,vod_name:json.c.title,type_name:json.typ.join(","),vod_actor:json.nam.join(","),vod_year:json.c.year,vod_content:json.c.description,vod_remarks:json.rec,vod_pic:urljoin2(input,json.c.pic)}}catch(e){log("解析片名海报等基础信息发生错误:"+e.message)}if(/get_playsource/.test(input)){eval(html);let indexList=QZOutputJson.PlaylistItem.indexList;indexList.forEach(function(it){let dataUrl="https://s.video.qq.com/get_playsource?id="+sourceId+"&plat=2&type=4&data_type=3&range="+it+"&video_type=10&plname=qq&otype=json";eval(fetch(dataUrl,fetch_params));let vdata=QZOutputJson.PlaylistItem.videoPlayList;vdata.forEach(function(item){d.push({title:item.title,pic_url:item.pic,desc:item.episode_number+"\\t\\t\\t播放量:"+item.thirdLine,url:item.playUrl})});video_lists=video_lists.concat(vdata)})}else{let json=JSON.parse(html);video_lists=json.c.video_ids;let url="https://v.qq.com/x/cover/"+sourceId+".html";if(json.c.type===10){let dataUrl="https://s.video.qq.com/get_playsource?id="+json.c.column_id+"&plat=2&type=2&data_type=3&video_type=8&plname=qq&otype=json";let o_html=fetch(dataUrl,fetch_params);eval(o_html);video_lists=[];let indexList=QZOutputJson.PlaylistItem.indexList;indexList.forEach(function(it){let dataUrl="https://s.video.qq.com/get_playsource?id="+json.c.column_id+"&plat=2&type=4&data_type=3&range="+it+"&video_type=10&plname=qq&otype=json";eval(fetch(dataUrl,fetch_params));let vdata=QZOutputJson.PlaylistItem.videoPlayList;vdata.forEach(function(item){d.push({title:item.title,pic_url:item.pic,desc:item.episode_number+"\\t\\t\\t播放量:"+item.thirdLine,url:item.playUrl})});video_lists=video_lists.concat(vdata)})}else if(video_lists.length===1){d.push({title:"在线播放",url:url})}else if(video_lists.length>1){for(let i=0;i<video_lists.length;i+=30){video_list.push(video_lists.slice(i,i+30))}video_list.forEach(function(it,idex){let o_url="https://union.video.qq.com/fcgi-bin/data?otype=json&tid=682&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist="+it.join(",");let o_html=fetch(o_url,fetch_params);eval(o_html);QZOutputJson.results.forEach(function(it1){it1=it1.fields;let url="https://v.qq.com/x/cover/"+cid+"/"+it1.vid+".html";d.push({title:it1.title,pic_url:it1.pic160x90.replace("/160",""),desc:it1.video_checkup_time,url:url,type:it1.category_map&&it1.category_map.length>1?it1.category_map[1]:""})})})}}let yg=d.filter(function(it){return it.type&&it.type!=="正片"});let zp=d.filter(function(it){return!(it.type&&it.type!=="正片")});VOD.vod_play_from=yg.length<1?"qq":"qq$$$qq 预告及花絮";VOD.vod_play_url=yg.length<1?d.map(function(it){return it.title+"$"+it.url}).join("#"):[zp,yg].map(function(it){return it.map(function(its){return its.title+"$"+its.url}).join("#")}).join("$$$");',
|
|||
// 搜索:'json:uiData;data[0].title;data[0].posterPic;.titleMarkLabelList[1].primeText;data[0].id;data[0].publishDate',
|
|||
搜索:'js:let d=[];pdfa=jsp.pdfa;pdfh=jsp.pdfh;pd=jsp.pd;let html=request(input);let baseList=pdfa(html,"body&&.result_item_v");baseList.forEach(function(it){let longText=pdfh(it,".result_title&&Text");let shortText=pdfh(it,".sub&&Text");let fromTag=pdfh(it,".result_source&&Text");let score=pdfh(it,".result_score&&Text");let content=pdfh(it,".desc_text&&Text");let url=pdfh(it,".result_title&&a&&href");let img=pd(it,".figure_pic&&src");url="https://node.video.qq.com/x/api/float_vinfo2?cid="+url.match(/.*\\/(.*?)\\.html/)[1];log(shortText+"|"+url);if(fromTag.match(/腾讯/)){d.push({title:longText.split(shortText)[0],img:img,url:url,content:content,desc:"⭐"+longText.split(shortText)[1]+"-"+shortText+" "+score})}});setResult(d);', |
|||
// 搜索:'json:item;word;dc;class;id;sn',
|
|||
} |
@ -0,0 +1,696 @@ |
|||
var rule = { |
|||
title: 'drpy', |
|||
host: 'https://frodo.douban.com', |
|||
apidoc: 'https://www.doubanapi.com', |
|||
homeUrl: '', |
|||
searchUrl: '', |
|||
searchable: 1, |
|||
quickSearch: 1, |
|||
filterable: 1, |
|||
// 分类链接fypage参数支持1个()表达式
|
|||
url: '/?pg=fypage&class=fyclass&douban=$douban', |
|||
filter_url: 'fl={{fl}}', |
|||
图片来源: '@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36', |
|||
headers: { |
|||
"Host": "frodo.douban.com", |
|||
// "Host": "api.douban.com",
|
|||
"Connection": "Keep-Alive", |
|||
"Referer": "https://servicewechat.com/wx2f9b06c1de1ccfca/84/page-frame.html", |
|||
// "content-type": "application/json",
|
|||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat" |
|||
}, |
|||
timeout: 5000, |
|||
|
|||
class_name: '电影-热门&电视剧-热门&电影-筛选&电视剧-筛选&综艺-热门', |
|||
class_url: 'hot_gaia&tv_hot&movie&tv&show_hot', |
|||
|
|||
//class_name:'我的豆瓣&热门电影&热播剧集&热播综艺&电影筛选&电视筛选&电影榜单&电视榜单',
|
|||
//class_url:'interests&hot_gaia&tv_hot&show_hot&movie&tv&rank_list_movie&rank_list_tv',
|
|||
filter: { |
|||
'interests': [{ |
|||
'key': 'status', |
|||
'name': '状态', |
|||
'value': [{ |
|||
'n': '想看', |
|||
'v': 'mark' |
|||
}, { |
|||
'n': '在看', |
|||
'v': 'doing' |
|||
}, { |
|||
'n': '看过', |
|||
'v': 'done' |
|||
}] |
|||
}, { |
|||
'key': 'subtype_tag', |
|||
'name': '形式', |
|||
'value': [{ |
|||
'n': '全部', |
|||
'v': '' |
|||
}, { |
|||
'n': '电影', |
|||
'v': 'movie' |
|||
}, { |
|||
'n': '电视', |
|||
'v': 'tv' |
|||
}] |
|||
}, { |
|||
'key': 'year_tag', |
|||
'name': '年代', |
|||
'value': [{ |
|||
'n': '全部', |
|||
'v': '全部' |
|||
}, { |
|||
'n': '2023', |
|||
'v': '2023' |
|||
}, { |
|||
'n': '2022', |
|||
'v': '2022' |
|||
}, { |
|||
'n': '2021', |
|||
'v': '2021' |
|||
}, { |
|||
'n': '2020', |
|||
'v': '2020' |
|||
}, { |
|||
'n': '2019', |
|||
'v': '2019' |
|||
}, { |
|||
'n': '2010年代', |
|||
'v': '2010年代' |
|||
}, { |
|||
'n': '2000年代', |
|||
'v': '2000年代' |
|||
}, { |
|||
'n': '90年代', |
|||
'v': '90年代' |
|||
}, { |
|||
'n': '80年代', |
|||
'v': '80年代' |
|||
}, { |
|||
'n': '70年代', |
|||
'v': '70年代' |
|||
}, { |
|||
'n': '60年代', |
|||
'v': '60年代' |
|||
}, { |
|||
'n': '更早', |
|||
'v': '更早' |
|||
}] |
|||
}], |
|||
'hot_gaia': [{ |
|||
'key': 'sort', |
|||
'name': '排序', |
|||
'value': [{ |
|||
'n': '热度', |
|||
'v': 'recommend' |
|||
}, { |
|||
'n': '最新', |
|||
'v': 'time' |
|||
}, { |
|||
'n': '评分', |
|||
'v': 'rank' |
|||
}] |
|||
}, { |
|||
'key': 'area', |
|||
'name': '地区', |
|||
'value': [{ |
|||
'n': '全部', |
|||
'v': '全部' |
|||
}, { |
|||
'n': '华语', |
|||
'v': '华语' |
|||
}, { |
|||
'n': '欧美', |
|||
'v': '欧美' |
|||
}, { |
|||
'n': '韩国', |
|||
'v': '韩国' |
|||
}, { |
|||
'n': '日本', |
|||
'v': '日本' |
|||
}] |
|||
}], |
|||
'tv_hot': [{ |
|||
'key': 'type', |
|||
'name': '分类', |
|||
'value': [{ |
|||
'n': '综合', |
|||
'v': 'tv_hot' |
|||
}, { |
|||
'n': '国产剧', |
|||
'v': 'tv_domestic' |
|||
}, { |
|||
'n': '欧美剧', |
|||
'v': 'tv_american' |
|||
}, { |
|||
'n': '日剧', |
|||
'v': 'tv_japanese' |
|||
}, { |
|||
'n': '韩剧', |
|||
'v': 'tv_korean' |
|||
}, { |
|||
'n': '动画', |
|||
'v': 'tv_animation' |
|||
}] |
|||
}], |
|||
'show_hot': [{ |
|||
'key': 'type', |
|||
'name': '分类', |
|||
'value': [{ |
|||
'n': '综合', |
|||
'v': 'show_hot' |
|||
}, { |
|||
'n': '国内', |
|||
'v': 'show_domestic' |
|||
}, { |
|||
'n': '国外', |
|||
'v': 'show_foreign' |
|||
}] |
|||
}], |
|||
'movie': [{ |
|||
'key': '类型', |
|||
'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': '短片' |
|||
}] |
|||
}, { |
|||
'key': '地区', |
|||
'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': '丹麦' |
|||
}] |
|||
}, /*{ |
|||
'key': 'sort', |
|||
'name': '排序', |
|||
'value': [{ |
|||
'n': '近期热度', |
|||
'v': 'T' |
|||
}, { |
|||
'n': '首映时间', |
|||
'v': 'R' |
|||
}, { |
|||
'n': '高分优先', |
|||
'v': 'S' |
|||
}] |
|||
},*/ { |
|||
'key': '年代', |
|||
'name': '年代', |
|||
'value': [{ |
|||
'n': '全部年代', |
|||
'v': '' |
|||
}, { |
|||
'n': '2023', |
|||
'v': '2023' |
|||
}, { |
|||
'n': '2022', |
|||
'v': '2022' |
|||
}, { |
|||
'n': '2021', |
|||
'v': '2021' |
|||
}, { |
|||
'n': '2020', |
|||
'v': '2020' |
|||
}, { |
|||
'n': '2019', |
|||
'v': '2019' |
|||
}, { |
|||
'n': '2010年代', |
|||
'v': '2010年代' |
|||
}, { |
|||
'n': '2000年代', |
|||
'v': '2000年代' |
|||
}, { |
|||
'n': '90年代', |
|||
'v': '90年代' |
|||
}, { |
|||
'n': '80年代', |
|||
'v': '80年代' |
|||
}, { |
|||
'n': '70年代', |
|||
'v': '70年代' |
|||
}, { |
|||
'n': '60年代', |
|||
'v': '60年代' |
|||
}, { |
|||
'n': '更早', |
|||
'v': '更早' |
|||
}] |
|||
}], |
|||
'tv': [{ |
|||
'key': '类型', |
|||
'name': '类型', |
|||
'value': [{ |
|||
'n': '不限', |
|||
'v': '' |
|||
}, { |
|||
'n': '电视剧', |
|||
'v': '电视剧' |
|||
}, { |
|||
'n': '综艺', |
|||
'v': '综艺' |
|||
}] |
|||
}, { |
|||
'key': '电视剧形式', |
|||
'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': '音乐' |
|||
}] |
|||
}, { |
|||
'key': '综艺形式', |
|||
'name': '综艺', |
|||
'value': [{ |
|||
'n': '不限', |
|||
'v': '' |
|||
}, { |
|||
'n': '真人秀', |
|||
'v': '真人秀' |
|||
}, { |
|||
'n': '脱口秀', |
|||
'v': '脱口秀' |
|||
}, { |
|||
'n': '音乐', |
|||
'v': '音乐' |
|||
}, { |
|||
'n': '歌舞', |
|||
'v': '歌舞' |
|||
}] |
|||
}, { |
|||
'key': '地区', |
|||
'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': 'sort', |
|||
'name': '排序', |
|||
'value': [{ |
|||
'n': '近期热度', |
|||
'v': 'T' |
|||
}, { |
|||
'n': '首播时间', |
|||
'v': 'R' |
|||
}, { |
|||
'n': '高分优先', |
|||
'v': 'S' |
|||
}] |
|||
}, */ |
|||
{ |
|||
'key': '年代', |
|||
'name': '年代', |
|||
'value': [{ |
|||
'n': '全部', |
|||
'v': '' |
|||
}, { |
|||
'n': '2023', |
|||
'v': '2023' |
|||
}, { |
|||
'n': '2022', |
|||
'v': '2022' |
|||
}, { |
|||
'n': '2021', |
|||
'v': '2021' |
|||
}, { |
|||
'n': '2020', |
|||
'v': '2020' |
|||
}, { |
|||
'n': '2019', |
|||
'v': '2019' |
|||
}, { |
|||
'n': '2010年代', |
|||
'v': '2010年代' |
|||
}, { |
|||
'n': '2000年代', |
|||
'v': '2000年代' |
|||
}, { |
|||
'n': '90年代', |
|||
'v': '90年代' |
|||
}, { |
|||
'n': '80年代', |
|||
'v': '80年代' |
|||
}, { |
|||
'n': '70年代', |
|||
'v': '70年代' |
|||
}, { |
|||
'n': '60年代', |
|||
'v': '60年代' |
|||
}, { |
|||
'n': '更早', |
|||
'v': '更早' |
|||
}] |
|||
}, { |
|||
'key': '平台', |
|||
'name': '平台', |
|||
'value': [{ |
|||
'n': '全部', |
|||
'v': '' |
|||
}, { |
|||
'n': '腾讯视频', |
|||
'v': '腾讯视频' |
|||
}, { |
|||
'n': '爱奇艺', |
|||
'v': '爱奇艺' |
|||
}, { |
|||
'n': '优酷', |
|||
'v': '优酷' |
|||
}, { |
|||
'n': '湖南卫视', |
|||
'v': '湖南卫视' |
|||
}, { |
|||
'n': 'Netflix', |
|||
'v': 'Netflix' |
|||
}, { |
|||
'n': 'HBO', |
|||
'v': 'HBO' |
|||
}, { |
|||
'n': 'BBC', |
|||
'v': 'BBC' |
|||
}, { |
|||
'n': 'NHK', |
|||
'v': 'NHK' |
|||
}, { |
|||
'n': 'CBS', |
|||
'v': 'CBS' |
|||
}, { |
|||
'n': 'NBC', |
|||
'v': 'NBC' |
|||
}, { |
|||
'n': 'tvN', |
|||
'v': 'tvN' |
|||
}] |
|||
}], |
|||
'rank_list_movie': [{ |
|||
'key': '榜单', |
|||
'name': '榜单', |
|||
'value': [{ |
|||
'n': '实时热门电影', |
|||
'v': 'movie_real_time_hotest' |
|||
}, { |
|||
'n': '一周口碑电影榜', |
|||
'v': 'movie_weekly_best' |
|||
}, { |
|||
'n': '豆瓣电影Top250', |
|||
'v': 'movie_top250' |
|||
}] |
|||
}], |
|||
'rank_list_tv': [{ |
|||
'key': '榜单', |
|||
'name': '榜单', |
|||
'value': [{ |
|||
'n': '实时热门电视', |
|||
'v': 'tv_real_time_hotest' |
|||
}, { |
|||
'n': '华语口碑剧集榜', |
|||
'v': 'tv_chinese_best_weekly' |
|||
}, { |
|||
'n': '全球口碑剧集榜', |
|||
'v': 'tv_global_best_weekly' |
|||
}, { |
|||
'n': '国内口碑综艺榜', |
|||
'v': 'show_chinese_best_weekly' |
|||
}, { |
|||
'n': '国外口碑综艺榜', |
|||
'v': 'show_global_best_weekly' |
|||
}] |
|||
}] |
|||
}, |
|||
limit: 20, |
|||
play_parse: false, |
|||
推荐: '', |
|||
推荐: 'js:let d=[];let douban_api_host="http://api.douban.com/api/v2";let miniapp_apikey="0ac44ae016490db2204ce0a042db2916";const count=30;function miniapp_request(path,query){try{let url=douban_api_host+path;query.apikey=miniapp_apikey;fetch_params.headers=oheaders;url=buildUrl(url,query);let html=fetch(url,fetch_params);return JSON.parse(html)}catch(e){print("发生了错误:"+e.message);return{}}}function subject_real_time_hotest(){try{let res=miniapp_request("/subject_collection/subject_real_time_hotest/items",{});let lists=[];let arr=res.subject_collection_items||[];arr.forEach(function(item){if(item.type==="movie"||item.type==="tv"){let rating=item.rating?item.rating.value:"暂无评分";let honnor=(item.honor_infos||[]).map(function(it){return it.title}).join("|");lists.append({vod_id:"msearch:"+TYPE,vod_name:item.title||"",vod_pic:item.pic.normal,vod_remarks:rating+" "+honnor})}});return lists}catch(e){print("发生了错误:"+e.message);return[]}}VODS=subject_real_time_hotest();print(VODS);', |
|||
// 手动调用解析请求json的url,此lazy不方便
|
|||
lazy: '', |
|||
// 推荐:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
|
|||
一级: '', |
|||
一级: 'js:let d=[];let douban=input.split("douban=")[1].split("&")[0];let douban_api_host="http://api.douban.com/api/v2";let miniapp_apikey="0ac44ae016490db2204ce0a042db2916";const count=30;function miniapp_request(path,query){try{let url=douban_api_host+path;query.apikey=miniapp_apikey;fetch_params.headers=oheaders;url=buildUrl(url,query);let html=fetch(url,fetch_params);if(/request_error/.test(html)){print(html)}return JSON.parse(html)}catch(e){print("发生了错误:"+e.message);return{}}}function cate_filter(d,douban){douban=douban||"";try{let res={};if(MY_CATE==="interests"){if(douban){let status=MY_FL.status||"mark";let subtype_tag=MY_FL.subtype_tag||"";let year_tag=MY_FL.year_tag||"全部";let path="/user/"+douban+"/interests";res=miniapp_request(path,{type:"movie",status:status,subtype_tag:subtype_tag,year_tag:year_tag,start:(MY_PAGE-1)*count,count:count})}else{return{}}}else if(MY_CATE==="hot_gaia"){let sort=MY_FL.sort||"recommend";let area=MY_FL.area||"全部";let path="/movie/"+MY_CATE;res=miniapp_request(path,{area:area,sort:sort,start:(MY_PAGE-1)*count,count:count})}else if(MY_CATE==="tv_hot"||MY_CATE==="show_hot"){let stype=MY_FL.type||MY_CATE;let path="/subject_collection/"+stype+"/items";res=miniapp_request(path,{start:(MY_PAGE-1)*count,count:count})}else if(MY_CATE.startsWith("rank_list")){let id=MY_CATE==="rank_list_movie"?"movie_real_time_hotest":"tv_real_time_hotest";id=MY_FL.榜单||id;let path="/subject_collection/"+id+"/items";res=miniapp_request(path,{start:(MY_PAGE-1)*count,count:count})}else{let path="/"+MY_CATE+"/recommend";let selected_categories;let tags;let sort;if(Object.keys(MY_FL).length>0){sort=MY_FL.sort||"T";tags=Object.values(MY_FL).join(",");if(MY_CATE==="movie"){selected_categories={"类型":MY_FL.类型||"","地区":MY_FL.地区||""}}else{selected_categories={"类型":MY_FL.类型||"","形式":MY_FL.类型?MY_FL.类型+"地区":"","地区":MY_FL.地区||""}}}else{sort="T";tags="";if(MY_CATE==="movie"){selected_categories={"类型":"","地区":""}}else{selected_categories={"类型":"","形式":"","地区":""}}}let params={tags:tags,sort:sort,refresh:0,selected_categories:stringify(selected_categories),start:(MY_PAGE-1)*count,count:count};res=miniapp_request(path,params)}let result={page:MY_PAGE,pagecount:Math.ceil(res.total/count),limit:count,total:res.total};let items=[];if(/^rank_list|tv_hot|show_hot/.test(MY_CATE)){items=res["subject_collection_items"]}else if(MY_CATE==="interests"){res["interests"].forEach(function(it){items.push(it.subject)})}else{items=res.items}let lists=[];items.forEach(function(item){if(item.type==="movie"||item.type==="tv"){let rating=item.rating?item.rating.value:"";let rat_str=rating||"暂无评分";let title=item.title;let honor=item.honor_infos||[];let honor_str=honor.map(function(it){return it.title}).join("|");let vod_obj={vod_name:title!=="未知电影"?title:"暂不支持展示",vod_pic:item.pic.normal,vod_remarks:rat_str+" "+honor_str};let vod_obj_d={url:item.type+"$"+item.id,title:title!=="未知电影"?title:"暂不支持展示",pic_url:item.pic.normal,desc:rat_str+" "+honor_str};lists.push(vod_obj);d.push(vod_obj_d)}});result.list=lists;return result}catch(e){print(e.message)}return{}}let res=cate_filter(d,douban);setResult2(res);', |
|||
二级: '', |
|||
搜索: '', |
|||
} |
Loading…
Reference in new issue