Signed-off-by: qcfree <6529067+qcfree@user.noreply.gitee.com>
This commit is contained in:
qcfree 2023-08-06 13:00:22 +00:00 committed by Gitee
parent 70beb89c94
commit 1888a702ac
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
20 changed files with 8324 additions and 0 deletions

175
py/plugin/py_kunyu77.json Normal file
View File

@ -0,0 +1,175 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
class Spider(Spider):
def getName(self):
return "77"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def homeContent(self,filter):
result = {}
url = 'http://api.kunyu77.com/api.php/provide/filter'
rsp = self.fetch(url,headers=self.header)
jo = json.loads(rsp.text)
classes = []
jData = jo['data']
for cKey in jData.keys():
classes.append({
'type_name':jData[cKey][0]['cat'],
'type_id':cKey
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
url = 'http://api.kunyu77.com/api.php/provide/homeBlock?type_id=0'
rsp = self.fetch(url,headers=self.header)
jo = json.loads(rsp.text)
blockList = jo['data']['blocks']
videos = []
for block in blockList:
vodList = block['contents']
for vod in vodList:
videos.append({
"vod_id":vod['id'],
"vod_name":vod['title'],
"vod_pic":vod['videoCover'],
"vod_remarks":vod['msg']
})
result = {
'list':videos
}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if 'type_id' not in extend.keys():
extend['type_id'] = tid
extend['pagenum'] = pg
filterParams = ["type_id", "pagenum"]
params = ["", ""]
for idx in range(len(filterParams)):
fp = filterParams[idx]
if fp in extend.keys():
params[idx] = '&'+filterParams[idx]+'='+extend[fp]
suffix = ''.join(params)
url = 'http://api.kunyu77.com/api.php/provide/searchFilter?pagesize=24{0}'.format(suffix)
rsp = self.fetch(url,headers=self.header)
jo = json.loads(rsp.text)
vodList = jo['data']['result']
videos = []
for vod in vodList:
videos.append({
"vod_id":vod['id'],
"vod_name":vod['title'],
"vod_pic":vod['videoCover'],
"vod_remarks":vod['msg']
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def detailContent(self,array):
tid = array[0]
url = 'http://api.kunyu77.com/api.php/provide/videoDetail?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&version=1.8.7&ids={0}'.format(tid)
rsp = self.fetch(url,headers=self.header)
jo = json.loads(rsp.text)
node = jo['data']
vod = {
"vod_id":node['id'],
"vod_name":node['videoName'],
"vod_pic":node['videoCover'],
"type_name":node['subCategory'],
"vod_year":node['year'],
"vod_area":node['area'],
"vod_remarks":node['msg'],
"vod_actor":node['actor'],
"vod_director":node['director'],
"vod_content":node['brief'].strip()
}
listUrl = 'http://api.kunyu77.com/api.php/provide/videoPlaylist?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&version=1.8.7&ids={0}'.format(tid)
listRsp = self.fetch(listUrl,headers=self.header)
listJo = json.loads(listRsp.text)
playMap = {}
episodes = listJo['data']['episodes']
for ep in episodes:
playurls = ep['playurls']
for playurl in playurls:
source = playurl['playfrom']
if source not in playMap.keys():
playMap[source] = []
playMap[source].append(playurl['title'].strip() + '$' + playurl['playurl'])
playFrom = []
playList = []
for key in playMap.keys():
playFrom.append(key)
playList.append('#'.join(playMap[key]))
vod_play_from = '$$$'
vod_play_from = vod_play_from.join(playFrom)
vod_play_url = '$$$'
vod_play_url = vod_play_url.join(playList)
vod['vod_play_from'] = vod_play_from
vod['vod_play_url'] = vod_play_url
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
url = 'http://api.kunyu77.com/api.php/provide/searchVideo?searchName={0}'.format(key)
rsp = self.fetch(url,headers=self.header)
jo = json.loads(rsp.text)
vodList = jo['data']
videos = []
for vod in vodList:
videos.append({
"vod_id":vod['id'],
"vod_name":vod['videoName'],
"vod_pic":vod['videoCover'],
"vod_remarks":vod['msg']
})
result = {
'list':videos
}
return result
config = {
"player": {},
"filter": {}
}
header = {
"User-Agent":"Dalvik/2.1.0"
}
def playerContent(self,flag,id,vipFlags):
result = {}
url = 'http://api.kunyu77.com/api.php/provide/parserUrl?url={0}'.format(id)
jo = self.fetch(url,headers=self.header).json()
result = {
'parse':0,
'jx':0,
'playUrl':'',
'url':id,
'header':''
}
if flag in vipFlags:
result['parse'] = 1
result['jx'] = 1
return result
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

238
py/plugin/py_lezhutv.json Normal file
View File

@ -0,0 +1,238 @@
# coding=utf-8
# !/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import base64
import hashlib
class Spider(Spider): # type
def getName(self):
return "LeZhuTV"
def init(self, extend=""):
print("============{0}============".format(extend))
pass
def homeContent(self, filter):
result = {}
cateManual = {
"电影": "1",
"连续剧": "2",
"动漫": "4",
"综艺": "3",
"韩剧": "14",
"美剧": "15"
}
classes = []
for k in cateManual:
classes.append({
'type_name': k,
'type_id': cateManual[k]
})
result['class'] = classes
if (filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
rsp = self.fetch("http://www.lezhutv.com")
root = self.html(rsp.text)
aList = root.xpath("//ul[@class='tbox_m2']/li")
videos = []
for a in aList:
name = a.xpath('.//@title')[0]
pic = a.xpath('.//@data-original')[0]
mark = a.xpath(".//span/text()")[0]
sid = a.xpath(".//@href")[0]
sid = self.regStr(sid, "/detail/(\\d+).html")
videos.append({
"vod_id": sid,
"vod_name": name,
"vod_pic": pic,
"vod_remarks": mark
})
result = {
'list': videos
}
return result
def categoryContent(self, tid, pg, filter, extend):
result = {}
ext = extend.get("by","")
url = 'http://www.lezhutv.com/list/{0}_{1}_desc_{2}_0_0___.html'.format(tid,pg,ext)
rsp = self.fetch(url)
root = self.html(rsp.text)
aList = root.xpath("//ul[@class='tbox_m2']/li")
videos = []
for a in aList:
name = a.xpath('.//@title')[0]
pic = a.xpath('.//@data-original')[0]
mark = a.xpath(".//span/text()")[0]
sid = a.xpath(".//@href")[0]
sid = self.regStr(sid, "/detail/(\\d+).html")
videos.append({
"vod_id": sid,
"vod_name": name,
"vod_pic": pic,
"vod_remarks": mark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def detailContent(self, array):
tid = array[0]
url = 'http://www.lezhutv.com/detail/{0}.html'.format(tid)
rsp = self.fetch(url)
root = self.html(rsp.text)
node = root.xpath(".//div[@class='dbox']")[0]
nodes = root.xpath(".//div[@class='tbox2']")[0]
pic = node.xpath(".//div/@data-original")[0]
title = node.xpath('.//h4/text()')[0]
detail = nodes.xpath(".//div[@class='tbox_js']/text()")[0]
yac = node.xpath(".//p[@class='yac']/text()")[0]
yac = yac.split('/')
yacs = yac[0].strip()
type_name = yac[1].strip()
actor = node.xpath(".//p[@class='act']/text()")[0]
director = node.xpath(".//p[@class='dir']/text()")[0]
vod = {
"vod_id": tid,
"vod_name": title,
"vod_pic": pic,
"type_name": type_name,
"vod_year": yacs,
"vod_area": "",
"vod_remarks": "",
"vod_actor": actor,
"vod_director": director,
"vod_content": detail
}
vod_play_from = '$$$'
playFrom = []
vodHeader = root.xpath(".//div[@class='tbox2 tabs']/div/h3/text()")
i=1
for v in vodHeader:
playFrom.append("线路" + str(i))
i = i+1
vod_play_from = vod_play_from.join(playFrom)
vod_play_url = '$$$'
playList = []
vodList = root.xpath("//div[@class='tbox2 tabs']")
for vl in vodList:
vodItems = []
aList = vl.xpath(".//ul/li/a")
for tA in aList:
href = tA.xpath('./@href')[0]
name = tA.xpath('./text()')[0]
tId = self.regStr(href, '/play/(\\S+).html')
vodItems.append(name + "$" + tId)
joinStr = '#'
joinStr = joinStr.join(vodItems)
playList.append(joinStr)
vod_play_url = vod_play_url.join(playList)
vod['vod_play_from'] = vod_play_from
vod['vod_play_url'] = vod_play_url
result = {
'list': [
vod
]
}
return result
def searchContent(self, key, quick):
url = 'http://www.lezhutv.com/search-pg-1-wd-{0}.html'.format(key)
rsp = self.fetch(url)
root = self.html(rsp.text)
seaArray = root.xpath("//ul[@class='tbox_m']/li")
seaList = []
for vod in seaArray:
name = vod.xpath('.//@title')[0]
pic = vod.xpath('.//@data-original')[0]
mark = vod.xpath(".//span/text()")[0]
sid = vod.xpath(".//@href")[0]
sid = self.regStr(sid, "/detail/(\\d+).html")
seaList.append({
"vod_id": sid,
"vod_name": name,
"vod_pic": pic,
"vod_remarks": mark
})
result = {
'list': seaList
}
return result
config = {
"player":{},
"filter":{"1":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}],"2":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}],"3":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}],"4":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}],"14":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}],"15":[{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"score"},{"n":"评分","v":"hits"}]}]}
}
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36"
}
def get_md5(self,value):
b64 = base64.b64encode((base64.b64encode(value.encode()).decode() + "NTY2").encode()).decode()
md5 = hashlib.md5(b64.encode()).hexdigest()
return "".join(char if char.isdigit() else "zyxwvutsrqponmlkjihgfedcba"["abcdefghijklmnopqrstuvwxyz".find(char)] for char in md5)
def playerContent(self, flag, id, vipFlags):
result = {}
url = 'http://www.lezhutv.com/play/{0}.html'.format(id)
rsp = self.fetch(url)
root = self.html(rsp.text)
scripts = root.xpath("//script/text()")
scripts = scripts[1].replace('\n', '')
nid = self.regStr(scripts, 'view_path = \'(.*?)\';')
md5url = 'http://www.lezhutv.com/hls2/index.php?url={0}'.format(nid)
rsp = self.fetch(md5url)
root = self.html(rsp.text)
value = root.xpath(".//input[@id='hdMd5']/@value")
value = ''.join(value)
md5s = self.get_md5(str(value))
data = {
"id": nid,
"type": "vid",
"siteuser": "",
"md5": md5s,
"referer": url,
"hd": "",
"lg": ""
}
payUrl = 'http://www.lezhutv.com/hls2/url.php'
parseRsp = self.post(payUrl,data,headers=self.header)
parseRsps = json.loads(parseRsp.text)
realUrl = parseRsps['media']['url']
if len(realUrl) > 0:
result["parse"] = 0
result["playUrl"] = ""
result["url"] = realUrl
result["header"] = ""
else:
result["parse"] = 1
result["playUrl"] = ""
result["url"] = url
result["header"] = json.dumps(self.header)
return result
def isVideoFormat(self, url):
pass
def manualVideoCheck(self):
pass
def localProxy(self, param):
return [200, "video/MP2T", action, ""]

