[scraper] add rutor scraper

This commit is contained in:
TheBeastLT
2021-02-15 12:38:43 +01:00
parent 0dac049107
commit e20ed50f17
8 changed files with 337 additions and 10 deletions

View File

@@ -95,9 +95,12 @@ async function torrentFiles(torrent, timeout) {
}
function getFilesFromObject(torrent) {
if (torrent.files && torrent.files.length) {
if (Array.isArray(torrent.files)) {
return Promise.resolve(torrent.files);
}
if (typeof torrent.files === 'function') {
return torrent.files();
}
return Promise.reject("No files in the object");
}