mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
unminify
This commit is contained in:
51
dist/superVideoExtractor.js
vendored
51
dist/superVideoExtractor.js
vendored
@@ -1 +1,50 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))(function(n,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function c(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,c)}u((r=r.apply(t,e||[])).next())})};function superVideoExtractor(t){return __awaiter(this,void 0,void 0,function*(){var e,i;try{var r=/eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/.exec(t);let a="";if(r){var n=r[2];a=null===(e=n.split("',36,"))||void 0===e?void 0:e[0].trim();let t=36,i=n.split("',36,")[1].slice(2).split("|").length,c=n.split("',36,")[1].slice(2).split("|");for(;i--;)if(c[i]){var o=new RegExp("\\b"+i.toString(t)+"\\b","g");a=a.replace(o,c[i])}}return(null===(i=null==a?void 0:a.match(/file:\s*"([^"]+\.m3u8[^"]*)"/))||void 0===i?void 0:i[1])||""}catch(t){return""}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.superVideoExtractor=superVideoExtractor;
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.superVideoExtractor = superVideoExtractor;
|
||||
function superVideoExtractor(data) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var _a, _b;
|
||||
try {
|
||||
// Step 1: Extract the function parameters and the encoded string
|
||||
var functionRegex = /eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/;
|
||||
var match = functionRegex.exec(data);
|
||||
let p = '';
|
||||
if (match) {
|
||||
// var params = match[1].split(',').map(param => param.trim());
|
||||
var encodedString = match[2];
|
||||
// console.log('Parameters:', params);
|
||||
// console.log('Encoded String:', encodedString.split("',36,")[0], '🔥🔥');
|
||||
p = (_a = encodedString.split("',36,")) === null || _a === void 0 ? void 0 : _a[0].trim();
|
||||
let a = 36;
|
||||
let c = encodedString.split("',36,")[1].slice(2).split('|').length;
|
||||
let k = encodedString.split("',36,")[1].slice(2).split('|');
|
||||
while (c--) {
|
||||
if (k[c]) {
|
||||
var regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g');
|
||||
p = p.replace(regex, k[c]);
|
||||
}
|
||||
}
|
||||
// console.log('Decoded String:', p);
|
||||
}
|
||||
else {
|
||||
console.log('No match found');
|
||||
}
|
||||
const streamUrl = (_b = p === null || p === void 0 ? void 0 : p.match(/file:\s*"([^"]+\.m3u8[^"]*)"/)) === null || _b === void 0 ? void 0 : _b[1];
|
||||
console.log('streamUrl:', streamUrl);
|
||||
return streamUrl || '';
|
||||
}
|
||||
catch (err) {
|
||||
console.error('SuperVideoExtractor Error:', err);
|
||||
return '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user