234
py/plugin/py_libvio.json Normal file

File diff suppressed because one or more lines are too long

92
py/plugin/py_pansou.py Normal file
View File

@ -0,0 +1,92 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import requests
class Spider(Spider):
def getDependence(self):
return ['py_ali']
def getName(self):
return "py_pansou"
def init(self,extend):
self.ali = extend[0]
print("============py_pansou============")
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
return result
def homeVideoContent(self):
result = {}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
return result
def detailContent(self,array):
tid = array[0]
pattern = '(https:\\/\\/www.aliyundrive.com\\/s\\/[^\\\"]+)'
url = self.regStr(tid,pattern)
if len(url) > 0:
return self.ali.detailContent(array)
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
'Referer': 'https://www.alipansou.com/s/' +tid
}
rsp = requests.get('https://www.alipansou.com/cv/'+tid, allow_redirects=False, headers=header)
url = self.regStr(reg=r'href=\"(.*)\"', src=rsp.text)
if len(url) == 0:
return ""
url = url.replace('\\','')
newArray = [url]
print(newArray)
return self.ali.detailContent(newArray)
def searchContent(self,key,quick):
map = {
'7':'文件夹',
'1':'视频'
}
ja = []
for tKey in map.keys():
url = "https://www.alipansou.com/search?k={0}&t={1}".format(key,tKey)
rsp = self.fetch(url)
root = self.html(self.cleanText(rsp.text))
aList = root.xpath("//van-row/a")
for a in aList:
title = ''
divList = a.xpath('.//template/div')
t = divList[0].xpath('string(.)')
t = self.cleanText(t).strip()
title = title + t
remark = divList[1].xpath('string(.)')
remark = self.cleanText(remark).replace('\xa0\xa0','').strip().split(' ')[1]
if key in title:
pic = 'https://www.alipansou.com'+ self.xpText(a,'.//van-card/@thumb')
jo = {
'vod_id': self.regStr(a.xpath('@href')[0],'/s/(.*)'),
'vod_name': '{0}[{1}]'.format(title,remark),
'vod_pic': pic
}
ja.append(jo)
result = {
'list':ja
}
return result
def playerContent(self,flag,id,vipFlags):
return self.ali.playerContent(flag,id,vipFlags)
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

152
py/plugin/py_star.json Normal file

File diff suppressed because one or more lines are too long

228
py/plugin/py_voflix.json Normal file

File diff suppressed because one or more lines are too long

228
py/plugin/py_voflix_1.json Normal file

File diff suppressed because one or more lines are too long

176
py/plugin/py_wmkk.json Normal file
View File

