mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
happy path in mixdrop
This commit is contained in:
@@ -16,12 +16,23 @@ export const mixdropScraper = makeEmbed({
|
||||
const streamRes = await ctx.proxiedFetcher<string>(ctx.url);
|
||||
const packed = streamRes.match(packedRegex);
|
||||
|
||||
if (packed) {
|
||||
// MixDrop uses a queue system for embeds
|
||||
// If an embed is too new, the queue will
|
||||
// not be completed and thus the packed
|
||||
// JavaScript not present
|
||||
if (!packed) {
|
||||
throw new Error('failed to find packed mixdrop JavaScript');
|
||||
}
|
||||
|
||||
const unpacked = unpacker.unpack(packed[1]);
|
||||
const link = unpacked.match(linkRegex);
|
||||
|
||||
if (link) {
|
||||
if (!link) {
|
||||
throw new Error('failed to find packed mixdrop source link');
|
||||
}
|
||||
|
||||
const url = link[1];
|
||||
|
||||
return {
|
||||
stream: {
|
||||
type: 'file',
|
||||
@@ -38,9 +49,5 @@ export const mixdropScraper = makeEmbed({
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('mixdrop source not found');
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user