[scraper] updates stream info mapping

This commit is contained in:
TheBeastLT
2020-04-05 21:42:44 +02:00
parent eb23968452
commit 5f81cded75
4 changed files with 37 additions and 44 deletions

View File

@@ -81,7 +81,11 @@ function filterByProvider(streams, providers) {
if (!providers || !providers.length) {
return streams;
}
return streams.filter(stream => providers.includes(stream.name.split('\n')[1].toLowerCase()))
return streams.filter(stream => {
const parts = stream.title.split('\n');
const provider = parts[parts.length - 2].match(/\w+$/)[0];
return providers.includes(provider.toLowerCase());
})
}
module.exports = builder.getInterface();