@ -0,0 +1,176 @@
# coding=utf-8
# !/usr/bin/python
import sys
import re
sys.path.append('..')
from base.spider import Spider
class Spider(Spider): # type
def getName(self):
return "完美看看"
def init(self, extend=""):
print("============{0}============".format(extend))
pass
def homeContent(self, filter):
result = {}
cateManual = {
"电影": "1",
"国产剧": "5",
"欧美剧": "2",
"韩剧": "3",
"泰剧": "9",
"日剧": "4",
"动漫": "6",
"综艺": "7",
"纪录片": "10"
}
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 = {}
url = 'https://www.wanmeikk.film/category/{0}-{1}.html'.format(tid, pg)
rsp = self.fetch(url)
root = self.html(rsp.text)
aList = root.xpath("//div[@class='stui-pannel_bd']/ul[1]/li")
videos = []
for a in aList:
name = a.xpath('./div/a/@title')[0]
pic = a.xpath('./div/a/@data-original')[0]
mark = a.xpath("./div/a/span[@class='pic-text text-right']/text()")[0]
sid = a.xpath("./div/a/@href")[0].replace("/", "").replace("project", "").replace(".html", "")
videos.append({
"vod_id": sid,
"vod_name": name,
"vod_pic": pic,
"vod_remarks": mark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def detailContent(self, array):
tid = array[0]
url = 'https://www.wanmeikk.film/project/{0}.html'.format(tid)
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"}
rsp = self.fetch(url, headers=header)
root = self.html(rsp.content)
divContent = root.xpath("//div[@class='col-lg-wide-75 col-xs-1']")[0]
title = divContent.xpath(".//h1[@class='title']/text()")[0]
pic = divContent.xpath(".//a[@class='stui-vodlist__thumb picture v-thumb']/img/@data-original")[0]
detail = divContent.xpath(".//p[@class='desc detail hidden-xs']/span[@class='detail-content']/text()")[0]
vod = {
"vod_id": tid,
"vod_name": title,
"vod_pic": pic,
"type_name": "",
"vod_year": "",
"vod_area": "",
"vod_remarks": "",
"vod_actor": "",
"vod_director": "",
"vod_content": detail
}
infoArray = divContent.xpath(".//div[@class='stui-content__detail']/p[@class='data']")
for info in infoArray:
content = info.xpath('string(.)')
if content.startswith(''):
infon = content.split('\xa0')
for inf in infon:
if inf.startswith(''):
vod['type_name'] = inf.replace("类型:", "")
if inf.startswith(''):
vod['vod_area'] = inf.replace("地区:", "")
if inf.startswith(''):
vod['vod_year'] = inf.replace("年份:", "")
if content.startswith(''):
vod['vod_actor'] = content.replace("\xa0", "/").replace("主演:", "")
if content.startswith(''):
vod['vod_director'] = content.replace("\xa0", "").replace("导演:", "")
vod_play_url = '$$$'
vod['vod_play_from'] = ''
purl = divContent.xpath(".//div[@class='stui-pannel_bd col-pd clearfix']/ul/li")
playList = []
vodItems = []
for plurl in purl:
plaurl = plurl.xpath(".//a/@href")[0]
name = plurl.xpath(".//a/text()")[0]
tId = self.regStr(plaurl, '/play/(\\S+).html')
vodItems.append(name + "$" + tId)
joinStr = '#'
joinStr = joinStr.join(vodItems)
playList.append(joinStr)
vod_play_url = vod_play_url.join(playList)
vod['vod_play_url'] = vod_play_url
result = {
'list': [
vod
]
}
return result
def searchContent(self, key, quick):
result = {}
return result
def playerContent(self, flag, id, vipFlags):
result = {}
url = 'https://www.wanmeikk.film/play/{0}.html'.format(id)
rsp = self.fetch(url)
root = self.html(rsp.text)
scripts = root.xpath("//div[@class='stui-player__video embed-responsive embed-responsive-16by9 clearfix']/script/text()")[0]
key = scripts.split("url")[1].replace('"', "").replace(':', "").replace(',', "").replace("'", "")
surl = 'https://www.wanmeikk.film/dplayer.php?url={0}'.format(key)
srsp = self.fetch(surl)
sroot = self.html(srsp.text)
murl = sroot.xpath("//script[@type='text/javascript']/text()")[0]
mp4url = re.findall(r"var urls = '(.*)';", murl)[0]
result["parse"] = 0
result["playUrl"] = ''
result["url"] = mp4url
result["header"] = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"}
return result
config = {
"player": {},
"filter": {}
}
header = {}
def isVideoFormat(self, url):
pass
def manualVideoCheck(self):
pass
def localProxy(self, param):
action = {
'url': '',
'header': '',
'param': '',
'type': 'string',
'after': ''
}
return [200, "video/MP2T", action, ""]

258
py/plugin/py_xmaomi.json Normal file

File diff suppressed because one or more lines are too long

222
py/plugin/py_xmly.py Normal file
View File

@ -0,0 +1,222 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import math
import json
from requests import session, utils
class Spider(Spider):
def getName(self):
return "喜马拉雅"
def init(self,extend=""):
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"小说": "7",
"儿童": "11",
"评书": "10",
"娱乐": "13",
"悬疑": "14",
"人文": "17",
"国学": "18",
"头条": "24",
"音乐": "19",
"历史": "16",
"情感": "20",
"健康": "22",
"生活": "21",
"影视": "15",
"英语": "29",
"科技": "28",
"体育": "25",
"汽车": "23",
"广播剧": "8",
"小语种": "30",
"教育考试": "32",
"少儿素养": "12",
"商业管理": "27",
"个人提升": "31",
"投资理财": "26",
"相声小品": "9",
}
classes = []
for k in cateManual:
classes.append({
'type_name': k,
'type_id': cateManual[k]
})
result['class'] = classes
if (filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54",
"Referer": "https://www.ximalaya.com/channel/{}/".format(tid)
}
url = 'https://www.ximalaya.com/revision/metadata/v2/channel/albums?pageNum={0}&pageSize=50&sort=1&metadata=&groupId={1}'.format(pg, tid)
rsp = self.fetch(url,headers=header)
jo = json.loads(rsp.text)
videos = []
numvL = len(jo['data']['albums'])
pgc = math.ceil(numvL/15)
for a in jo['data']['albums']:
aid = a['albumId']
img = 'http://imagev2.xmcdn.com/{0}'.format(a['albumCoverPath'])
name = a['albumTitle']
if a['vipType'] == 1:
remark = 'VIP'
else:
remark = ''
videos.append({
"vod_id": aid,
"vod_name": name,
"vod_pic": img,
"vod_remarks": remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = pgc
result['limit'] = numvL
result['total'] = numvL
return result
def detailContent(self,array):
aid = array[0]
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54",
"Referer": "https://www.ximalaya.com/album/{}/".format(aid)
}
pg = 1
url = 'https://www.ximalaya.com/revision/album/v1/getTracksList?albumId={}&pageNum={}&pageSize=30'.format(aid, pg)
rsp = self.fetch(url, headers=header)
jo = json.loads(rsp.text)
items = jo['data']['tracks']
numjo = jo['data']['trackTotalCount']
while len(items) < numjo:
pg = pg + 1
url = 'https://www.ximalaya.com/revision/album/v1/getTracksList?albumId={}&pageNum={}&pageSize=30'.format(aid, pg)
rsp = self.fetch(url, headers=header)
jo = json.loads(rsp.text)
items.extend(jo['data']['tracks'])
playUrl = ''
for item in items:
dir = item['anchorName'].strip()
act = item['anchorName'].strip()
title = item['albumTitle']
pic = 'http://imagev2.xmcdn.com/{0}'.format(item['albumCoverPath'])
year = item['createDateFormat'].split('-')[0]
cont = item['albumTitle']
name = item['title'].strip()
purl = item['trackId']
playUrl = playUrl + '{0}${1}#'.format(name, purl)
vod = {
"vod_id": aid,
"vod_name": title,
"vod_pic": pic,
"type_name": '',
"vod_year": year,
"vod_area": '',
"vod_remarks": '',
"vod_actor": act,
"vod_director": dir,
"vod_content": cont
}
vod['vod_play_from'] = '喜马拉雅'
vod['vod_play_url'] = playUrl
result = {
'list': [
vod
]
}
return result
def searchContent(self,key,quick):
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54",
"Referer": "https://www.ximalaya.com/"
}
url = 'https://www.ximalaya.com/revision/search/main?core=all&kw={}&spellchecker=true&device=iPhone&live=true'.format(key)
rsp = self.fetch(url, headers=header)
jo = json.loads(rsp.text)
items = jo['data']['album']['docs']
pg = 1
while pg < jo['data']['album']['totalPage']:
pg = pg + 1
url = 'https://www.ximalaya.com/revision/search/main?core=album&kw={0}&page={1}&spellchecker=true&rows=20&condition=relation&device=iPhone&fq=&paidFilter=false'.format(key, pg)
rsp = self.fetch(url, headers=header)
jo = json.loads(rsp.text)
items.extend(jo['data']['album']['docs'])
videos = []
for item in items:
name = item['title']
pic = item['coverPath']
if item['vipType'] == 1:
mark = 'VIP'
else:
mark = ''
sid = item['albumId']
videos.append({
"vod_id":sid,
"vod_name":name,
"vod_pic":pic,
"vod_remarks":mark
})
result = {
'list': videos
}
return result
def playerContent(self,flag,id,vipFlags):
result = {}
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54",
"Referer": 'https://www.ximalaya.com/sound/{0}/'.format(id)
}
#这里是游客cookie有vip的填入自己的会员cookie
cookies_str = '_xmLog=h5&48be63f9-2a8a-48e1-b923-d29486aac356&process.env.sdkVersion; xm-page-viewid=ximalaya-web; x_xmly_traffic=utm_source%253A%2526utm_medium%253A%2526utm_campaign%253A%2526utm_content%253A%2526utm_term%253A%2526utm_from%253A'
cookies_dic = dict([co.strip().split('=') for co in cookies_str.split(';')])
rsp = session()
cookies_jar = utils.cookiejar_from_dict(cookies_dic)
rsp.cookie = cookies_jar
url = 'https://www.ximalaya.com/revision/play/v1/audio?id={0}&ptype=1'.format(id)
rsp = self.fetch(url, cookies=rsp.cookie, headers=header)
jo = json.loads(rsp.text)
purl = jo['data']['src']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = purl
result["header"] = ''
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
action = {
'url':'',
'header':'',
'param':'',
'type':'string',
'after':''
}
return [200, "video/MP2T", action, ""]

