mirror of
https://github.com/qist/tvbox.git
synced 2025-10-26 17:52:20 +00:00
update ALL
This commit is contained in:
47
lib/drpy.js
47
lib/drpy.js
@@ -55,7 +55,7 @@ function pre(){
|
||||
}
|
||||
|
||||
let rule = {};
|
||||
const VERSION = 'drpy1 3.9.48beta16 20231011';
|
||||
const VERSION = 'drpy1 3.9.49beta36 202400414';
|
||||
/** 已知问题记录
|
||||
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
|
||||
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
|
||||
@@ -1082,6 +1082,9 @@ function request(url,obj,ocr_flag){
|
||||
obj.buffer = 2;
|
||||
delete obj.toBase64
|
||||
}
|
||||
if(obj.redirect===false){
|
||||
obj.redirect = 0;
|
||||
}
|
||||
console.log(JSON.stringify(obj.headers));
|
||||
// console.log('request:'+url+' obj:'+JSON.stringify(obj));
|
||||
console.log('request:'+url+`|method:${obj.method||'GET'}|body:${obj.body||''}`);
|
||||
@@ -1447,6 +1450,15 @@ function homeVodParse(homeVodObj){
|
||||
let t2 = (new Date()).getTime();
|
||||
console.log('加载首页推荐耗时:'+(t2-t1)+'毫秒');
|
||||
// console.log(JSON.stringify(d));
|
||||
if(rule.图片替换 && rule.图片替换.includes('=>')){
|
||||
let replace_from = rule.图片替换.split('=>')[0];
|
||||
let replace_to = rule.图片替换.split('=>')[1];
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
it.vod_pic = it.vod_pic.replace(replace_from,replace_to);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(rule.图片来源){
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
@@ -1585,6 +1597,15 @@ function categoryParse(cateObj) {
|
||||
console.log(e.message);
|
||||
}
|
||||
}
|
||||
if(rule.图片替换 && rule.图片替换.includes('=>')){
|
||||
let replace_from = rule.图片替换.split('=>')[0];
|
||||
let replace_to = rule.图片替换.split('=>')[1];
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
it.vod_pic = it.vod_pic.replace(replace_from,replace_to);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(rule.图片来源){
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
@@ -1634,9 +1655,9 @@ function searchParse(searchObj) {
|
||||
p = p.trim();
|
||||
let pp = rule.一级.split(';');
|
||||
let url = searchObj.searchUrl.replaceAll('**', searchObj.wd);
|
||||
if(searchObj.pg === 1 && url.includes('[')&&url.includes(']')){
|
||||
if(searchObj.pg === 1 && url.includes('[')&&url.includes(']')&&!url.includes('#')){
|
||||
url = url.split('[')[1].split(']')[0];
|
||||
}else if(searchObj.pg > 1 && url.includes('[')&&url.includes(']')){
|
||||
}else if(searchObj.pg > 1 && url.includes('[')&&url.includes(']')&&!url.includes('#')){
|
||||
url = url.split('[')[0];
|
||||
}
|
||||
if(/fypage/.test(url)){
|
||||
@@ -1776,6 +1797,15 @@ function searchParse(searchObj) {
|
||||
return '{}'
|
||||
}
|
||||
}
|
||||
if(rule.图片替换 && rule.图片替换.includes('=>')){
|
||||
let replace_from = rule.图片替换.split('=>')[0];
|
||||
let replace_to = rule.图片替换.split('=>')[1];
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
it.vod_pic = it.vod_pic.replace(replace_from,replace_to);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(rule.图片来源){
|
||||
d.forEach(it=>{
|
||||
if(it.vod_pic&&it.vod_pic.startsWith('http')){
|
||||
@@ -2070,6 +2100,11 @@ function detailParse(detailObj){
|
||||
}
|
||||
vod.vod_play_url = vod_play_url;
|
||||
}
|
||||
if(rule.图片替换 && rule.图片替换.includes('=>')){
|
||||
let replace_from = rule.图片替换.split('=>')[0];
|
||||
let replace_to = rule.图片替换.split('=>')[1];
|
||||
vod.vod_pic = vod.vod_pic.replace(replace_from,replace_to);
|
||||
}
|
||||
if(rule.图片来源 && vod.vod_pic && vod.vod_pic.startsWith('http')){
|
||||
vod.vod_pic = vod.vod_pic + rule.图片来源;
|
||||
}
|
||||
@@ -2169,6 +2204,7 @@ function tellIsJx(url){
|
||||
function playParse(playObj){
|
||||
fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
|
||||
MY_URL = playObj.url;
|
||||
var MY_FLAG = playObj.flag;
|
||||
if(!/http/.test(MY_URL)){
|
||||
try {
|
||||
MY_URL = base64Decode(MY_URL);
|
||||
@@ -2176,9 +2212,11 @@ function playParse(playObj){
|
||||
}
|
||||
MY_URL = decodeURIComponent(MY_URL);
|
||||
var input = MY_URL;//注入给免嗅js
|
||||
var flag = MY_FLAG;//注入播放线路名称给免嗅js
|
||||
let common_play = {
|
||||
parse:1,
|
||||
url:input,
|
||||
flag:flag,
|
||||
// url:urlencode(input),
|
||||
jx:tellIsJx(input)
|
||||
};
|
||||
@@ -2351,7 +2389,7 @@ function isVideoParse(isVideoObj){
|
||||
rule.url = rule.host && rule.url ? urljoin(rule.host,rule.url) : rule.url;
|
||||
}
|
||||
|
||||
if(rule.searchUrl.includes('[')&&rule.searchUrl.includes(']')){
|
||||
if(rule.searchUrl.includes('[')&&rule.searchUrl.includes(']')&&!rule.searchUrl.includes('#')){
|
||||
let u1 = rule.searchUrl.split('[')[0]
|
||||
let u2 = rule.searchUrl.split('[')[1].split(']')[0]
|
||||
rule.searchUrl = rule.host && rule.searchUrl?urljoin(rule.host,u1)+'['+urljoin(rule.host,u2)+']':rule.searchUrl;
|
||||
@@ -2363,6 +2401,7 @@ function isVideoParse(isVideoObj){
|
||||
rule.encoding = rule.编码||rule.encoding||'utf-8';
|
||||
rule.search_encoding = rule.搜索编码||rule.search_encoding||'';
|
||||
rule.图片来源 = rule.图片来源||'';
|
||||
rule.图片替换 = rule.图片替换||'';
|
||||
rule.play_json = rule.hasOwnProperty('play_json')?rule.play_json:[];
|
||||
rule.pagecount = rule.hasOwnProperty('pagecount')?rule.pagecount:{};
|
||||
rule.proxy_rule = rule.hasOwnProperty('proxy_rule')?rule.proxy_rule:'';
|
||||
|
||||
Reference in New Issue
Block a user