[addon] filter realdebrid cached entries to contain ony videos

This commit is contained in:
TheBeastLT
2020-03-17 16:29:36 +01:00
parent ea0250c910
commit 727c763e43
4 changed files with 48 additions and 15 deletions

22
addon/lib/video.js Normal file
View File

@@ -0,0 +1,22 @@
const EXTENSIONS = [
"3g2",
"3gp",
"avi",
"flv",
"mkv",
"mov",
"mp2",
"mp4",
"mpe",
"mpeg",
"mpg",
"mpv",
"webm",
"wmv",
"ogm"
];
module.exports = (filename) => {
const extensionMatch = filename.match(/\.(\w{2,4})$/);
return extensionMatch && EXTENSIONS.includes(extensionMatch[1].toLowerCase());
};