提交 787a1389 编写于 作者: H hjdhnx

修复py厂长,js的无法修

上级 e2c71455
3.9.24beta5 3.9.24beta6
\ No newline at end of file \ No newline at end of file
var rule={ var rule={
title:'厂长资源', title:'厂长资源',
host:'https://www.c-zzy.com', // host:'https://www.c-zzy.com',
// host:'https://www.czspp.com', host:'https://czspp.com',
url:'/fyclass/page/fypage', url:'/fyclass/page/fypage',
searchUrl:'/xssearch?q=**&f=_all&p=fypage', searchUrl:'/xssearch?q=**&f=_all&p=fypage',
searchable:2,//是否启用全局搜索, searchable:2,//是否启用全局搜索,
quickSearch:1,//是否启用快速搜索, quickSearch:1,//是否启用快速搜索,
filterable:0,//是否启用分类筛选, filterable:0,//是否启用分类筛选,
headers:{'User-Agent':'UC_UA', }, headers:{'User-Agent':'PC_UA', },
play_parse:true, play_parse:true,
lazy:'', lazy:'',
limit:6, limit:6,
...@@ -18,4 +18,7 @@ var rule={ ...@@ -18,4 +18,7 @@ var rule={
一级:'.bt_img&&ul&&li;h3.dytit&&Text;img.lazy&&data-original;.jidi&&Text;a&&href', 一级:'.bt_img&&ul&&li;h3.dytit&&Text;img.lazy&&data-original;.jidi&&Text;a&&href',
二级:{"title":"h1&&Text;.moviedteail_list li&&a&&Text","img":"div.dyimg img&&src","desc":".moviedteail_list li:eq(3) a&&Text;.moviedteail_list li:eq(2) a&&Text;.moviedteail_list li:eq(1) a&&Text;.moviedteail_list li:eq(7) a&&Text;.moviedteail_list li:eq(5) a&&Text","content":".yp_context&&Text","tabs":".mi_paly_box&&span","lists":".paly_list_btn:eq(#id) a"}, 二级:{"title":"h1&&Text;.moviedteail_list li&&a&&Text","img":"div.dyimg img&&src","desc":".moviedteail_list li:eq(3) a&&Text;.moviedteail_list li:eq(2) a&&Text;.moviedteail_list li:eq(1) a&&Text;.moviedteail_list li:eq(7) a&&Text;.moviedteail_list li:eq(5) a&&Text","content":".yp_context&&Text","tabs":".mi_paly_box&&span","lists":".paly_list_btn:eq(#id) a"},
搜索:'.search_list&&ul&&li;*;*;*;*', 搜索:'.search_list&&ul&&li;*;*;*;*',
// 预处理:'rule_fetch_params.headers.Cookie = "Hm_lvt_d06dda04a24e89e1117ee1455e217c30=1669008856; 6de728358f84bf15ea9bb771c18f37fb=b4a901c371f729a828c31d9d78def299; myannoun=1; Hm_lvt_c08e84f2c697dc9d0af77ff0dbfb3d6d=1669356917; Hm_lpvt_c08e84f2c697dc9d0af77ff0dbfb3d6d=1669357024; Hm_lpvt_d06dda04a24e89e1117ee1455e217c30=1669357024"',
预处理:'',
预处理:'rule_fetch_params.headers.Cookie="68148872828e9f4d64e7a296f6c6b6d7=5429da9a54375db451f7f9e4f16ce0ea";let new_host="https://czspp.com";let new_html=request(new_host);if(/正在进行人机识别/.test(new_html)){let new_src=pd(new_html,"script&&src",new_host);log(new_src);let hhtml=request(new_src,{withHeaders:true});let json=JSON.parse(hhtml);let html=json.body;let key=html.match(new RegExp(\'var key="(.*?)"\'))[1];let avalue=html.match(new RegExp(\'value="(.*?)"\'))[1];let c="";for(let i=0;i<avalue.length;i++){let a=avalue[i];let b=a.charCodeAt();c+=b}let value=md5(c);log(value);let yz_url="https://czspp.com/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_ip.php?type=96c4e20a0e951f471d32dae103e83881&key="+key+"&value="+value;log(yz_url);hhtml=request(yz_url,{withHeaders:true});json=JSON.parse(hhtml);let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");let cookie=setCk?json[setCk].split(";")[0]:"";log("cookie:"+cookie);rule_fetch_params.headers.Cookie=cookie;setItem(RULE_CK,cookie)}',
} }
\ No newline at end of file
rule_fetch_params.headers.Cookie = '68148872828e9f4d64e7a296f6c6b6d7=5429da9a54375db451f7f9e4f16ce0ea';
let new_host = 'https://czspp.com';
let new_html = request(new_host);
if(/正在进行人机识别/.test(new_html)){
let new_src = pd(new_html,'script&&src',new_host);
log(new_src);
let hhtml = request(new_src,{withHeaders:true});
let json = JSON.parse(hhtml);
let html = json.body;
let key = html.match(new RegExp('var key=\"(.*?)\"'))[1];
let avalue = html.match(new RegExp('value=\"(.*?)\"'))[1];
// log(html.indexOf('var key='));
// log(key);
// log(avalue);
let c = ''
for(let i=0;i<avalue.length;i++){
let a = avalue[i];
let b = a.charCodeAt();
c += b;
}
let value = md5(c);
log(value);
let yz_url = 'https://czspp.com/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_ip.php?type=96c4e20a0e951f471d32dae103e83881&key='+key+'&value='+value;
log(yz_url);
hhtml = request(yz_url,{withHeaders:true});
json = JSON.parse(hhtml);
let setCk = Object.keys(json).find(it=>it.toLowerCase()==='set-cookie');
let cookie = setCk?json[setCk].split(';')[0]:'';
// let cookie = setCk?json[setCk]:'';
log('cookie:'+cookie);
rule_fetch_params.headers.Cookie = cookie;
setItem(RULE_CK,cookie);
}
\ No newline at end of file
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
###### 2022/11/25 ###### 2022/11/25
- [X] 优化腾云驾雾源,方便追剧 - [X] 优化腾云驾雾源,方便追剧
- [X] 增加新解析并修复酷云自建解析 - [X] 增加新解析并修复酷云自建解析
- [X] 修复py版厂长资源
###### 2022/11/24 ###### 2022/11/24
- [X] 优化alist的历史记录和收藏 - [X] 优化alist的历史记录和收藏
- [X] 设置中心环境变量增加前端的保存校验 - [X] 设置中心环境变量增加前端的保存校验
......
...@@ -4,7 +4,8 @@ import sys ...@@ -4,7 +4,8 @@ import sys
sys.path.append('..') sys.path.append('..')
from base.spider import Spider from base.spider import Spider
import base64 import base64
from requests import session, utils import hashlib
import requests
from Crypto.Cipher import AES from Crypto.Cipher import AES
class Spider(Spider): # 元类 默认的元类 type class Spider(Spider): # 元类 默认的元类 type
...@@ -62,34 +63,43 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -62,34 +63,43 @@ class Spider(Spider): # 元类 默认的元类 type
} }
return result return 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"}
cookies = '' cookies = ''
def getCookie(self,url): def getCookie(self,url,header):
rsp = self.fetch(url,headers=self.header) session = requests.session()
baseurl = self.regStr(reg=r'(https://.*?/)', src=url) rsp = session.get(url)
append = url.replace(baseurl,'') nurl = 'https://czspp.com' + self.regStr(rsp.text, 'src=\"(.*?)\"')
zid = self.regStr(rsp.text, "{0}(\\S+)\"".format(append)) nrsp = session.get(nurl, headers=header)
self.zid = zid key = self.regStr(nrsp.text, 'var key=\"(.*?)\"')
self.cookies = rsp.cookies avalue = self.regStr(nrsp.text, 'value=\"(.*?)\"')
if 'btwaf' not in zid: c = ''
zid = '' for i in range(0, len(avalue)):
return rsp.cookies, zid a = avalue[i]
b = ord(a)
c = c + str(b)
value = hashlib.md5(c.encode()).hexdigest()
session.get('https://czspp.com/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_ip.php?type=96c4e20a0e951f471d32dae103e83881&key={0}&value={1}'.format(key,value), headers=header)
return session
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://czspp.com/{0}/page/{1}'.format(tid,pg)
if len(self.cookies) <= 0: header = {
self.getCookie(url) "Connection": "keep-alive",
url = url + self.zid "Referer": url,
rsp = self.fetch(url, cookies=self.cookies,headers=self.header) "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
}
session = self.getCookie(url,header)
rsp = session.get(url, cookies=self.cookies, headers=header)
root = self.html(self.cleanText(rsp.text)) root = self.html(self.cleanText(rsp.text))
aList = root.xpath("//div[contains(@class,'bt_img mi_ne_kd mrb')]/ul/li") aList = root.xpath("//div[contains(@class,'bt_img mi_ne_kd mrb')]/ul/li")
videos = [] videos = []
for a in aList: for a in aList:
name = a.xpath('./a/img/@alt')[0] name = a.xpath('./a/img/@alt')[0]
pic = a.xpath('./a/img/@data-original')[0] pic = a.xpath('./a/img/@data-original')[0]
mark = a.xpath("./div[@class='hdinfo']/span/text()")[0] mark = a.xpath(".//div[@class='jidi']/span/text()")
if mark ==[]:
mark = a.xpath("./div[@class='hdinfo']/span/text()")
mark = mark[0]
sid = a.xpath("./a/@href")[0] sid = a.xpath("./a/@href")[0]
sid = self.regStr(sid, "/movie/(\\S+).html") sid = self.regStr(sid, "/movie/(\\S+).html")
videos.append({ videos.append({
...@@ -108,10 +118,13 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -108,10 +118,13 @@ class Spider(Spider): # 元类 默认的元类 type
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://czspp.com/movie/{0}.html'.format(tid)
if len(self.cookies) <= 0: header = {
self.getCookie(url) "Connection": "keep-alive",
url = url + self.zid "Referer": url,
rsp = self.fetch(url,cookies=self.cookies,headers=self.header) "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
}
session = self.getCookie(url, header)
rsp = session.get(url,cookies=self.cookies,headers=header)
root = self.html(self.cleanText(rsp.text)) root = self.html(self.cleanText(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]
...@@ -182,10 +195,13 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -182,10 +195,13 @@ class Spider(Spider): # 元类 默认的元类 type
def searchContent(self, key, quick): def searchContent(self, key, quick):
url = 'https://czspp.com/xssearch?q={0}'.format(key) url = 'https://czspp.com/xssearch?q={0}'.format(key)
if len(self.cookies) <= 0: header = {
self.getCookie(url) "Connection": "keep-alive",
url = url + self.zid "Referer": url,
rsp = self.fetch(url,cookies=self.cookies,headers=self.header) "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
}
session = self.getCookie(url, header)
rsp = session.get(url,cookies=self.cookies, headers=header)
root = self.html(self.cleanText(rsp.text)) root = self.html(self.cleanText(rsp.text))
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 = []
...@@ -214,6 +230,7 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -214,6 +230,7 @@ class Spider(Spider): # 元类 默认的元类 type
"filter": {} "filter": {}
} }
header = { header = {
"Referer": "https://czspp.com/",
"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):
...@@ -227,11 +244,14 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -227,11 +244,14 @@ class Spider(Spider): # 元类 默认的元类 type
def playerContent(self, flag, id, vipFlags): def playerContent(self, flag, id, vipFlags):
result = {} result = {}
url = 'https://czspp.com/v_play/{0}.html'.format(id) url = 'https://czspp.com/v_play/{0}.html'.format(id)
if len(self.cookies) <= 0: header = {
self.getCookie(url) "Connection": "keep-alive",
url = url + self.zid "Referer": url,
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
}
session = self.getCookie(url, header)
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,cookies=self.cookies,headers=self.header) rsp = session.get(url,cookies=self.cookies, headers=header)
html = rsp.text html = rsp.text
content = self.regStr(html, pat) content = self.regStr(html, pat)
if content == '': if content == '':
...@@ -274,4 +294,4 @@ class Spider(Spider): # 元类 默认的元类 type ...@@ -274,4 +294,4 @@ class Spider(Spider): # 元类 默认的元类 type
def localProxy(self, param): def localProxy(self, param):
action = {} action = {}
return [200, "video/MP2T", action, ""] return [200, "video/MP2T", action, ""]
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册