63
py/plugin/py_yiso.py Normal file
View File

@ -0,0 +1,63 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import requests
class Spider(Spider):
def getDependence(self):
return ['py_ali']
def getName(self):
return "py_yiso"
def init(self,extend):
self.ali = extend[0]
print("============py_yiso============")
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
return result
def homeVideoContent(self):
result = {}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
return result
header = {
"User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36",
"Referer": "https://yiso.fun/"
}
def detailContent(self,array):
return self.ali.detailContent(array)
def searchContent(self,key,quick):
url = "https://yiso.fun/api/search?name={0}&from=ali".format(key)
vodList = requests.get(url=url, headers=self.header, verify=False).json()["data"]["list"]
videos = []
for vod in vodList:
videos.append({
"vod_id": vod["url"],
"vod_name": vod["fileInfos"][0]["fileName"],
"vod_pic": "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
"vod_remarks": vod['gmtCreate']
})
result = {
'list':videos
}
return result
def playerContent(self,flag,id,vipFlags):
return self.ali.playerContent(flag,id,vipFlags)
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

126
py/plugin/py_yixi.json Normal file
View File

@ -0,0 +1,126 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider):
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 = {}
url = 'https://yixi.tv/api/site/category/?_=1'
jo = self.fetch(url,headers=self.header).json()
category = jo['data']['items']
classes = []
classes.append({
'type_name':'',
'type_id':''
})
for cat in category:
classes.append({
'type_name':cat['title'],
'type_id':cat['id']
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
# url = 'https://yixi.tv/api/site/album/?page=1&page_size=4&_=1'
url = 'https://yixi.tv/api/site/album/22/detail/?page=1&page_size=24&_=1'
jo = self.fetch(url,headers=self.header).json()
videos = []
vodList = jo['data']['items']
for vod in vodList:
videos.append({
"vod_id":vod['id'],
"vod_name":vod['title'],
"vod_pic":vod['cover'],
"vod_remarks":vod['time']
})
result = {
'list':videos
}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
url = 'https://yixi.tv/api/site/speech/?page={1}&page_size=12&category_id={0}&order_by=0&_=1'.format(tid,pg)
jo = self.fetch(url,headers=self.header).json()
videos = []
vodList = jo['data']['items']
for vod in vodList:
videos.append({
"vod_id":vod['id'],
"vod_name":vod['title'],
"vod_pic":vod['cover'],
"vod_remarks":vod['time']
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def detailContent(self,array):
tid = array[0]
url = "https://yixi.tv/api/site/speech/{0}/detail/?_=1".format(tid)
jo = self.fetch(url,headers=self.header).json()
vod = {
"vod_id":jo['data']['speech']['id'],
"vod_name":jo['data']['speech']['title'],
"vod_pic":jo['data']['speech']['cover'],
"type_name":jo['data']['speech']['first_category'],
"vod_year":"",
"vod_area":"",
"vod_remarks":jo['data']['speech']['date'],
"vod_actor":"",
"vod_director":"",
"vod_content":jo['data']['speech']['titlelanguage']
}
vod['vod_play_from'] = ''
pList = []
for vUrl in jo['data']['speech']['video_url']:
pList.append(vUrl['type_name']+"$"+vUrl['video_url'])
vod['vod_play_url'] = '#'.join(pList)
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
result = {
'list':[]
}
return result
def playerContent(self,flag,id,vipFlags):
result = {}
result["parse"] = 0
result["playUrl"] = ''
result["url"] = id
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"
}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

85
py/plugin/py_zhaozy.py Normal file
View File

@ -0,0 +1,85 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
class Spider(Spider):
def getDependence(self):
return ['py_ali']
def getName(self):
return "py_zhaozy"
def init(self,extend):
self.ali = extend[0]
print("============py_zhaozy============")
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
return result
def homeVideoContent(self):
result = {}
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
return result
header = {
"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",
"Referer": "https://zhaoziyuan.la/"
}
def detailContent(self,array):
tid = array[0]
print(self.getName())
pattern = '(https://www.aliyundrive.com/s/[^\"]+)'
url = self.regStr(tid,pattern)
if len(url) > 0:
return self.ali.detailContent(array)
rsp = self.fetch('https://zhaoziyuan.la/'+tid)
url = self.regStr(rsp.text,pattern)
if len(url) == 0:
return ""
newArray = [url]
print(newArray)
return self.ali.detailContent(newArray)
def searchContent(self,key,quick):
map = {
'7':'文件夹',
'1':'视频'
}
ja = []
for tKey in map.keys():
url = "https://zhaoziyuan.la/so?filename={0}&t={1}".format(key,tKey)
rsp = self.fetch(url,headers=self.header)
root = self.html(self.cleanText(rsp.text))
aList = root.xpath("//li[@class='clear']//a")
for a in aList:
# title = a.xpath('./h3/text()')[0] + a.xpath('./p/text()')[0]
title = self.xpText(a,'./h3/text()') + self.xpText(a,'./p/text()')
pic = 'https://img0.baidu.com/it/u=603086994,1727626977&fm=253&fmt=auto?w=500&h=667'
jo = {
'vod_id': self.xpText(a,'@href'),
'vod_name': '[{0}]{1}'.format(key,title),
'vod_pic': pic
}
ja.append(jo)
result = {
'list':ja
}
return result
def playerContent(self,flag,id,vipFlags):
return self.ali.playerContent(flag,id,vipFlags)
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

123
py/plugin/sp360.py Normal file
View File

@ -0,0 +1,123 @@
# -*- coding:utf-8 -*-
import requests
import urllib3
urllib3.util.timeout.Timeout._validate_timeout = lambda *args: 5 if args[2] != 'total' else None
Tag = "sp360"
Tag_name = "360影视"
SiteSearch = "https://api.so.360kan.com"
SiteDetail = "https://api.web.360kan.com"
def getHeaders():
headers = {
"User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36",
}
return headers
def searchContent(key, token):
try:
url = f"{SiteSearch}/index?force_v=1&kw={key}&from=&pageno=1&v_ap=1&tab=all"
res = requests.get(url=url, headers=getHeaders()).json()
if len(res["data"]["longData"]):
lists = res["data"]["longData"]["rows"]
else:
return []
videos = []
for vod in lists:
videos.append({
"vod_id": f'{Tag}${vod.get("cat_id", "")}_{vod.get("en_id", "")}',
"vod_name": vod.get("titleTxt", ""),
"vod_pic": vod.get("cover", ""),
"vod_remarks": Tag_name + " " + vod.get("score", "")
})
return videos
except Exception as e:
print(e)
return []
def detailContent(ids, token):
try:
id = ids.split("$")[-1].split("_")
url = f"{SiteDetail}/v1/detail?cat={id[0]}&id={id[1]}"
data = requests.get(url=url, headers=getHeaders()).json()["data"]
vodList = {
"vod_id": ids,
"vod_name": data.get("title", ""),
"vod_pic": data.get("cdncover", ""),
"type_name": ",".join(item for item in data.get("moviecategory", [])),
"vod_year": data.get("pubdate", ""),
"vod_area": ",".join(item for item in data.get("area", [])),
"vod_remarks": data.get("doubanscore", ""),
"vod_actor": ",".join(item for item in data.get("actor", [])),
"vod_director": ",".join(item for item in data.get("director", [])),
"vod_content": data.get("description", ""),
"vod_play_from": "$$$".join(item for item in data.get("playlink_sites", []))
}
delta = 200
vod_play = {}
for site in data.get("playlink_sites", []):
playList = ""
vodItems = []
if "allupinfo" in data:
total = int(data["allupinfo"][site])
for start in range(1, total, delta):
end = total if (start + delta) > total else start + delta - 1
vod_data = requests.get(
url=url,
params={
"start": start,
"end": end,
"site": site
},
headers=getHeaders()
).json()["data"]
if "allepidetail" in vod_data:
vod_data = vod_data["allepidetail"]
for item in vod_data[site]:
vodItems.append(item.get("playlink_num", "") + "$" + f"{Tag}___" + item.get("url", ""))
else:
vod_data = vod_data['defaultepisode']
for item in vod_data:
vodItems.append(item.get('period', "") + item.get('name', "") + "$" + f"{Tag}___" + item.get("url", ""))
else:
item = data["playlinksdetail"][site]
vodItems.append(item.get("sort", "") + "$" + f"{Tag}___" + item.get("default_url", ""))
if len(vodItems):
playList = "#".join(vodItems)
if len(playList) == 0:
continue
vod_play.setdefault(site, playList)
if len(vod_play):
vod_play_url = "$$$".join(vod_play.values())
vodList.setdefault("vod_play_url", vod_play_url)
return [vodList]
except Exception as e:
print(e)
return []
def playerContent(ids, flag, token):
try:
url = ids.split("___")[-1]
return {
"parse": 1,
"playUrl": "",
"jx": "1",
"url": url
}
except Exception as e:
print(e)
return {}
if __name__ == '__main__':
# res = searchContent("月升沧海", "")
# res = searchContent("冰雨火", "")
res = detailContent('sp360$2_QbVqbX7lTGLrMH', "")
print(res)

278
py/plugin/初中教育.py Normal file
View File

@ -0,0 +1,278 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider): # 元类 默认的元类 type
def getName(self):
return "初中"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"7年级地理":"7年级地理",
"7年级生物":"7年级生物",
"7年级物理":"7年级物理",
"7年级化学":"7年级化学",
"8年级语文":"8年级语文",
"8年级数学":"8年级数学",
"8年级英语":"8年级英语",
"8年级历史":"8年级历史",
"8年级地理":"8年级地理",
"8年级生物":"8年级生物",
"8年级物理":"8年级物理",
"8年级化学":"8年级化学",
"9年级语文":"9年级语文",
"9年级数学":"9年级数学",
"9年级英语":"9年级英语",
"9年级历史":"9年级历史",
"9年级地理":"9年级地理",
"9年级生物":"9年级生物",
"9年级物理":"9年级物理",
"9年级化学":"9年级化学"
}
classes = []
for k in cateManual:
classes.append({
'type_name':k,
'type_id':cateManual[k]
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {
'list':[]
}
return result
cookies = ''
def getCookie(self):
import requests
import http.cookies
# 这里填cookie
raw_cookie_line = "buvid3=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; LIVE_BUVID=AUTO4216125328906835; rpdid=|(umRum~uY~R0J'uYukYukkkY; balh_is_closed=; balh_server_inner=__custom__; PVID=4; video_page_version=v_old_home; i-wanna-go-back=-1; CURRENT_BLACKGAP=0; blackside_state=0; fingerprint=8965144a609d60190bd051578c610d72; buvid_fp_plain=undefined; CURRENT_QUALITY=120; hit-dyn-v2=1; nostalgia_conf=-1; buvid_fp=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; CURRENT_FNVAL=4048; DedeUserID=85342; DedeUserID__ckMd5=f070401c4c699c83; b_ut=5; hit-new-style-dyn=0; buvid4=15C64651-E8B7-100C-4B1F-C7CFD2DB473007906-022110820-jYQRaMeS%2BRXRfw14q70%2FLQ%3D%3D; b_nut=1667910208; b_lsid=3CE4AE79_184578915C0; is-2022-channel=1; innersign=0; SESSDATA=a5e4d58d%2C1683641322%2C2c39a%2Ab1; bili_jct=2f3126b5954e37f593130f2fef082cd8; sid=p7tjqv22; bp_video_offset_85342=726936847258746900"
simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
return cookie_jar
def get_dynamic(self,pg):
result = {}
url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['items']
for vod in vodList:
if vod['type'] == 'DYNAMIC_TYPE_AV':
ivod = vod['modules']['module_dynamic']['major']['archive']
aid = str(ivod['aid']).strip()
title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = ivod['cover'].strip()
remark = str(ivod['duration_text']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_hot(self,pg):
result = {}
url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_rank(self):
result = {}
url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = 1
result['pagecount'] = 1
result['limit'] = 90
result['total'] = 999999
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if tid == "热门":
return self.get_hot(pg=pg)
if tid == "排行榜" :
return self.get_rank()
if tid == '动态':
return self.get_dynamic(pg=pg)
url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
if len(self.cookies) <= 0:
self.getCookie()
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] != 0:
rspRetry = self.fetch(url,cookies=self.getCookie())
content = rspRetry.text
jo = json.loads(content)
videos = []
vodList = jo['data']['result']
for vod in vodList:
aid = str(vod['aid']).strip()
title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = 'https:' + vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def cleanSpace(self,str):
return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
def detailContent(self,array):
aid = array[0]
url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
pic = jo['pic']
desc = jo['desc']
typeName = jo['tname']
vod = {
"vod_id":aid,
"vod_name":title,
"vod_pic":pic,
"type_name":typeName,
"vod_year":"",
"vod_area":"bilidanmu",
"vod_remarks":"",
"vod_actor":jo['owner']['name'],
"vod_director":jo['owner']['name'],
"vod_content":desc
}
ja = jo['pages']
playUrl = ''
for tmpJo in ja:
cid = tmpJo['cid']
part = tmpJo['part']
playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
vod['vod_play_from'] = 'B站'
vod['vod_play_url'] = playUrl
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
result = {
'list':search['list']
}
return result
def playerContent(self,flag,id,vipFlags):
# https://www.555dianying.cc/vodplay/static/js/playerconfig.js
result = {}
ids = id.split("_")
url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
rsp = self.fetch(url,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
ja = jo['durl']
maxSize = -1
position = -1
for i in range(len(ja)):
tmpJo = ja[i]
if maxSize < int(tmpJo['size']):
maxSize = int(tmpJo['size'])
position = i
url = ''
if len(ja) > 0:
if position == -1:
position = 0
url = ja[position]['url']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = url
result["header"] = {
"Referer":"https://www.bilibili.com",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
result["contentType"] = 'video/x-flv'
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

4395
py/plugin/哔哩合集.json Normal file

File diff suppressed because it is too large Load Diff

268
py/plugin/搭讪.py Normal file
View File

@ -0,0 +1,268 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider): # 元类 默认的元类 type
def getName(self):
return "多多搭讪"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"美女搭讪":"美女搭讪",
"搭讪技巧":"搭讪技巧",
"女追男":"女追男",
"男追女":"男追女",
"街头搭讪":"街头搭讪",
"夜店搭讪":"夜店搭讪",
"商超搭讪":"商超搭讪",
"校园搭讪":"校园搭讪",
"搭讪失败":"搭讪失败"
}
classes = []
for k in cateManual:
classes.append({
'type_name':k,
'type_id':cateManual[k]
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {
'list':[]
}
return result
cookies = ''
def getCookie(self):
import requests
import http.cookies
# 这里填cookie
raw_cookie_line = "buvid3=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; LIVE_BUVID=AUTO4216125328906835; rpdid=|(umRum~uY~R0J'uYukYukkkY; balh_is_closed=; balh_server_inner=__custom__; PVID=4; video_page_version=v_old_home; i-wanna-go-back=-1; CURRENT_BLACKGAP=0; blackside_state=0; fingerprint=8965144a609d60190bd051578c610d72; buvid_fp_plain=undefined; CURRENT_QUALITY=120; hit-dyn-v2=1; nostalgia_conf=-1; buvid_fp=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; CURRENT_FNVAL=4048; DedeUserID=85342; DedeUserID__ckMd5=f070401c4c699c83; b_ut=5; hit-new-style-dyn=0; buvid4=15C64651-E8B7-100C-4B1F-C7CFD2DB473007906-022110820-jYQRaMeS%2BRXRfw14q70%2FLQ%3D%3D; b_nut=1667910208; b_lsid=3CE4AE79_184578915C0; is-2022-channel=1; innersign=0; SESSDATA=a5e4d58d%2C1683641322%2C2c39a%2Ab1; bili_jct=2f3126b5954e37f593130f2fef082cd8; sid=p7tjqv22; bp_video_offset_85342=726936847258746900"
simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
return cookie_jar
def get_dynamic(self,pg):
result = {}
url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['items']
for vod in vodList:
if vod['type'] == 'DYNAMIC_TYPE_AV':
ivod = vod['modules']['module_dynamic']['major']['archive']
aid = str(ivod['aid']).strip()
title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = ivod['cover'].strip()
remark = str(ivod['duration_text']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_hot(self,pg):
result = {}
url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_rank(self):
result = {}
url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = 1
result['pagecount'] = 1
result['limit'] = 90
result['total'] = 999999
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if tid == "热门":
return self.get_hot(pg=pg)
if tid == "排行榜" :
return self.get_rank()
if tid == '动态':
return self.get_dynamic(pg=pg)
url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
if len(self.cookies) <= 0:
self.getCookie()
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] != 0:
rspRetry = self.fetch(url,cookies=self.getCookie())
content = rspRetry.text
jo = json.loads(content)
videos = []
vodList = jo['data']['result']
for vod in vodList:
aid = str(vod['aid']).strip()
title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = 'https:' + vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def cleanSpace(self,str):
return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
def detailContent(self,array):
aid = array[0]
url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
pic = jo['pic']
desc = jo['desc']
typeName = jo['tname']
vod = {
"vod_id":aid,
"vod_name":title,
"vod_pic":pic,
"type_name":typeName,
"vod_year":"",
"vod_area":"bilidanmu",
"vod_remarks":"",
"vod_actor":jo['owner']['name'],
"vod_director":jo['owner']['name'],
"vod_content":desc
}
ja = jo['pages']
playUrl = ''
for tmpJo in ja:
cid = tmpJo['cid']
part = tmpJo['part']
playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
vod['vod_play_from'] = 'B站'
vod['vod_play_url'] = playUrl
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
result = {
'list':search['list']
}
return result
def playerContent(self,flag,id,vipFlags):
# https://www.555dianying.cc/vodplay/static/js/playerconfig.js
result = {}
ids = id.split("_")
url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
rsp = self.fetch(url,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
ja = jo['durl']
maxSize = -1
position = -1
for i in range(len(ja)):
tmpJo = ja[i]
if maxSize < int(tmpJo['size']):
maxSize = int(tmpJo['size'])
position = i
url = ''
if len(ja) > 0:
if position == -1:
position = 0
url = ja[position]['url']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = url
result["header"] = {
"Referer":"https://www.bilibili.com",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
result["contentType"] = 'video/x-flv'
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

277
py/plugin/搭配.py Normal file
View File

@ -0,0 +1,277 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider): # 元类 默认的元类 type
def getName(self):
return "多多搭配"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"内衣":"内衣",
"男生搭配":"男生搭配",
"女生搭配":"女生搭配",
"裙子":"裙子",
"紧身裤":"紧身裤",
"吊带衫":"吊带衫",
"娃娃衣":"娃娃衣",
"牛仔裙":"牛仔裙",
"丝袜":"丝袜",
"雪纺":"雪纺",
"礼服":"礼服",
"裤子":"裤子",
"西装":"西装",
"领带":"领带",
"衬衫":"衬衫",
"卫衣":"卫衣",
"T恤":"T恤",
"Polo衫":"Polo衫"
}
classes = []
for k in cateManual:
classes.append({
'type_name':k,
'type_id':cateManual[k]
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {
'list':[]
}
return result
cookies = ''
def getCookie(self):
import requests
import http.cookies
# 这里填cookie
raw_cookie_line = "buvid3=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; LIVE_BUVID=AUTO4216125328906835; rpdid=|(umRum~uY~R0J'uYukYukkkY; balh_is_closed=; balh_server_inner=__custom__; PVID=4; video_page_version=v_old_home; i-wanna-go-back=-1; CURRENT_BLACKGAP=0; blackside_state=0; fingerprint=8965144a609d60190bd051578c610d72; buvid_fp_plain=undefined; CURRENT_QUALITY=120; hit-dyn-v2=1; nostalgia_conf=-1; buvid_fp=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; CURRENT_FNVAL=4048; DedeUserID=85342; DedeUserID__ckMd5=f070401c4c699c83; b_ut=5; hit-new-style-dyn=0; buvid4=15C64651-E8B7-100C-4B1F-C7CFD2DB473007906-022110820-jYQRaMeS%2BRXRfw14q70%2FLQ%3D%3D; b_nut=1667910208; b_lsid=3CE4AE79_184578915C0; is-2022-channel=1; innersign=0; SESSDATA=a5e4d58d%2C1683641322%2C2c39a%2Ab1; bili_jct=2f3126b5954e37f593130f2fef082cd8; sid=p7tjqv22; bp_video_offset_85342=726936847258746900"
simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
return cookie_jar
def get_dynamic(self,pg):
result = {}
url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['items']
for vod in vodList:
if vod['type'] == 'DYNAMIC_TYPE_AV':
ivod = vod['modules']['module_dynamic']['major']['archive']
aid = str(ivod['aid']).strip()
title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = ivod['cover'].strip()
remark = str(ivod['duration_text']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_hot(self,pg):
result = {}
url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_rank(self):
result = {}
url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = 1
result['pagecount'] = 1
result['limit'] = 90
result['total'] = 999999
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if tid == "热门":
return self.get_hot(pg=pg)
if tid == "排行榜" :
return self.get_rank()
if tid == '动态':
return self.get_dynamic(pg=pg)
url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
if len(self.cookies) <= 0:
self.getCookie()
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] != 0:
rspRetry = self.fetch(url,cookies=self.getCookie())
content = rspRetry.text
jo = json.loads(content)
videos = []
vodList = jo['data']['result']
for vod in vodList:
aid = str(vod['aid']).strip()
title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = 'https:' + vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def cleanSpace(self,str):
return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
def detailContent(self,array):
aid = array[0]
url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
pic = jo['pic']
desc = jo['desc']
typeName = jo['tname']
vod = {
"vod_id":aid,
"vod_name":title,
"vod_pic":pic,
"type_name":typeName,
"vod_year":"",
"vod_area":"bilidanmu",
"vod_remarks":"",
"vod_actor":jo['owner']['name'],
"vod_director":jo['owner']['name'],
"vod_content":desc
}
ja = jo['pages']
playUrl = ''
for tmpJo in ja:
cid = tmpJo['cid']
part = tmpJo['part']
playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
vod['vod_play_from'] = 'B站'
vod['vod_play_url'] = playUrl
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
result = {
'list':search['list']
}
return result
def playerContent(self,flag,id,vipFlags):
# https://www.555dianying.cc/vodplay/static/js/playerconfig.js
result = {}
ids = id.split("_")
url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
rsp = self.fetch(url,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
ja = jo['durl']
maxSize = -1
position = -1
for i in range(len(ja)):
tmpJo = ja[i]
if maxSize < int(tmpJo['size']):
maxSize = int(tmpJo['size'])
position = i
url = ''
if len(ja) > 0:
if position == -1:
position = 0
url = ja[position]['url']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = url
result["header"] = {
"Referer":"https://www.bilibili.com",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
result["contentType"] = 'video/x-flv'
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

419
py/plugin/歌手合集.py Normal file
View File

@ -0,0 +1,419 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider): # 元类 默认的元类 type
def getName(self):
return "歌手专辑"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"周杰伦":"周杰伦",
"Beyond":"Beyond",
"陈奕迅":"陈奕迅",
"许巍":"许巍",
"刘德华":"刘德华",
"张学友":"张学友",
"郭富城":"郭富城",
"黎明":"黎明",
"朴树":"朴树",
"迪克牛仔":"迪克牛仔",
"李宗盛":"李宗盛",
"邓丽君":"邓丽君",
"林子祥":"林子祥",
"张信哲":"张信哲",
"任贤齐":"任贤齐",
"孙楠":"孙楠",
"张宇":"张宇",
"周华健":"周华健",
"蔡依林":"蔡依林",
"薛之谦":"薛之谦",
"许嵩":"许嵩",
"初音未来":"初音未来",
"洛天依":"洛天依",
"戴佩妮":"戴佩妮",
"邓紫棋":"邓紫棋",
"蔡健雅":"蔡健雅",
"张韶涵":"张韶涵",
"莫文蔚":"莫文蔚",
"刘若英":"刘若英",
"周深":"周深",
"毛不易":"毛不易",
"汪苏泷":"汪苏泷",
"李宇春":"李宇春",
"徐佳莹":"徐佳莹",
"杨宗纬":"杨宗纬",
"胡彦斌":"胡彦斌",
"杨千嬅":"杨千嬅",
"张靓颖":"张靓颖",
"李荣浩":"李荣浩",
"杨丞琳":"杨丞琳",
"林志炫":"林志炫",
"陶喆":"陶喆",
"胡夏":"胡夏",
"弦子":"弦子",
"陈小春":"陈小春",
"萧亚轩":"萧亚轩",
"鹿晗":"鹿晗",
"纵贯线":"纵贯线",
"林俊杰":"林俊杰",
"谭咏麟":"谭咏麟",
"赵雷":"赵雷",
"凤凰传奇":"凤凰传奇",
"容祖儿":"容祖儿",
"周传雄":"周传雄",
"SHE":"SHE",
"苏打绿":"苏打绿",
"五月天":"五月天",
"张国荣":"张国荣",
"梅艳芳":"梅艳芳",
"孙燕姿":"孙燕姿",
"李健":"李健",
"华晨宇":"华晨宇",
"袁娅维":"袁娅维",
"大张伟":"大张伟",
"TFBOYS":"TFBOYS",
"易烊千玺":"易烊千玺",
"王俊凯":"王俊凯",
"王源":"王源",
"田馥甄":"田馥甄",
"小虎队":"小虎队",
"张杰":"张杰",
"伍佰":"伍佰",
"王菲":"王菲",
"刀郎":"刀郎",
"草蜢":"草蜢",
"潘玮柏":"潘玮柏",
"梁静茹":"梁静茹",
"林宥嘉":"林宥嘉",
"蔡徐坤":"蔡徐坤",
"周慧敏":"周慧敏",
"李圣杰":"李圣杰",
"张惠妹":"张惠妹",
"萧敬腾":"萧敬腾",
"周笔畅":"周笔畅",
"焦迈奇":"焦迈奇",
"尤长靖":"尤长靖",
"郑中基":"郑中基",
"谭维维":"谭维维",
"陈慧娴":"陈慧娴",
"张艺兴":"张艺兴",
"王嘉尔":"王嘉尔",
"刘宪华":"刘宪华",
"张敬轩":"张敬轩",
"李克勤":"李克勤",
"阿杜":"阿杜",
"郭静":"郭静",
"崔健":"崔健",
"庾澄庆":"庾澄庆",
"汪峰":"汪峰",
"那英":"那英",
"杨坤":"杨坤",
"叶倩文":"叶倩文",
"王心凌":"王心凌",
"张震岳":"张震岳",
"韩红":"韩红",
"齐秦":"齐秦",
"张雨生":"张雨生",
"黄品源":"黄品源",
"林忆莲":"林忆莲",
"丁当":"丁当",
"郑智化":"郑智化",
"李玟":"李玟",
"谢霆锋":"谢霆锋",
"黄小琥":"黄小琥",
"徐小凤":"徐小凤",
"任嘉伦":"任嘉伦",
"卓依婷":"卓依婷",
"逃跑计划":"逃跑计划",
"青鸟飞鱼":"青鸟飞鱼",
"飞儿乐队":"飞儿乐队",
"花儿乐队":"花儿乐队",
"南拳妈妈":"南拳妈妈",
"水木年华":"水木年华",
"动力火车":"动力火车",
"筷子兄弟":"筷子兄弟",
"鹿先森乐队":"鹿先森乐队",
"信乐队":"信乐队",
"旅行团乐队":"旅行团乐队",
"By2":"By2",
"郁可唯":"郁可唯",
"宋亚森":"宋亚森",
"费玉清":"费玉清",
"费翔":"费翔",
"金志文":"金志文",
"方大同":"方大同",
"吴克群":"吴克群",
"罗大佑":"罗大佑",
"光良":"光良",
"凤飞飞":"凤飞飞",
"田震":"田震",
"谭晶":"谭晶",
"王杰":"王杰",
"羽泉":"羽泉",
"金池":"金池",
"屠洪刚":"屠洪刚",
"戴荃":"戴荃",
"郭采洁":"郭采洁",
"罗志祥":"罗志祥",
"王力宏":"王力宏",
"林肯公园":"林肯公园",
"迈克尔杰克逊":"迈克尔杰克逊",
"泰勒·斯威夫特":"泰勒·斯威夫特",
"阿黛尔":"阿黛尔",
"BIGBANG":"BIGBANG",
"贾斯丁比伯":"贾斯丁比伯",
"Lady Gaga":"Lady Gaga",
"中岛美雪":"中岛美雪",
"后街男孩":"后街男孩",
"仓木麻衣":"仓木麻衣",
"布兰妮":"布兰妮",
"夜愿乐队":"夜愿乐队"
}
classes = []
for k in cateManual:
classes.append({
'type_name':k,
'type_id':cateManual[k]
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {
'list':[]
}
return result
cookies = ''
def getCookie(self):
import requests
import http.cookies
# 这里填cookie
raw_cookie_line = "buvid3=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; LIVE_BUVID=AUTO4216125328906835; rpdid=|(umRum~uY~R0J'uYukYukkkY; balh_is_closed=; balh_server_inner=__custom__; PVID=4; video_page_version=v_old_home; i-wanna-go-back=-1; CURRENT_BLACKGAP=0; blackside_state=0; fingerprint=8965144a609d60190bd051578c610d72; buvid_fp_plain=undefined; CURRENT_QUALITY=120; hit-dyn-v2=1; nostalgia_conf=-1; buvid_fp=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; CURRENT_FNVAL=4048; DedeUserID=85342; DedeUserID__ckMd5=f070401c4c699c83; b_ut=5; hit-new-style-dyn=0; buvid4=15C64651-E8B7-100C-4B1F-C7CFD2DB473007906-022110820-jYQRaMeS%2BRXRfw14q70%2FLQ%3D%3D; b_nut=1667910208; b_lsid=3CE4AE79_184578915C0; is-2022-channel=1; innersign=0; SESSDATA=a5e4d58d%2C1683641322%2C2c39a%2Ab1; bili_jct=2f3126b5954e37f593130f2fef082cd8; sid=p7tjqv22; bp_video_offset_85342=726936847258746900"
simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
return cookie_jar
def get_dynamic(self,pg):
result = {}
url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['items']
for vod in vodList:
if vod['type'] == 'DYNAMIC_TYPE_AV':
ivod = vod['modules']['module_dynamic']['major']['archive']
aid = str(ivod['aid']).strip()
title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = ivod['cover'].strip()
remark = str(ivod['duration_text']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_hot(self,pg):
result = {}
url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_rank(self):
result = {}
url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = 1
result['pagecount'] = 1
result['limit'] = 90
result['total'] = 999999
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if tid == "热门":
return self.get_hot(pg=pg)
if tid == "排行榜" :
return self.get_rank()
if tid == '动态':
return self.get_dynamic(pg=pg)
url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
if len(self.cookies) <= 0:
self.getCookie()
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] != 0:
rspRetry = self.fetch(url,cookies=self.getCookie())
content = rspRetry.text
jo = json.loads(content)
videos = []
vodList = jo['data']['result']
for vod in vodList:
aid = str(vod['aid']).strip()
title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = 'https:' + vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def cleanSpace(self,str):
return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
def detailContent(self,array):
aid = array[0]
url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
pic = jo['pic']
desc = jo['desc']
typeName = jo['tname']
vod = {
"vod_id":aid,
"vod_name":title,
"vod_pic":pic,
"type_name":typeName,
"vod_year":"",
"vod_area":"bilidanmu",
"vod_remarks":"",
"vod_actor":jo['owner']['name'],
"vod_director":jo['owner']['name'],
"vod_content":desc
}
ja = jo['pages']
playUrl = ''
for tmpJo in ja:
cid = tmpJo['cid']
part = tmpJo['part']
playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
vod['vod_play_from'] = 'B站'
vod['vod_play_url'] = playUrl
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
result = {
'list':search['list']
}
return result
def playerContent(self,flag,id,vipFlags):
# https://www.555dianying.cc/vodplay/static/js/playerconfig.js
result = {}
ids = id.split("_")
url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
rsp = self.fetch(url,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
ja = jo['durl']
maxSize = -1
position = -1
for i in range(len(ja)):
tmpJo = ja[i]
if maxSize < int(tmpJo['size']):
maxSize = int(tmpJo['size'])
position = i
url = ''
if len(ja) > 0:
if position == -1:
position = 0
url = ja[position]['url']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = url
result["header"] = {
"Referer":"https://www.bilibili.com",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
result["contentType"] = 'video/x-flv'
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]

287
py/plugin/高中教育.py Normal file
View File

@ -0,0 +1,287 @@
#coding=utf-8
#!/usr/bin/python
import sys
sys.path.append('..')
from base.spider import Spider
import json
import time
import base64
class Spider(Spider): # 元类 默认的元类 type
def getName(self):
return "高中"
def init(self,extend=""):
print("============{0}============".format(extend))
pass
def isVideoFormat(self,url):
pass
def manualVideoCheck(self):
pass
def homeContent(self,filter):
result = {}
cateManual = {
"高一语文":"高一语文",
"高一数学":"高一数学",
"高一英语":"高一英语",
"高一历史":"高一历史",
"高一地理":"高一地理",
"高一生物":"高一生物",
"高一思想政治":"高一思想政治",
"高一物理":"高一物理",
"高一化学":"高一化学",
"高二语文":"高二语文",
"高二数学":"高二数学",
"高二英语":"高二英语",
"高二历史":"高二历史",
"高二地理":"高二地理",
"高二生物":"高二生物",
"高二思想政治":"高二思想政治",
"高二物理":"高二物理",
"高二化学":"高二化学",
"高三语文":"高三语文",
"高三数学":"高三数学",
"高三英语":"高三英语",
"高三历史":"高三历史",
"高三地理":"高三地理",
"高三生物":"高三生物",
"高三思想政治":"高三思想政治",
"高三物理":"高三物理",
"高三化学":"高三化学",
"高中信息技术":"高中信息技术",
"高中信息技术":"高中信息技术"
}
classes = []
for k in cateManual:
classes.append({
'type_name':k,
'type_id':cateManual[k]
})
result['class'] = classes
if(filter):
result['filters'] = self.config['filter']
return result
def homeVideoContent(self):
result = {
'list':[]
}
return result
cookies = ''
def getCookie(self):
import requests
import http.cookies
# 这里填cookie
raw_cookie_line = "buvid3=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; LIVE_BUVID=AUTO4216125328906835; rpdid=|(umRum~uY~R0J'uYukYukkkY; balh_is_closed=; balh_server_inner=__custom__; PVID=4; video_page_version=v_old_home; i-wanna-go-back=-1; CURRENT_BLACKGAP=0; blackside_state=0; fingerprint=8965144a609d60190bd051578c610d72; buvid_fp_plain=undefined; CURRENT_QUALITY=120; hit-dyn-v2=1; nostalgia_conf=-1; buvid_fp=CFF74DA7-E79E-4B53-BB96-FC74AB8CD2F3184997infoc; CURRENT_FNVAL=4048; DedeUserID=85342; DedeUserID__ckMd5=f070401c4c699c83; b_ut=5; hit-new-style-dyn=0; buvid4=15C64651-E8B7-100C-4B1F-C7CFD2DB473007906-022110820-jYQRaMeS%2BRXRfw14q70%2FLQ%3D%3D; b_nut=1667910208; b_lsid=3CE4AE79_184578915C0; is-2022-channel=1; innersign=0; SESSDATA=a5e4d58d%2C1683641322%2C2c39a%2Ab1; bili_jct=2f3126b5954e37f593130f2fef082cd8; sid=p7tjqv22; bp_video_offset_85342=726936847258746900"
simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
cookie_jar = requests.cookies.RequestsCookieJar()
cookie_jar.update(simple_cookie)
return cookie_jar
def get_dynamic(self,pg):
result = {}
url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['items']
for vod in vodList:
if vod['type'] == 'DYNAMIC_TYPE_AV':
ivod = vod['modules']['module_dynamic']['major']['archive']
aid = str(ivod['aid']).strip()
title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = ivod['cover'].strip()
remark = str(ivod['duration_text']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_hot(self,pg):
result = {}
url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def get_rank(self):
result = {}
url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] == 0:
videos = []
vodList = jo['data']['list']
for vod in vodList:
aid = str(vod['aid']).strip()
title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = 1
result['pagecount'] = 1
result['limit'] = 90
result['total'] = 999999
return result
def categoryContent(self,tid,pg,filter,extend):
result = {}
if tid == "热门":
return self.get_hot(pg=pg)
if tid == "排行榜" :
return self.get_rank()
if tid == '动态':
return self.get_dynamic(pg=pg)
url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
if len(self.cookies) <= 0:
self.getCookie()
rsp = self.fetch(url,cookies=self.getCookie())
content = rsp.text
jo = json.loads(content)
if jo['code'] != 0:
rspRetry = self.fetch(url,cookies=self.getCookie())
content = rspRetry.text
jo = json.loads(content)
videos = []
vodList = jo['data']['result']
for vod in vodList:
aid = str(vod['aid']).strip()
title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
img = 'https:' + vod['pic'].strip()
remark = str(vod['duration']).strip()
videos.append({
"vod_id":aid,
"vod_name":title,
"vod_pic":img,
"vod_remarks":remark
})
result['list'] = videos
result['page'] = pg
result['pagecount'] = 9999
result['limit'] = 90
result['total'] = 999999
return result
def cleanSpace(self,str):
return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
def detailContent(self,array):
aid = array[0]
url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
pic = jo['pic']
desc = jo['desc']
typeName = jo['tname']
vod = {
"vod_id":aid,
"vod_name":title,
"vod_pic":pic,
"type_name":typeName,
"vod_year":"",
"vod_area":"bilidanmu",
"vod_remarks":"",
"vod_actor":jo['owner']['name'],
"vod_director":jo['owner']['name'],
"vod_content":desc
}
ja = jo['pages']
playUrl = ''
for tmpJo in ja:
cid = tmpJo['cid']
part = tmpJo['part']
playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
vod['vod_play_from'] = 'B站'
vod['vod_play_url'] = playUrl
result = {
'list':[
vod
]
}
return result
def searchContent(self,key,quick):
search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
result = {
'list':search['list']
}
return result
def playerContent(self,flag,id,vipFlags):
# https://www.555dianying.cc/vodplay/static/js/playerconfig.js
result = {}
ids = id.split("_")
url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
rsp = self.fetch(url,cookies=self.getCookie())
jRoot = json.loads(rsp.text)
jo = jRoot['data']
ja = jo['durl']
maxSize = -1
position = -1
for i in range(len(ja)):
tmpJo = ja[i]
if maxSize < int(tmpJo['size']):
maxSize = int(tmpJo['size'])
position = i
url = ''
if len(ja) > 0:
if position == -1:
position = 0
url = ja[position]['url']
result["parse"] = 0
result["playUrl"] = ''
result["url"] = url
result["header"] = {
"Referer":"https://www.bilibili.com",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
result["contentType"] = 'video/x-flv'
return result
config = {
"player": {},
"filter": {}
}
header = {}
def localProxy(self,param):
return [200, "video/MP2T", action, ""]