mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:43:26 +00:00
add disabled embed filter
This commit is contained in:
@@ -58,6 +58,14 @@ export async function scrapeInvidualSource(
|
||||
}
|
||||
|
||||
if (!output) throw new Error('output is null');
|
||||
|
||||
// filter output with only valid embeds that are not disabled
|
||||
output.embeds = output.embeds.filter((embed) => {
|
||||
const e = list.embeds.find((v) => v.id === embed.embedId);
|
||||
if (!e || e.disabled) return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
if ((!output.stream || output.stream.length === 0) && output.embeds.length === 0)
|
||||
throw new NotFoundError('No streams found');
|
||||
return output;
|
||||
|
Reference in New Issue
Block a user