Merge pull request #90 from movie-web/fix/vidplay-cached-keys

Fix Vidplay cached keys
This commit is contained in:
mrjvs 2024-02-03 14:25:54 +01:00 committed by GitHub
commit 06dcde8036
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -9,8 +9,12 @@ export const referer = `${vidplayBase}/`;
// Full credits to @Ciarands!
export const getDecryptionKeys = async (ctx: EmbedScrapeContext): Promise<string[]> => {
const res = await ctx.fetcher<string>('https://raw.githubusercontent.com/Ciarands/vidsrc-keys/main/keys.json');
return JSON.parse(res);
const res = await ctx.proxiedFetcher<string>('https://github.com/Ciarands/vidsrc-keys/blob/main/keys.json');
const regex = /"rawLines":\s*\[([\s\S]*?)\]/;
const rawLines = res.match(regex)?.[1];
if (!rawLines) throw new Error('No keys found');
const keys = JSON.parse(`${rawLines.substring(1).replace(/\\"/g, '"')}]`);
return keys;
};
export const getEncodedId = async (ctx: EmbedScrapeContext) => {