Socket
Socket
Sign inDemoInstall

wikiextensions-flix

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikiextensions-flix - npm Package Compare versions

Comparing version 1.7.1 to 1.7.5

164

dist/extractors/vidcloud.js

@@ -28,69 +28,111 @@ "use strict";

//let result = undefined;
let sources = undefined;
res = await axios_1.default.get(`${isAlternative ? this.host2 : this.host}/ajax/embed-4/getSources?id=${id}`, options);
console.log("res",res)
if (!(0, utils_1.isJson)(res.data.sources)) {
let { data: key } = await axios_1.default.get('https://raw.githubusercontent.com/Phantom-KNA/GeneratorFlixHQ/e4/key');
key = key;
if (!key) {
key = await (await axios_1.default.get('https://raw.githubusercontent.com/Phantom-KNA/GeneratorFlixHQ/e4/key')).data;
let sources = undefined;
res = await axios_1.default.get(`${isAlternative ? this.host2 : this.host}/ajax/embed-4/getSources?id=${id}`, options);
//console.log("res", res)
/* Desencrypted Key */
const getPairs = (scriptText) => {
const script = scriptText.toString();
const startOfSwitch = script.lastIndexOf('switch');
const endOfCases = script.indexOf('partKeyStartPosition');
const switchBody = script.slice(startOfSwitch, endOfCases);
const matches = switchBody.matchAll(/:[a-zA-Z0-9]+=([a-zA-Z0-9]+),[a-zA-Z0-9]+=([a-zA-Z0-9]+);/g);
const nums = [];
for (const match of matches) {
const innerNumbers = [];
for (const varMatch of [match[1], match[2]]) {
const regex = new RegExp(`${varMatch}=0x([a-zA-Z0-9]+)`, 'g');
const varMatches = [...script.matchAll(regex)];
const lastMatch = varMatches[varMatches.length - 1];
if (!lastMatch) return null;
const number = parseInt(lastMatch[1], 16);
innerNumbers.push(number);
}
console.log("key",key)
const sourcesArray = res.data.sources.split('');
let extractedKey = '';
let currentIndex = 0;
for (const index of key) {
let start = index[0] + currentIndex;
let end = start + index[1];
for (let i = start; i < end; i++) {
extractedKey += res.data.sources[i];
sourcesArray[i] = '';
}
currentIndex += index[1];
nums.push([innerNumbers[0], innerNumbers[1]]);
}
return nums;
}
/*- branch: e1
script_url: https://megacloud.tv/js/player/a/prod/e1-player.min.js
- branch: e6
script_url: https://rapid-cloud.co/js/player/prod/e6-player-v2.min.js
- branch: e4
script_url: https://rabbitstream.net/js/player/prod/e4-player.min.js
*/
const fileUrl = 'https://rabbitstream.net/js/player/prod/e4-player.min.js';
const { data } = await axios_1.default.get(fileUrl);
const pairs = getPairs(data);
/* End Desencrypted Key */
if (!(0, utils_1.isJson)(res.data.sources)) {
//let { data: key } = await axios_1.default.get('https://raw.githubusercontent.com/Phantom-KNA/GeneratorFlixHQ/e4/key');
let { data: key } = pairs;
key = key;
if (!key) {
//key = await (await axios_1.default.get('https://raw.githubusercontent.com/Phantom-KNA/GeneratorFlixHQ/e4/key')).data;
key = pairs;
}
console.log("pairs", pairs)
console.log("key", key)
const sourcesArray = res.data.sources.split('');
let extractedKey = '';
let currentIndex = 0;
for (const index of key) {
let start = index[0] + currentIndex;
let end = start + index[1];
for (let i = start; i < end; i++) {
extractedKey += res.data.sources[i];
sourcesArray[i] = '';
}
key = extractedKey;
console.log("extractedKey",extractedKey)
res.data.sources = sourcesArray.join('');
const decryptedVal = crypto_js_1.default.AES.decrypt(res.data.sources, key).toString(crypto_js_1.default.enc.Utf8);
sources = (0, utils_1.isJson)(decryptedVal) ? JSON.parse(decryptedVal) : res.data.sources;
console.log("extractedKey",res.data.sources)
//console.log(sources)
console.log("sources",sources)
currentIndex += index[1];
}
this.sources = sources.map((s) => ({
url: s.file,
isM3U8: s.file.includes('.m3u8'),
}));
videoResult.sources.push(...this.sources);
videoResult.sources = [];
this.sources = [];
console.log("this.sources",this.sources)
key = extractedKey;
//console.log("extractedKey", extractedKey)
res.data.sources = sourcesArray.join('');
const decryptedVal = crypto_js_1.default.AES.decrypt(res.data.sources, key).toString(crypto_js_1.default.enc.Utf8);
sources = (0, utils_1.isJson)(decryptedVal) ? JSON.parse(decryptedVal) : res.data.sources;
//console.log("extractedKey", res.data.sources)
//console.log(sources)
console.log("sources", sources)
}
this.sources = sources.map((s) => ({
url: s.file,
isM3U8: s.file.includes('.m3u8'),
}));
videoResult.sources.push(...this.sources);
videoResult.sources = [];
this.sources = [];
//console.log("this.sources", this.sources)
for (const source of sources) {
const { data } = await axios_1.default.get(source.file, options);
const urls = data.split('\n').filter((line) => line.includes('.m3u8'));
const qualities = data.split('\n').filter((line) => line.includes('RESOLUTION='));
const TdArray = qualities.map((s, i) => {
const f1 = s.split('x')[1];
const f2 = urls[i];
return [f1, f2];
for (const source of sources) {
const { data } = await axios_1.default.get(source.file, options);
const urls = data.split('\n').filter((line) => line.includes('.m3u8'));
const qualities = data.split('\n').filter((line) => line.includes('RESOLUTION='));
const TdArray = qualities.map((s, i) => {
const f1 = s.split('x')[1];
const f2 = urls[i];
return [f1, f2];
});
for (const [f1, f2] of TdArray) {
this.sources.push({
url: f2,
quality: f1,
isM3U8: f2.includes('.m3u8'),
});
for (const [f1, f2] of TdArray) {
this.sources.push({
url: f2,
quality: f1,
isM3U8: f2.includes('.m3u8'),
});
}
videoResult.sources.push(...this.sources);
}
videoResult.sources.push({
url: sources[0].file,
isM3U8: sources[0].file.includes('.m3u8'),
quality: 'auto',
});
videoResult.subtiles = res.data.tracks.map((s) => ({
url: s.file,
lang: s.label ? s.label : 'Default (maybe)',
}));
videoResult.sources.push(...this.sources);
}
videoResult.sources.push({
url: sources[0].file,
isM3U8: sources[0].file.includes('.m3u8'),
quality: 'auto',
});
videoResult.subtiles = res.data.tracks.map((s) => ({
url: s.file,
lang: s.label ? s.label : 'Default (maybe)',
}));
return videoResult;

@@ -97,0 +139,0 @@ }

{
"name": "wikiextensions-flix",
"version": "1.7.1",
"version": "1.7.5",
"description": "Nodejs library that provides an Api for obtaining the movies information from FlixHQ website.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc