fix filemoon

This commit is contained in:
TPN 2024-04-01 12:00:36 +00:00
parent 1e66b0b7e3
commit 7e5d06434d
2 changed files with 12623 additions and 1 deletions

12620
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
import { load } from 'cheerio';
import { unpack } from 'unpacker';
import { flags } from '@/entrypoint/utils/targets';
@ -19,7 +20,8 @@ export const fileMoonScraper = makeEmbed({
referer: ctx.url,
},
});
const evalCode = embedRes.match(evalCodeRegex);
const embedHtml = load(embedRes);
const evalCode = embedHtml('script').text().match(evalCodeRegex);
if (!evalCode) throw new Error('Failed to find eval code');
const unpacked = unpack(evalCode[1]);
const file = fileRegex.exec(unpacked);