mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
23 lines
541 B
JavaScript
23 lines
541 B
JavaScript
const realdebrid = require('./realdebrid');
|
|
|
|
const MOCHS = {
|
|
'realdebrid': realdebrid
|
|
};
|
|
|
|
async function applyMochs(streams, config) {
|
|
if (!streams || !streams.length) {
|
|
return streams;
|
|
}
|
|
|
|
return Object.keys(config)
|
|
.filter(configKey => MOCHS[configKey])
|
|
.reduce(async (streams, moch) => {
|
|
return await MOCHS[moch].applyMoch(streams, config[moch])
|
|
.catch(error => {
|
|
console.warn(error);
|
|
return streams;
|
|
});
|
|
}, streams);
|
|
}
|
|
|
|
module.exports = applyMochs; |