1
This commit is contained in:
parent
dc88dae2ce
commit
9d1356a017
|
|
@ -3,17 +3,16 @@
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('..')
|
sys.path.append('..')
|
||||||
from base.spider import Spider
|
from base.spider import Spider
|
||||||
|
import json
|
||||||
import base64
|
import base64
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
|
|
||||||
class Spider(Spider): # 元类 默认的元类 type
|
class Spider(Spider): # 元类 默认的元类 type
|
||||||
def getName(self):
|
def getName(self):
|
||||||
return "厂长资源"
|
return "厂长资源"
|
||||||
|
|
||||||
def init(self,extend=""):
|
def init(self,extend=""):
|
||||||
print("============{0}============".format(extend))
|
print("============{0}============".format(extend))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def homeContent(self,filter):
|
def homeContent(self,filter):
|
||||||
result = {}
|
result = {}
|
||||||
cateManual = {
|
cateManual = {
|
||||||
|
|
@ -34,10 +33,9 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
})
|
})
|
||||||
result['class'] = classes
|
result['class'] = classes
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def homeVideoContent(self):
|
def homeVideoContent(self):
|
||||||
rsp = self.fetch("https://czspp.com")
|
rsp = self.fetch("https://www.czys.me/")
|
||||||
root = self.html(self.cleanText(rsp.text))
|
root = self.html(rsp.text)
|
||||||
aList = root.xpath("//div[@class='mi_btcon']//ul/li")
|
aList = root.xpath("//div[@class='mi_btcon']//ul/li")
|
||||||
videos = []
|
videos = []
|
||||||
for a in aList:
|
for a in aList:
|
||||||
|
|
@ -56,12 +54,11 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
'list':videos
|
'list':videos
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def categoryContent(self,tid,pg,filter,extend):
|
def categoryContent(self,tid,pg,filter,extend):
|
||||||
result = {}
|
result = {}
|
||||||
url = 'https://czspp.com/{0}/page/{1}'.format(tid, pg)
|
url = 'https://www.czys.me//{0}/page/{1}'.format(tid,pg)
|
||||||
rsp = self.fetch(url)
|
rsp = self.fetch(url)
|
||||||
root = self.html(self.cleanText(rsp.text))
|
root = self.html(rsp.text)
|
||||||
aList = root.xpath("//div[contains(@class,'mi_cont')]//ul/li")
|
aList = root.xpath("//div[contains(@class,'mi_cont')]//ul/li")
|
||||||
videos = []
|
videos = []
|
||||||
for a in aList:
|
for a in aList:
|
||||||
|
|
@ -76,22 +73,24 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
"vod_pic":pic,
|
"vod_pic":pic,
|
||||||
"vod_remarks":mark
|
"vod_remarks":mark
|
||||||
})
|
})
|
||||||
|
|
||||||
result['list'] = videos
|
result['list'] = videos
|
||||||
result['page'] = pg
|
result['page'] = pg
|
||||||
result['pagecount'] = 9999
|
result['pagecount'] = 9999
|
||||||
result['limit'] = 90
|
result['limit'] = 90
|
||||||
result['total'] = 999999
|
result['total'] = 999999
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def detailContent(self,array):
|
def detailContent(self,array):
|
||||||
tid = array[0]
|
tid = array[0]
|
||||||
url = 'https://czspp.com/movie/{0}.html'.format(tid)
|
url = 'https://www.czys.me//movie/{0}.html'.format(tid)
|
||||||
rsp = self.fetch(url)
|
rsp = self.fetch(url)
|
||||||
root = self.html(self.cleanText(rsp.text))
|
root = self.html(rsp.text)
|
||||||
node = root.xpath("//div[@class='dyxingq']")[0]
|
node = root.xpath("//div[@class='dyxingq']")[0]
|
||||||
|
|
||||||
pic = node.xpath(".//div[@class='dyimg fl']/img/@src")[0]
|
pic = node.xpath(".//div[@class='dyimg fl']/img/@src")[0]
|
||||||
title = node.xpath('.//h1/text()')[0]
|
title = node.xpath('.//h1/text()')[0]
|
||||||
detail = root.xpath(".//div[@class='yp_context']//p/text()")[0]
|
detail = root.xpath(".//div[@class='yp_context']//p/text()")[0]
|
||||||
|
|
||||||
vod = {
|
vod = {
|
||||||
"vod_id":tid,
|
"vod_id":tid,
|
||||||
"vod_name":title,
|
"vod_name":title,
|
||||||
|
|
@ -104,38 +103,29 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
"vod_director":"",
|
"vod_director":"",
|
||||||
"vod_content":detail
|
"vod_content":detail
|
||||||
}
|
}
|
||||||
|
|
||||||
infoArray = node.xpath(".//ul[@class='moviedteail_list']/li")
|
infoArray = node.xpath(".//ul[@class='moviedteail_list']/li")
|
||||||
for info in infoArray:
|
for info in infoArray:
|
||||||
content = info.xpath('string(.)')
|
content = info.xpath('string(.)')
|
||||||
if content.startswith('类型'):
|
if content.startswith('类型'):
|
||||||
tpyen = ''
|
vod['type_name'] = content
|
||||||
for inf in info:
|
if content.startswith('年份'):
|
||||||
tn = inf.text
|
vod['vod_year'] = content
|
||||||
tpyen = tpyen +'/'+'{0}'.format(tn)
|
|
||||||
vod['type_name'] = tpyen.strip('/')
|
|
||||||
if content.startswith('地区'):
|
if content.startswith('地区'):
|
||||||
tpyeare = ''
|
vod['vod_area'] = content
|
||||||
for inf in info:
|
|
||||||
tn = inf.text
|
|
||||||
tpyeare = tpyeare +'/'+'{0}'.format(tn)
|
|
||||||
vod['vod_area'] = tpyeare.strip('/')
|
|
||||||
if content.startswith('豆瓣'):
|
if content.startswith('豆瓣'):
|
||||||
vod['vod_remarks'] = content
|
vod['vod_remarks'] = content
|
||||||
if content.startswith('主演'):
|
if content.startswith('主演'):
|
||||||
tpyeact = ''
|
vod['vod_actor'] = content
|
||||||
for inf in info:
|
|
||||||
tn = inf.text
|
|
||||||
tpyeact = tpyeact +'/'+'{0}'.format(tn)
|
|
||||||
vod['vod_actor'] = tpyeact.strip('/')
|
|
||||||
if content.startswith('导演'):
|
if content.startswith('导演'):
|
||||||
tpyedire = ''
|
vod['vod_director'] = content
|
||||||
for inf in info:
|
# if content.startswith('剧情'):
|
||||||
tn = inf.text
|
# vod['vod_content'] = content
|
||||||
tpyedire = tpyedire +'/'+'{0}'.format(tn)
|
|
||||||
vod['vod_director'] = tpyedire .strip('/')
|
|
||||||
vod_play_from = '$$$'
|
vod_play_from = '$$$'
|
||||||
playFrom = ['厂长']
|
playFrom = ['厂长']
|
||||||
vod_play_from = vod_play_from.join(playFrom)
|
vod_play_from = vod_play_from.join(playFrom)
|
||||||
|
|
||||||
vod_play_url = '$$$'
|
vod_play_url = '$$$'
|
||||||
playList = []
|
playList = []
|
||||||
vodList = root.xpath("//div[@class='paly_list_btn']")
|
vodList = root.xpath("//div[@class='paly_list_btn']")
|
||||||
|
|
@ -154,6 +144,7 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
|
|
||||||
vod['vod_play_from'] = vod_play_from
|
vod['vod_play_from'] = vod_play_from
|
||||||
vod['vod_play_url'] = vod_play_url
|
vod['vod_play_url'] = vod_play_url
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'list':[
|
'list':[
|
||||||
vod
|
vod
|
||||||
|
|
@ -162,9 +153,12 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def searchContent(self,key,quick):
|
def searchContent(self,key,quick):
|
||||||
url = 'https://czspp.com/xssearch?q={0}'.format(key)
|
url = 'https://www.czys.me//xssearch?q={0}'.format(key)
|
||||||
|
# getHeader()
|
||||||
rsp = self.fetch(url)
|
rsp = self.fetch(url)
|
||||||
root = self.html(self.cleanText(rsp.text))
|
root = self.html(rsp.text)
|
||||||
|
|
||||||
|
result = {}
|
||||||
vodList = root.xpath("//div[contains(@class,'mi_ne_kd')]/ul/li/a")
|
vodList = root.xpath("//div[contains(@class,'mi_ne_kd')]/ul/li/a")
|
||||||
videos = []
|
videos = []
|
||||||
for vod in vodList:
|
for vod in vodList:
|
||||||
|
|
@ -172,11 +166,7 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
pic = vod.xpath('./img/@data-original')[0]
|
pic = vod.xpath('./img/@data-original')[0]
|
||||||
href = vod.xpath('./@href')[0]
|
href = vod.xpath('./@href')[0]
|
||||||
tid = self.regStr(href,'movie/(\\S+).html')
|
tid = self.regStr(href,'movie/(\\S+).html')
|
||||||
res = vod.xpath('./div[@class="jidi"]/span/text()')
|
remark = ""
|
||||||
if len(res) == 0:
|
|
||||||
remark = '全1集'
|
|
||||||
else:
|
|
||||||
remark = vod.xpath('./div[@class="jidi"]/span/text()')[0]
|
|
||||||
videos.append({
|
videos.append({
|
||||||
"vod_id": tid,
|
"vod_id": tid,
|
||||||
"vod_name": name,
|
"vod_name": name,
|
||||||
|
|
@ -187,6 +177,7 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
'list':videos
|
'list':videos
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"player": { },
|
"player": { },
|
||||||
"filter": { }
|
"filter": { }
|
||||||
|
|
@ -194,6 +185,7 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
header = {
|
header = {
|
||||||
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36"
|
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36"
|
||||||
}
|
}
|
||||||
|
|
||||||
def parseCBC(self, enc, key, iv):
|
def parseCBC(self, enc, key, iv):
|
||||||
keyBytes = key.encode("utf-8")
|
keyBytes = key.encode("utf-8")
|
||||||
ivBytes = iv.encode("utf-8")
|
ivBytes = iv.encode("utf-8")
|
||||||
|
|
@ -203,21 +195,24 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
return msg[0:-paddingLen]
|
return msg[0:-paddingLen]
|
||||||
|
|
||||||
def playerContent(self,flag,id,vipFlags):
|
def playerContent(self,flag,id,vipFlags):
|
||||||
url = 'https://czspp.com/v_play/{0}.html'.format(id)
|
url = 'https://www.czys.me//v_play/{0}.html'.format(id)
|
||||||
pat = '\\"([^\\"]+)\\";var [\\d\\w]+=function dncry.*md5.enc.Utf8.parse\\(\\"([\\d\\w]+)\\".*md5.enc.Utf8.parse\\(([\\d]+)\\)'
|
pat = '\\"([^\\"]+)\\";var [\\d\\w]+=function dncry.*md5.enc.Utf8.parse\\(\\"([\\d\\w]+)\\".*md5.enc.Utf8.parse\\(([\\d]+)\\)'
|
||||||
rsp = self.fetch(url)
|
rsp = self.fetch(url)
|
||||||
|
|
||||||
html = rsp.text
|
html = rsp.text
|
||||||
content = self.regStr(html,pat)
|
content = self.regStr(html,pat)
|
||||||
if content == '':
|
|
||||||
return {}
|
|
||||||
key = self.regStr(html,pat,2)
|
key = self.regStr(html,pat,2)
|
||||||
iv = self.regStr(html,pat,3)
|
iv = self.regStr(html,pat,3)
|
||||||
decontent = self.parseCBC(base64.b64decode(content),key,iv).decode()
|
decontent = self.parseCBC(base64.b64decode(content),key,iv).decode()
|
||||||
|
|
||||||
urlPat = 'video: \\{url: \\\"([^\\\"]+)\\\"'
|
urlPat = 'video: \\{url: \\\"([^\\\"]+)\\\"'
|
||||||
vttPat = 'subtitle: \\{url:\\\"([^\\\"]+\\.vtt)\\\"'
|
vttPat = 'subtitle: \\{url:\\\"([^\\\"]+\\.vtt)\\\"'
|
||||||
|
|
||||||
str3 = self.regStr(decontent,urlPat)
|
str3 = self.regStr(decontent,urlPat)
|
||||||
str4 = self.regStr(decontent,vttPat)
|
str4 = self.regStr(decontent,vttPat)
|
||||||
|
|
||||||
self.loadVtt(str3)
|
self.loadVtt(str3)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'parse':'0',
|
'parse':'0',
|
||||||
'playUrl':'',
|
'playUrl':'',
|
||||||
|
|
@ -231,14 +226,11 @@ class Spider(Spider): # 元类 默认的元类 type
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def loadVtt(self,url):
|
def loadVtt(self,url):
|
||||||
pass
|
print(url)
|
||||||
|
|
||||||
def isVideoFormat(self,url):
|
def isVideoFormat(self,url):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def manualVideoCheck(self):
|
def manualVideoCheck(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def localProxy(self,param):
|
def localProxy(self,param):
|
||||||
action = {}
|
action = {}
|
||||||
return [200, "video/MP2T", action, ""]
|
return [200, "video/MP2T", action, ""]
|
||||||
23
tvbox2.json
23
tvbox2.json
|
|
@ -222,6 +222,18 @@
|
||||||
"filterable": 1,
|
"filterable": 1,
|
||||||
"ext": "./py/央视片库.py"
|
"ext": "./py/央视片库.py"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"key": "py_厂长",
|
||||||
|
"name": "厂长┃[py]",
|
||||||
|
"type": 3,
|
||||||
|
"api": "py_czzy",
|
||||||
|
"searchable": 1,
|
||||||
|
"quickSearch": 1,
|
||||||
|
"filterable": 1,
|
||||||
|
"ext": "./py/py_czspp.py"
|
||||||
|
},
|
||||||
|
|
||||||
//{"key":"红领巾影院","name":"红领┃BPQ","type":3,"api":"csp_XBPQ","searchable":1,"quickSearch":1,"filterable":1,"ext":"./xBPQ/红领巾影院.json","jar": "./JAR/XBPQ1.jar;md5;bb155c3f0133bbce4756ad52003f5968"},
|
//{"key":"红领巾影院","name":"红领┃BPQ","type":3,"api":"csp_XBPQ","searchable":1,"quickSearch":1,"filterable":1,"ext":"./xBPQ/红领巾影院.json","jar": "./JAR/XBPQ1.jar;md5;bb155c3f0133bbce4756ad52003f5968"},
|
||||||
{
|
{
|
||||||
"key": "快看影视",
|
"key": "快看影视",
|
||||||
|
|
@ -234,17 +246,6 @@
|
||||||
"ext": "./xBPQ/快看影视.json",
|
"ext": "./xBPQ/快看影视.json",
|
||||||
"jar": "http://xhww.fun:63/小米/暴脾气.jar;md5;bb155c3f0133bbce4756ad52003f5968"
|
"jar": "http://xhww.fun:63/小米/暴脾气.jar;md5;bb155c3f0133bbce4756ad52003f5968"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "厂长资源",
|
|
||||||
"name": "厂长┃BPQ",
|
|
||||||
"type": 3,
|
|
||||||
"api": "csp_XBPQ",
|
|
||||||
"searchable": 1,
|
|
||||||
"quickSearch": 1,
|
|
||||||
"filterable": 1,
|
|
||||||
"ext": "./xBPQ/厂长资源.json",
|
|
||||||
"jar": "http://xhww.fun:63/小米/暴脾气.jar;md5;bb155c3f0133bbce4756ad52003f5968"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "csp_xBPQ_素白",
|
"key": "csp_xBPQ_素白",
|
||||||
"name": "素白┃BPQ",
|
"name": "素白┃BPQ",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user