mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 14:53:24 +00:00
fix keys being cached for 5 minutes
This commit is contained in:
@@ -9,8 +9,12 @@ export const referer = `${vidplayBase}/`;
|
|||||||
// Full credits to @Ciarands!
|
// Full credits to @Ciarands!
|
||||||
|
|
||||||
export const getDecryptionKeys = async (ctx: EmbedScrapeContext): Promise<string[]> => {
|
export const getDecryptionKeys = async (ctx: EmbedScrapeContext): Promise<string[]> => {
|
||||||
const res = await ctx.fetcher<string>('https://raw.githubusercontent.com/Ciarands/vidsrc-keys/main/keys.json');
|
const res = await ctx.fetcher<string>('https://github.com/Ciarands/vidsrc-keys/blob/main/keys.json');
|
||||||
return JSON.parse(res);
|
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) => {
|
export const getEncodedId = async (ctx: EmbedScrapeContext) => {
|
||||||
|
Reference in New Issue
Block a user