上传文件至 lib
This commit is contained in:
parent
87c1a54ab7
commit
5e54cf4ce5
48
lib/PTT短剧.json
Normal file
48
lib/PTT短剧.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"作者": "小可乐/240701/第一版",
|
||||
"站名": "PTT视频",
|
||||
"请求头": "User-Agent$MOBILE_UA",
|
||||
"编码": "UTF-8",
|
||||
"图片代理": "0",
|
||||
"直接播放": "0",
|
||||
"播放请求头": "",
|
||||
"嗅探词": ".mp4#.m3u8",
|
||||
"过滤词": "",
|
||||
"主页url": "https://ptt.red/zh-hans/p/66",
|
||||
"首页": "120",
|
||||
"起始页": "1",
|
||||
"分类url": "/zh-hans/p/{cateId}{class}?page={catePg}&{area}&{year}&{by};;mrc",
|
||||
"分类": "爽剧$66/c/67#言情$66/c/68#穿越$66/c/70#悬疑$66/c/71#古装$66/c/73#都市$66/c/80#甜宠$66/c/84#恋爱$66/c/85#其他$66/c/74",
|
||||
"二次截取": "",
|
||||
"数组": "card\">&&/span>",
|
||||
"标题": "alt=\"&&\"",
|
||||
"图片": "src=\"&&\"",
|
||||
"副标题": "badge-success\">&&<",
|
||||
"链接": "href=\"&&\"[替换:/v>>空]+/1",
|
||||
"影片年代": "year\":&&,",
|
||||
"影片地区": "_area\":\"&&\"",
|
||||
"影片类型": "\"type\":\"&&\"",
|
||||
"状态": "note\":\"&&\"",
|
||||
"导演": "director\":\"&&\"",
|
||||
"主演": "actors\":\"&&\"",
|
||||
"简介": "💕育华学堂为您介绍剧情💕+description\":\"&&\"",
|
||||
"线路数组": "px-2 nav-link&&/a>[排序:臥龍]",
|
||||
"线路标题": "💕恒星推荐💕+title=\"&&\"",
|
||||
"多线数组": "px-2 nav-link&&/a>",
|
||||
"多线链接": "href=\"&&\"",
|
||||
"播放二次截取": "nav-tabs&&<table[替换:px-2 nav-link active>>mb-2 fullwidth\"><a>第1集<#nofollow\">>>/a></div>]",
|
||||
"播放数组": "mb-2 fullwidth\">&&</div>",
|
||||
"倒序": "0",
|
||||
"播放列表": "<a&&/a>",
|
||||
"播放标题": "💕+>&&<",
|
||||
"播放链接": "href=\"&&\"",
|
||||
"跳转播放链接": "contentUrl\":\"&&\"",
|
||||
"搜索请求头": "User-Agent$MOBILE_UA",
|
||||
"搜索url": "/zh-hans/q/{wd}?page={pg}",
|
||||
"搜索模式": "1",
|
||||
"搜索数组": "card\">&&/span>",
|
||||
"搜索标题": "alt=\"&&\"",
|
||||
"搜索图片": "src=\"&&\"",
|
||||
"搜索副标题": "badge-success\">&&<",
|
||||
"搜索链接": "href=\"&&\"[替换:/v>>空]+/1"
|
||||
}
|
142
lib/py_企鹅体育.py
Normal file
142
lib/py_企鹅体育.py
Normal file
@ -0,0 +1,142 @@
|
||||
#coding=utf-8
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
from base.spider import Spider
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
|
||||
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 = {
|
||||
"全部": "",
|
||||
"足球": "Football",
|
||||
"篮球": "Basketball",
|
||||
"NBA": "NBA",
|
||||
"台球": "Billiards",
|
||||
"搏击": "Fight",
|
||||
"网排": "Tennis",
|
||||
"游戏": "Game",
|
||||
"其他": "Others",
|
||||
"橄棒冰": "MLB"
|
||||
}
|
||||
classes = []
|
||||
for k in cateManual:
|
||||
classes.append({
|
||||
'type_name': k,
|
||||
'type_id': cateManual[k]
|
||||
})
|
||||
|
||||
result['class'] = classes
|
||||
if (filter):
|
||||
result['filters'] = self.config['filter']
|
||||
return result
|
||||
def homeVideoContent(self):
|
||||
result = {}
|
||||
return result
|
||||
|
||||
def categoryContent(self,tid,pg,filter,extend):
|
||||
result = {}
|
||||
url = 'https://live.qq.com/api/live/vlist?page_size=60&shortName={0}&page={1}'.format(tid, pg)
|
||||
rsp = self.fetch(url)
|
||||
content = rsp.text
|
||||
jo = json.loads(content)
|
||||
videos = []
|
||||
vodList = jo['data']['result']
|
||||
numvL = len(vodList)
|
||||
pgc = math.ceil(numvL/15)
|
||||
for vod in vodList:
|
||||
aid = (vod['room_id'])
|
||||
title = vod['room_name'].strip()
|
||||
img = vod['room_src']
|
||||
remark = (vod['game_name']).strip()
|
||||
videos.append({
|
||||
"vod_id": aid,
|
||||
"vod_name": title,
|
||||
"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]
|
||||
url = "https://m.live.qq.com/{0}".format(aid)
|
||||
rsp = self.fetch(url)
|
||||
html = self.cleanText(rsp.text)
|
||||
if self.regStr(reg=r'\"show_status\":\"(\d)\"', src=html) == '1':
|
||||
title = self.regStr(reg=r'\"room_name\":\"(.*?)\"', src=html)
|
||||
pic = self.regStr(reg=r'\"room_src\":\"(.*?)\"', src=html)
|
||||
typeName = self.regStr(reg=r'\"game_name\":\"(.*?)\"', src=html)
|
||||
remark = self.regStr(reg=r'\"nickname\":\"(.*?)\"', src=html)
|
||||
purl = self.regStr(reg=r'\"hls_url\":\"(.*?)\"', src=html)
|
||||
else:
|
||||
return {}
|
||||
vod = {
|
||||
"vod_id": aid,
|
||||
"vod_name": title,
|
||||
"vod_pic": pic,
|
||||
"type_name": typeName,
|
||||
"vod_year": "",
|
||||
"vod_area": "",
|
||||
"vod_remarks": remark,
|
||||
"vod_actor": '',
|
||||
"vod_director":'',
|
||||
"vod_content": ''
|
||||
}
|
||||
playUrl = '{0}${1}#'.format(typeName, purl)
|
||||
vod['vod_play_from'] = '💕恒星育华学堂接口💕企鹅线路'
|
||||
vod['vod_play_url'] = playUrl
|
||||
|
||||
result = {
|
||||
'list': [
|
||||
vod
|
||||
]
|
||||
}
|
||||
return result
|
||||
|
||||
def searchContent(self,key,quick):
|
||||
result = {}
|
||||
return result
|
||||
def playerContent(self,flag,id,vipFlags):
|
||||
result = {}
|
||||
url = id
|
||||
header = {
|
||||
'Referer': 'https://m.live.qq.com/',
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
|
||||
}
|
||||
result["parse"] = 0
|
||||
result["playUrl"] = ''
|
||||
result["url"] = url
|
||||
result["header"] = header
|
||||
return result
|
||||
|
||||
config = {
|
||||
"player": {},
|
||||
"filter": {}
|
||||
}
|
||||
header = {}
|
||||
|
||||
def localProxy(self,param):
|
||||
action = {
|
||||
'url':'',
|
||||
'header':'',
|
||||
'param':'',
|
||||
'type':'string',
|
||||
'after':''
|
||||
}
|
||||
return [200, "video/MP2T", action, ""]
|
192
lib/py_央视少儿.py
Normal file
192
lib/py_央视少儿.py
Normal file
@ -0,0 +1,192 @@
|
||||
#coding=utf-8
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
from base.spider import Spider
|
||||
import json
|
||||
import time
|
||||
import base64
|
||||
import re
|
||||
|
||||
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 = ""
|
||||
if 'month' in extend.keys():
|
||||
month = extend['month']
|
||||
if 'year' in extend.keys():
|
||||
year = extend['year']
|
||||
if year == '':
|
||||
month = ''
|
||||
prefix = year + month
|
||||
|
||||
url="https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955899450127&area=&sc=&fc=%E5%8A%A8%E7%94%BB%E7%89%87&letter=&p={0}&n=24&serviceId=tvcctv&topv=1&t=json"
|
||||
if tid=="电视剧":
|
||||
url="https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955853485115&area=&sc=&fc=%E7%94%B5%E8%A7%86%E5%89%A7&year=&letter=&p={0}&n=24&serviceId=tvcctv&topv=1&t=json"
|
||||
elif tid=="纪录片":
|
||||
url="https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955924871139&fc=%E7%BA%AA%E5%BD%95%E7%89%87&channel=&sc=&year=&letter=&p={0}&n=24&serviceId=tvcctv&topv=1&t=json"
|
||||
elif tid=="4":
|
||||
url="https://api.cntv.cn/list/getVideoAlbumList?channelid=CHAL1460955953877151&channel=&sc=&fc=%E7%89%B9%E5%88%AB%E8%8A%82%E7%9B%AE&bigday=&letter=&p={0}&n=24&serviceId=tvcctv&topv=1&t=json"
|
||||
suffix = ""
|
||||
jo = self.fetch(url.format(pg),headers=self.header).json()
|
||||
vodList=jo["data"]["list"]
|
||||
videos = []
|
||||
for vod in vodList:
|
||||
lastVideo =vod['url']
|
||||
brief=vod['brief']
|
||||
if len(brief) == 0:
|
||||
brief = ' '
|
||||
if len(lastVideo) == 0:
|
||||
lastVideo = '_'
|
||||
guid = tid+'###'+vod["title"]+'###'+lastVideo+'###'+vod['image']+'###'+brief
|
||||
title = vod["title"]
|
||||
img = vod['image']
|
||||
videos.append({
|
||||
"vod_id":guid,
|
||||
"vod_name":title,
|
||||
"vod_pic":img,
|
||||
"vod_remarks":''
|
||||
})
|
||||
result['list'] = videos
|
||||
result['page'] = pg
|
||||
result['pagecount'] = 9999
|
||||
result['limit'] = 90
|
||||
result['total'] = 999999
|
||||
return result
|
||||
def detailContent(self,array):
|
||||
aid = array[0].split('###')
|
||||
if aid[2].find("http")<0:
|
||||
return {}
|
||||
tid = aid[0]
|
||||
logo = aid[3]
|
||||
lastVideo = aid[2]
|
||||
title = aid[1]
|
||||
date = aid[0]
|
||||
if lastVideo == '_':
|
||||
return {}
|
||||
rsp = self.fetch(lastVideo)
|
||||
htmlTxt=rsp.text
|
||||
column_id = ""
|
||||
videoList = []
|
||||
patternTxt=r"'title':\s*'(.+?)',\n{0,1}\s*'img':\s*'(.+?)',\n{0,1}\s*'brief':\s*'(.+?)',\n{0,1}\s*'url':\s*'(.+?)'"
|
||||
titleIndex=0
|
||||
UrlIndex=3
|
||||
if tid=="电视剧" or tid=="纪录片":
|
||||
patternTxt=r"'title':\s*'(.+?)',\n{0,1}\s*'brief':\s*'(.+?)',\n{0,1}\s*'img':\s*'(.+?)',\n{0,1}\s*'url':\s*'(.+?)'"
|
||||
titleIndex=0
|
||||
UrlIndex=3
|
||||
elif tid=="特别节目":
|
||||
patternTxt=r'class="tp1"><a\s*href="(https://.+?)"\s*target="_blank"\s*title="(.+?)"></a></div>'
|
||||
titleIndex=1
|
||||
UrlIndex=0
|
||||
#https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?id=VIDA3YcIusJ9mh4c9mw5XHyx230113&serviceId=tvcctv//由于方式不同暂时不做
|
||||
pattern = re.compile(patternTxt)
|
||||
ListRe=pattern.findall(htmlTxt)
|
||||
for value in ListRe:
|
||||
videoList.append(value[titleIndex]+"$"+value[UrlIndex])
|
||||
if len(videoList) == 0:
|
||||
return {}
|
||||
vod = {
|
||||
"vod_id":array[0],
|
||||
"vod_name":title,
|
||||
"vod_pic":logo,
|
||||
"type_name":tid,
|
||||
"vod_year":date,
|
||||
"vod_area":"",
|
||||
"vod_remarks":date,
|
||||
"vod_actor":"",
|
||||
"vod_director":column_id,
|
||||
"vod_content":aid[4]
|
||||
}
|
||||
vod['vod_play_from'] = '💕恒星育华学堂接口💕CCTV频道'
|
||||
vod['vod_play_url'] = "#".join(videoList)
|
||||
result = {
|
||||
'list':[
|
||||
vod
|
||||
]
|
||||
}
|
||||
return result
|
||||
|
||||
def searchContent(self,key,quick):
|
||||
result = {
|
||||
'list':[]
|
||||
}
|
||||
return result
|
||||
def playerContent(self,flag,id,vipFlags):
|
||||
result = {}
|
||||
rsp = self.fetch(id)
|
||||
htmlTxt=rsp.text
|
||||
pattern = re.compile(r'var\sguid\s*=\s*"(.+?)";')
|
||||
ListRe=pattern.findall(htmlTxt)
|
||||
if ListRe==[]:
|
||||
return result
|
||||
url = "https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={0}".format(ListRe[0])
|
||||
jo = self.fetch(url,headers=self.header).json()
|
||||
link = jo['hls_url'].strip()
|
||||
rsp = self.fetch(link,headers=self.header)
|
||||
content = rsp.text.strip()
|
||||
arr = content.split('\n')
|
||||
urlPrefix = self.regStr(link,'(http[s]?://[a-zA-z0-9.]+)/')
|
||||
|
||||
subUrl = arr[-1].split('/')
|
||||
subUrl[3] = '1200'
|
||||
subUrl[-1] = '1200.m3u8'
|
||||
hdUrl = urlPrefix + '/'.join(subUrl)
|
||||
|
||||
url = urlPrefix + arr[-1]
|
||||
|
||||
hdRsp = self.fetch(hdUrl,headers=self.header)
|
||||
if hdRsp.status_code == 200:
|
||||
url = hdUrl
|
||||
|
||||
result["parse"] = 0
|
||||
result["playUrl"] = ''
|
||||
result["url"] = url
|
||||
result["header"] = ''
|
||||
return result
|
||||
|
||||
config = {
|
||||
"player": {},
|
||||
"filter": {"CCTV":[{"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",
|
||||
"Origin": "https://tv.cctv.com",
|
||||
"Referer": "https://tv.cctv.com/"
|
||||
}
|
||||
|
||||
def localProxy(self,param):
|
||||
return [200, "video/MP2T", action, ""]
|
BIN
lib/sdtv.jar
Normal file
BIN
lib/sdtv.jar
Normal file
Binary file not shown.
3
lib/sdtv.js
Normal file
3
lib/sdtv.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user