自建解析逻辑优化
This commit is contained in:
parent
c35f565bc9
commit
8f001cfdd5
@ -415,6 +415,7 @@ def sort_parses_by_order(parses,host):
|
|||||||
parses[i]['order'] = 0
|
parses[i]['order'] = 0
|
||||||
parses[i]['write_date'] = 0
|
parses[i]['write_date'] = 0
|
||||||
|
|
||||||
|
# 外层自动补header
|
||||||
if not parses[i].get('header'):
|
if not parses[i].get('header'):
|
||||||
parses[i]['header'] = {'User-Agent': 'Mozilla/5.0'}
|
parses[i]['header'] = {'User-Agent': 'Mozilla/5.0'}
|
||||||
if str(parses[i]['url']).startswith('/'):
|
if str(parses[i]['url']).startswith('/'):
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy(){
|
function lazy(){
|
||||||
let jxUrl = 'https://vip.lianfaka.com/vip/?url=';
|
let jxUrl = 'https://vip.lianfaka.com/vip/?url=';
|
||||||
fetch_params.headers.Referer = 'https://www.dy6g.com';
|
fetch_params.headers.Referer = 'https://www.dy6g.com';
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'https://80k.tv/jxplayer.php?v=';
|
let jxUrl = 'https://80k.tv/jxplayer.php?v=';
|
||||||
fetch_params.headers.Referer = 'https://1080p.tv';
|
fetch_params.headers.Referer = 'https://1080p.tv';
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'https://json.legendwhb.cn/llq/?url=';
|
let jxUrl = 'https://json.legendwhb.cn/llq/?url=';
|
||||||
fetch_params.headers.Referer = jxUrl;
|
fetch_params.headers.Referer = jxUrl;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
realUrl = 重定向('https://play.fuqizhishi.com/jx2/API.php?appkey=iiiixiaobai&url=' + input);
|
realUrl = 重定向('https://play.fuqizhishi.com/jx2/API.php?appkey=iiiixiaobai&url=' + input);
|
||||||
return realUrl
|
return realUrl
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
// 星驰免嗅
|
// 星驰免嗅
|
||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'https://vip.swuii.top/player/analysis.php?v=';
|
let jxUrl = 'https://vip.swuii.top/player/analysis.php?v=';
|
||||||
fetch_params.headers.Referer = jxUrl;
|
fetch_params.headers.Referer = jxUrl;
|
||||||
|
|||||||
18
jiexi/哔哩.js
18
jiexi/哔哩.js
@ -1,14 +1,6 @@
|
|||||||
// print(env);
|
// print(env);
|
||||||
// input = 'https://www.bilibili.com/bangumi/play/ep704873';
|
// input = 'https://www.bilibili.com/bangumi/play/ep704873';
|
||||||
fetch_params.headers = {
|
var flag = ['bilibili'];
|
||||||
'User-Agent':PC_UA,
|
|
||||||
"Referer": "https://www.bilibili.com",
|
|
||||||
"Cookie":env.bili_cookie||''
|
|
||||||
};
|
|
||||||
let appkey = env.appkey||'';
|
|
||||||
let access_key = env.access_key||'';
|
|
||||||
// print(fetch_params);
|
|
||||||
|
|
||||||
function getEpUrl(ssUrl){
|
function getEpUrl(ssUrl){
|
||||||
let html = request(ssUrl);
|
let html = request(ssUrl);
|
||||||
let short_link = html.match(/short_link(.*?),/)[1];
|
let short_link = html.match(/short_link(.*?),/)[1];
|
||||||
@ -61,6 +53,14 @@ return null
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function lazy(){
|
function lazy(){
|
||||||
|
fetch_params.headers = {
|
||||||
|
'User-Agent':PC_UA,
|
||||||
|
"Referer": "https://www.bilibili.com",
|
||||||
|
"Cookie":env.bili_cookie||''
|
||||||
|
};
|
||||||
|
let appkey = env.appkey||'';
|
||||||
|
let access_key = env.access_key||'';
|
||||||
|
|
||||||
if(!/bilibili/.test(input)){
|
if(!/bilibili/.test(input)){
|
||||||
realUrl = input;
|
realUrl = input;
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'http://chaloli.cn/home/api?type=ys&uid=1&key=ekloswzABCGHKLOT58&url=';
|
let jxUrl = 'http://chaloli.cn/home/api?type=ys&uid=1&key=ekloswzABCGHKLOT58&url=';
|
||||||
fetch_params.headers.Referer = jxUrl;
|
fetch_params.headers.Referer = jxUrl;
|
||||||
|
|||||||
@ -20,6 +20,7 @@ function getSign(script, rid, did, tt){
|
|||||||
}
|
}
|
||||||
// log(env);
|
// log(env);
|
||||||
// fetch_params.headers.Referer = input;
|
// fetch_params.headers.Referer = input;
|
||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
try {
|
try {
|
||||||
// realUrl = null;
|
// realUrl = null;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
// let jxUrl = 'http://api.ckflv.cn/?url=';
|
// let jxUrl = 'http://api.ckflv.cn/?url=';
|
||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
log(env);
|
log(env);
|
||||||
let jxUrl = 'https://k.json.icu/home/api?type=ys&uid=12406929&key=adgouwyCGIRSTUV046&url=';
|
let jxUrl = 'https://k.json.icu/home/api?type=ys&uid=12406929&key=adgouwyCGIRSTUV046&url=';
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'http://45.248.10.163:4433/json.php?wap=0&url=';
|
let jxUrl = 'http://45.248.10.163:4433/json.php?wap=0&url=';
|
||||||
fetch_params.headers.Referer = jxUrl;
|
fetch_params.headers.Referer = jxUrl;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let PWD = 'drpy';
|
let PWD = 'drpy';
|
||||||
// log(params);
|
// log(params);
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'http://api.kunyu77.com/api.php/provide/parserUrl?url=';
|
let jxUrl = 'http://api.kunyu77.com/api.php/provide/parserUrl?url=';
|
||||||
var t = Math.floor(new Date().getTime() / 1000).toString();
|
var t = Math.floor(new Date().getTime() / 1000).toString();
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
// realUrl = 重定向('http://ivips.ml/jx/json.php/?url='+input)
|
// realUrl = 重定向('http://ivips.ml/jx/json.php/?url='+input)
|
||||||
|
|
||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
realUrl = 重定向('http://103.40.240.46/jh/?url=' + input);
|
realUrl = 重定向('http://103.40.240.46/jh/?url=' + input);
|
||||||
return realUrl
|
return realUrl
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
// realUrl = input;
|
// realUrl = input;
|
||||||
// }
|
// }
|
||||||
// 虾米免嗅
|
// 虾米免嗅
|
||||||
|
var flag = [];
|
||||||
function lazy() {
|
function lazy() {
|
||||||
let jxUrl = 'https://jx.xmflv.com/?url=';
|
let jxUrl = 'https://jx.xmflv.com/?url=';
|
||||||
fetch_params.headers.Referer = jxUrl;
|
fetch_params.headers.Referer = jxUrl;
|
||||||
|
|||||||
36
js/rules.py
36
js/rules.py
@ -202,16 +202,40 @@ def getJxs(path=None, host=None):
|
|||||||
file_name = list(
|
file_name = list(
|
||||||
filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0 and str(x).find('加密') < 0, file_name))
|
filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0 and str(x).find('加密') < 0, file_name))
|
||||||
# print(file_name)
|
# print(file_name)
|
||||||
jx_list = [file.replace('.js', '') for file in file_name]
|
# jx_list = [file.replace('.js', '') for file in file_name]
|
||||||
# print(file_name)
|
# print(file_name)
|
||||||
# print(jx_list)
|
# print(jx_list)
|
||||||
jx_str = '\n'.join([jx + ',{{host}}' + f'/parse/api/{jx}.js?url=,1' for jx in jx_list])
|
# jx_str = '\n'.join([jx + ',{{host}}' + f'/parse/api/{jx}.js?url=,1' for jx in jx_list])
|
||||||
# print(jx_str)
|
# print(jx_str)
|
||||||
|
jxs = []
|
||||||
|
for file in file_name:
|
||||||
|
ctx = Context()
|
||||||
|
with open(os.path.join(base_path,file),encoding='utf-8') as f0:
|
||||||
|
code = f0.read()
|
||||||
|
try:
|
||||||
|
ctx.eval(code)
|
||||||
|
flag = ctx.get('flag')
|
||||||
|
if flag:
|
||||||
|
flag = flag.json()
|
||||||
|
flag = ujson.loads(flag)
|
||||||
|
if isinstance(flag,list) and len(flag) > 0:
|
||||||
|
jx = file.replace('.js', '')
|
||||||
|
logger.info(f'自建解析可用:{jx}')
|
||||||
|
jxs.append({
|
||||||
|
'name': jx,
|
||||||
|
'url': f'{host}/parse/api/{jx}.js?url=',
|
||||||
|
'type': 1,
|
||||||
|
'ua': UA,
|
||||||
|
'flag': flag,
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
logger.info(f'自建解析{file}写法有误:{e}')
|
||||||
|
|
||||||
with open(f'{path}/解析.conf', encoding='utf-8') as f:
|
with open(f'{path}/解析.conf', encoding='utf-8') as f1:
|
||||||
text = f.read()
|
text = f1.read()
|
||||||
text = jx_str + '\n' + text
|
# text = jx_str + '\n' + text
|
||||||
jxs = jxTxt2Json(text, host)
|
jxs1 = jxTxt2Json(text, host)
|
||||||
|
jxs.extend(jxs1)
|
||||||
with open(custom_jx, encoding='utf-8') as f2:
|
with open(custom_jx, encoding='utf-8') as f2:
|
||||||
text = f2.read()
|
text = f2.read()
|
||||||
jxs2 = jxTxt2Json(text, host)
|
jxs2 = jxTxt2Json(text, host)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3.9.47beta41
|
3.9.47beta42
|
||||||
@ -70,11 +70,12 @@
|
|||||||
"url": "{{ jx.url }}",
|
"url": "{{ jx.url }}",
|
||||||
"type": {{ jx.type }},
|
"type": {{ jx.type }},
|
||||||
"ext": {
|
"ext": {
|
||||||
"flag": ["qiyi","imgo","爱奇艺", "奇艺", "qq","qq 预告及花絮", "腾讯", "youku", "优酷", "pptv", "PPTV", "letv", "乐视","leshi", "mgtv", "芒果","sohu", "xigua","fun","风行"],
|
"flag": {{jx.flag or ["qiyi","imgo","爱奇艺", "奇艺", "qq","qq 预告及花絮", "腾讯", "youku", "优酷", "pptv", "PPTV", "letv", "乐视","leshi", "mgtv", "芒果","sohu", "xigua","fun","风行"]}}
|
||||||
|
|
||||||
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"User-Agent": "{{ jx.ua }}"
|
"User-Agent": "{{ jx.ua }}"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}{% if loop.last==False %},{% endif %}{% endfor %}
|
}{% if loop.last==False %},{% endif %}{% endfor %}
|
||||||
],
|
],
|
||||||
"flags": ["imgo","youku", "qq","qq 预告及花絮", "iqiyi", "qiyi","fun", "letv","leshi","sohu", "tudou","xigua","cntv","1905", "pptv", "mgtv", "wasu", "bilibili", "renrenmi"],
|
"flags": ["imgo","youku", "qq","qq 预告及花絮", "iqiyi", "qiyi","fun", "letv","leshi","sohu", "tudou","xigua","cntv","1905", "pptv", "mgtv", "wasu", "bilibili", "renrenmi"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user