Skip to content

Commit

Permalink
[CodeFactor] Apply fixes to commit e85f989
Browse files Browse the repository at this point in the history
  • Loading branch information
code-factor committed Sep 21, 2024
1 parent e85f989 commit 008413c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/extractors/streamwish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ class StreamWish extends VideoExtractor {
// Code adapted from Zenda-Cross (https://github.com/Zenda-Cross/vega-app/blob/main/src/lib/providers/multi/multiGetStream.ts)
// Thank you to Zenda-Cross for the original implementation.

var functionRegex =
const functionRegex =
/eval\(function\((.*?)\)\{.*?return p\}.*?\('(.*?)'\.split/;
var match = functionRegex.exec(data);
const match = functionRegex.exec(data);
let p = '';
if (match) {
var params = match[1].split(',').map(param => param.trim());
var encodedString = match[2];
const params = match[1].split(',').map(param => param.trim());
const encodedString = match[2];

p = encodedString.split("',36,")?.[0].trim();
let a = 36;
const a = 36;
let c = encodedString.split("',36,")[1].slice(2).split('|').length;
let k = encodedString.split("',36,")[1].slice(2).split('|');
const k = encodedString.split("',36,")[1].slice(2).split('|');

while (c--) {
if (k[c]) {
var regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g');
const regex = new RegExp('\\b' + c.toString(a) + '\\b', 'g');
p = p.replace(regex, k[c]);
}
}
Expand Down

0 comments on commit 008413c

Please sign in to comment.