Add files via upload

This commit is contained in:
dxawi 2023-09-01 10:12:38 +08:00 committed by GitHub
parent f9e17df248
commit 7a42b37bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 0 deletions

1
cat/lib/ali.js Normal file
View File

@ -0,0 +1 @@
(function(_0x24a2d2,_0x5e8b9c){const _0x5df84b=_0x8314,_0x37f89b=_0x24a2d2();while(!![]){try{const _0x2c4d4a=-parseInt(_0x5df84b(0x1f5))/0x1*(-parseInt(_0x5df84b(0x1f6))/0x2)+parseInt(_0x5df84b(0x200))/0x3+-parseInt(_0x5df84b(0x1eb))/0x4*(parseInt(_0x5df84b(0x1ea))/0x5)+parseInt(_0x5df84b(0x1ed))/0x6*(-parseInt(_0x5df84b(0x1e2))/0x7)+-parseInt(_0x5df84b(0x1fc))/0x8*(-parseInt(_0x5df84b(0x1f3))/0x9)+-parseInt(_0x5df84b(0x1ec))/0xa*(parseInt(_0x5df84b(0x1e4))/0xb)+-parseInt(_0x5df84b(0x1e8))/0xc;if(_0x2c4d4a===_0x5e8b9c)break;else _0x37f89b['push'](_0x37f89b['shift']());}catch(_0x42d019){_0x37f89b['push'](_0x37f89b['shift']());}}}(_0x3662,0xc4f19));const _0x5403fe=(function(){let _0x33197a=!![];return function(_0x25661f,_0x19ca25){const _0x33a295=_0x33197a?function(){const _0x229372=_0x8314;if(_0x19ca25){const _0x236c2e=_0x19ca25[_0x229372(0x1ee)](_0x25661f,arguments);return _0x19ca25=null,_0x236c2e;}}:function(){};return _0x33197a=![],_0x33a295;};}()),_0x1a5007=_0x5403fe(this,function(){const _0x516ca0=_0x8314;let _0x4c830a;try{const _0x1d20d6=Function(_0x516ca0(0x1e3)+_0x516ca0(0x1f0)+');');_0x4c830a=_0x1d20d6();}catch(_0x4bf3f9){_0x4c830a=window;}const _0x1f4472=_0x4c830a[_0x516ca0(0x1e6)]=_0x4c830a['console']||{},_0x2283f3=[_0x516ca0(0x1f2),_0x516ca0(0x1f1),_0x516ca0(0x1fe),'error',_0x516ca0(0x1f7),'table','trace'];for(let _0x3cf6e9=0x0;_0x3cf6e9<_0x2283f3[_0x516ca0(0x1fa)];_0x3cf6e9++){const _0x1e114f=_0x5403fe['constructor'][_0x516ca0(0x1f9)]['bind'](_0x5403fe),_0x1a6a55=_0x2283f3[_0x3cf6e9],_0xde1b62=_0x1f4472[_0x1a6a55]||_0x1e114f;_0x1e114f['__proto__']=_0x5403fe['bind'](_0x5403fe),_0x1e114f['toString']=_0xde1b62[_0x516ca0(0x1ef)][_0x516ca0(0x1f8)](_0xde1b62),_0x1f4472[_0x1a6a55]=_0x1e114f;}});_0x1a5007();import{_}from'./cat.js';import{initSome,setToken,setShareId,getVod,playerContent,playerContentByFlag}from'./ali_api.js';async function initAli(_0x3f10ce){await initSome(),await setToken(_0x3f10ce);}function _0x3662(){const _0x323ddf=['match','info','debug','4684176HcWJTq','1211idbeaQ','return\x20(function()\x20','99lEeIGW','-----playContent-------','console','split','19834608jNlQAs','isEmpty','100qLvEjd','123404oxGYjD','132210InTKLS','1722UonmUS','apply','toString','{}.constructor(\x22return\x20this\x22)(\x20)','warn','log','261ILDdxF','stringify','3049bfdvKa','206pnNeHh','exception','bind','prototype','length','trim','377872dYbZkZ'];_0x3662=function(){return _0x323ddf;};return _0x3662();}async function detailContent(_0x1094f1){const _0x55be27=_0x8314,_0x5c056c=/www.aliyundrive.com\/s\/([^\/]+)(\/folder\/([^\/]+))?/;let _0x4cb453=_0x1094f1[_0x55be27(0x1fb)](),_0x49069b=_0x4cb453[_0x55be27(0x1fd)](_0x5c056c);if(_[_0x55be27(0x1e9)](_0x49069b))return'';let _0x1e8a67=_0x49069b[0x1],_0x1943ab=_0x49069b['length']==0x3?_0x49069b[0x3]:'';await setShareId(_0x1e8a67);let _0x5cddd0=await getVod(_0x4cb453,_0x1943ab),_0x538833=JSON[_0x55be27(0x1f4)]({'list':[_0x5cddd0]});return console[_0x55be27(0x1ff)](_0x538833),_0x538833;}function _0x8314(_0x1e522d,_0x76b569){const _0x4e0a8c=_0x3662();return _0x8314=function(_0x1a5007,_0x5403fe){_0x1a5007=_0x1a5007-0x1e2;let _0x6a32f1=_0x4e0a8c[_0x1a5007];return _0x6a32f1;},_0x8314(_0x1e522d,_0x76b569);}async function playContent(_0x292f90,_0xb9135b,_0x254b54){const _0x1a1dc4=_0x8314;let _0x356b9e=_0xb9135b[_0x1a1dc4(0x1e7)]('+'),_0x241b39=_0x292f90=='原画'?await playerContent(_0x356b9e):await playerContentByFlag(_0x356b9e,_0x292f90);return console[_0x1a1dc4(0x1ff)](_0x1a1dc4(0x1e5)),console[_0x1a1dc4(0x1ff)](_0x241b39),_0x241b39;}export{initAli,detailContent,playContent};

1
cat/lib/ali_api.js Normal file

File diff suppressed because one or more lines are too long

1
cat/lib/similarity.js Normal file
View 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
cat/lib/utils.js Normal file
View 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};