xxx
This commit is contained in:
1
0130/道长JS/cat/lib/ali.js
Normal file
1
0130/道长JS/cat/lib/ali.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(c,d){const n=b,e=c();while(!![]){try{const f=-parseInt(n(0x148))/0x1+-parseInt(n(0x140))/0x2*(parseInt(n(0x145))/0x3)+parseInt(n(0x150))/0x4*(parseInt(n(0x14c))/0x5)+-parseInt(n(0x147))/0x6+-parseInt(n(0x13d))/0x7+parseInt(n(0x13c))/0x8+parseInt(n(0x13b))/0x9*(parseInt(n(0x142))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xaf4a3));import{_}from'./cat.js';import{log}from'./utils.js';import{initSome,setToken,setShareId,getVod,playerContent,playerContentByFlag}from'./ali_api.js';function a(){const r=['126jHersJ','8018976SyNpYU','7198947GYbEkJ','wGsFx','isEmpty','50HOYYaa','PIvCN','1745270xSfZmS','match','split','68196ySTEaL','trim','3359892YLzwvG','845051dhMcfo','ali\x20init:','MlDBF','xvRmD','4405TqvVPk','stringify','HyWVX','ali\x20init\x20ext:','1244NAvJeB','ewEMb'];a=function(){return r;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x13a;let h=e[f];return h;},b(c,d);}async function initAli(c){const o=b,d={'HyWVX':function(f,g){return f(g);},'PIvCN':o(0x149),'ewEMb':function(f,g){return f+g;},'xvRmD':o(0x14f)};let e=c['ext'];await d[o(0x14e)](log,d[o(0x141)]+typeof c),await initSome(),await d[o(0x14e)](setToken,e),await d[o(0x14e)](log,d[o(0x13a)](d[o(0x14b)],e));}async function detailContent(c){const p=b,d={'MlDBF':function(l,m){return l(m);}},e=/www.aliyundrive.com\/s\/([^\/]+)(\/folder\/([^\/]+))?/;let f=c[p(0x146)](),g=f[p(0x143)](e);if(_[p(0x13f)](g))return'';let h=g[0x1],i=g['length']==0x3?g[0x3]:'';await d[p(0x14a)](setShareId,h);let j=await getVod(f,i),k=JSON[p(0x14d)]({'list':[j]});return k;}async function playContent(c,d,e){const q=b,f={'wGsFx':function(i,j){return i==j;},'rAcPj':function(i,j,k){return i(j,k);}};let g=d[q(0x144)]('+'),h=f[q(0x13e)](c,'原画')?await playerContent(g):await f['rAcPj'](playerContentByFlag,g,c);return h;}export{initAli,detailContent,playContent};
|
1
0130/道长JS/cat/lib/ali_api.js
Normal file
1
0130/道长JS/cat/lib/ali_api.js
Normal file
File diff suppressed because one or more lines are too long
1
0130/道长JS/cat/lib/cat.js
Normal file
1
0130/道长JS/cat/lib/cat.js
Normal file
File diff suppressed because one or more lines are too long
1
0130/道长JS/cat/lib/hls.js
Normal file
1
0130/道长JS/cat/lib/hls.js
Normal file
File diff suppressed because one or more lines are too long
1
0130/道长JS/cat/lib/similarity.js
Normal file
1
0130/道长JS/cat/lib/similarity.js
Normal file
@@ -0,0 +1 @@
|
||||
function compareTwoStrings(first,second){if((first=first.replace(/\s+/g,""))===(second=second.replace(/\s+/g,"")))return 1;if(first.length<2||second.length<2)return 0;var firstBigrams=new Map;for(let i=0;i<first.length-1;i++){var bigram=first.substring(i,i+2),count=firstBigrams.has(bigram)?firstBigrams.get(bigram)+1:1;firstBigrams.set(bigram,count)}let intersectionSize=0;for(let i=0;i<second.length-1;i++){const bigram=second.substring(i,i+2),count=firstBigrams.has(bigram)?firstBigrams.get(bigram):0;0<count&&(firstBigrams.set(bigram,count-1),intersectionSize++)}return 2*intersectionSize/(first.length+second.length-2)}function findBestMatch(mainString,targetStrings){var ratings=[];let bestMatchIndex=0;for(let i=0;i<targetStrings.length;i++){var currentTargetString=targetStrings[i],currentRating=compareTwoStrings(mainString,currentTargetString);ratings.push({target:currentTargetString,rating:currentRating}),currentRating>ratings[bestMatchIndex].rating&&(bestMatchIndex=i)}return{ratings:ratings,bestMatch:ratings[bestMatchIndex],bestMatchIndex:bestMatchIndex}}function lcs(str1,str2){if(!str1||!str2)return{length:0,sequence:"",offset:0};for(var sequence="",str1Length=str1.length,str2Length=str2.length,num=new Array(str1Length),maxlen=0,lastSubsBegin=0,i=0;i<str1Length;i++){for(var subArray=new Array(str2Length),j=0;j<str2Length;j++)subArray[j]=0;num[i]=subArray}for(var thisSubsBegin=null,i=0;i<str1Length;i++)for(j=0;j<str2Length;j++)str1[i]!==str2[j]?num[i][j]=0:(num[i][j]=0===i||0===j?1:1+num[i-1][j-1],num[i][j]>maxlen&&(maxlen=num[i][j],lastSubsBegin===(thisSubsBegin=i-num[i][j]+1)?sequence+=str1[i]:(lastSubsBegin=thisSubsBegin,sequence="",sequence+=str1.substr(lastSubsBegin,i+1-lastSubsBegin))));return{length:maxlen,sequence:sequence,offset:thisSubsBegin}}function findBestLCS(mainString,targetStrings){var results=[];let bestMatchIndex=0;for(let i=0;i<targetStrings.length;i++){var currentTargetString=targetStrings[i],currentLCS=lcs(mainString,currentTargetString);results.push({target:currentTargetString,lcs:currentLCS}),currentLCS.length>results[bestMatchIndex].lcs.length&&(bestMatchIndex=i)}return{allLCS:results,bestMatch:results[bestMatchIndex],bestMatchIndex:bestMatchIndex}}export{compareTwoStrings,findBestMatch,findBestLCS};
|
80
0130/道长JS/cat/lib/utils.js
Normal file
80
0130/道长JS/cat/lib/utils.js
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
|
||||
function isSub(ext) {
|
||||
return ext == "srt" || ext == "ass" || ext == "ssa";
|
||||
}
|
||||
|
||||
function getSize(size) {
|
||||
if (size <= 0) return "";
|
||||
if (size > 1024 * 1024 * 1024 * 1024.0) {
|
||||
size /= (1024 * 1024 * 1024 * 1024.0);
|
||||
return size.toFixed(2) + "TB";
|
||||
} else if (size > 1024 * 1024 * 1024.0) {
|
||||
size /= (1024 * 1024 * 1024.0);
|
||||
return size.toFixed(2) + "GB";
|
||||
} else if (size > 1024 * 1024.0) {
|
||||
size /= (1024 * 1024.0);
|
||||
return size.toFixed(2) + "MB";
|
||||
} else {
|
||||
size /= 1024.0;
|
||||
return size.toFixed(2) + "KB";
|
||||
}
|
||||
}
|
||||
|
||||
function removeExt(text) {
|
||||
return text.indexOf('.') > -1 ? text.substring(0, text.lastIndexOf(".")) : text;
|
||||
}
|
||||
|
||||
async function log(str) {
|
||||
console.debug(str);
|
||||
}
|
||||
|
||||
function isVideoFormat(url) {
|
||||
var RULE = /http((?!http).){12,}?\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\?.*|http((?!http).){12,}\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|http((?!http).)*?video\/tos*/;
|
||||
if (url.indexOf("url=http") > -1 || url.indexOf(".js") > -1 || url.indexOf(".css") > -1 || url.indexOf(".html") > -1) {
|
||||
return false;
|
||||
}
|
||||
return RULE.test(url);
|
||||
}
|
||||
|
||||
function jsonParse(input, json) {
|
||||
var jsonPlayData = JSON.parse(json);
|
||||
var url = jsonPlayData.url;
|
||||
if (url.startsWith("//")) {
|
||||
url = "https:" + url;
|
||||
}
|
||||
if (!url.startsWith("http")) {
|
||||
return null;
|
||||
}
|
||||
if (url === input) {
|
||||
if (!isVideoFormat(url)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
var headers = {};
|
||||
var ua = jsonPlayData["user-agent"] || "";
|
||||
if (ua.trim().length > 0) {
|
||||
headers["User-Agent"] = " " + ua;
|
||||
}
|
||||
var referer = jsonPlayData.referer || "";
|
||||
if (referer.trim().length > 0) {
|
||||
headers["Referer"] = " " + referer;
|
||||
}
|
||||
var taskResult = {
|
||||
header: headers,
|
||||
url: url
|
||||
};
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
function debug(obj) {
|
||||
for (var a in obj) {
|
||||
if (typeof(obj[a]) == "object") {
|
||||
debug(obj[a]); //递归遍历
|
||||
} else {
|
||||
console.debug(a + "=" + obj[a]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { isSub, getSize, removeExt, log, isVideoFormat, jsonParse, debug};
|
Reference in New Issue
Block a user