Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Commit

Permalink
bla bla bla
Browse files Browse the repository at this point in the history
---
fix for downloads
  • Loading branch information
lap00zza committed Nov 27, 2017
1 parent 9221263 commit 548a0e1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
46 changes: 40 additions & 6 deletions src/lib/download_all/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export function setup(options: ISetupOptions): void {
// helping out with decryptTs and rot8.
const decryptTs = (str: string) => {
let result = "";
const firstCharMap: string[] = [];
const secondCharMap: string[] = [];
const firstCharMap = [];
const secondCharMap = [];
for (let n = 65; n < 91; n++) {
firstCharMap.push(String.fromCharCode(n));
if (n % 2 !== 0) {
Expand Down Expand Up @@ -123,7 +123,41 @@ const decryptTs = (str: string) => {
return atob(result);
};

const rot8 = (str: string) => {
function decryptTokenAndOptions(str: string) { /* line: 14138, all.js */
const cleanStr = str.replace(/^-/, "");
const firstCharMap = [];
const secondCharMap = [];
for (let j = 97; j <= 122; j++) {
firstCharMap.push(String.fromCharCode(j));
if (j % 2) {
secondCharMap.push(String.fromCharCode(j));
}
}
for (let k = 97; k <= 122; k++) {
if (k % 2 === 0) {
secondCharMap.push(String.fromCharCode(k));
}
}
/* --- */
let result = "";
for (let e = 0; e < cleanStr.length; e++) {
let replaced = false;
for (let f = 0; f < secondCharMap.length; f++) {
if (cleanStr[e] === secondCharMap[f]) {
result += firstCharMap[f];
replaced = true;
break;
}
}
if (!replaced) {
result += cleanStr[e];
}
}
/* --- */
return atob(result);
}

/*const rot8 = (str: string) => {
const i = -18;
const e = [];
for (let q = 1; q < str.length; q++) {
Expand All @@ -141,7 +175,7 @@ const rot8 = (str: string) => {
return e
.map(c => String.fromCharCode(c))
.join("");
};
};*/
/* --- ~~~ --- */

/**
Expand Down Expand Up @@ -264,8 +298,8 @@ function getLinks9a(data: api.IGrabber): void {
.links9a(data.grabber, {
id: data.params.id,
mobile: 0,
options: rot8(data.params.options),
token: rot8(data.params.token),
options: decryptTokenAndOptions(data.params.options),
token: decryptTokenAndOptions(data.params.token),
ts: decryptTs(ts),
})
.then(resp => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/download_all/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export function setup(options: ISetupOptions) {
$(s).append(downloadBtn(Server.Default));
} else if (/Server\s+G/i.test(serverLabel)) {
$(s).append(downloadBtn(Server.Default));
} else if (/RapidVideo/i.test(serverLabel)) {
} /*else if (/RapidVideo/i.test(serverLabel)) {
$(s).append(downloadBtn(Server.RapidVideo));
}
}*/
}
}

Expand Down

0 comments on commit 548a0e1

Please sign in to comment.