diff --git a/scraper/lib/torrent.js b/scraper/lib/torrent.js index a69656d..3aa669c 100644 --- a/scraper/lib/torrent.js +++ b/scraper/lib/torrent.js @@ -130,6 +130,9 @@ function filesAndSizeFromTorrentStream(torrent, timeout = 30000) { } function filterVideos(files) { + if (files.length === 1 && !Number.isInteger(files[0].fileIndex)) { + return files; + } const videos = files.filter(file => isVideo(file.path)); const maxSize = Math.max(...videos.map(video => video.size)); const minSampleRatio = videos.length <= 3 ? 5 : 10; diff --git a/scraper/manual/manual.js b/scraper/manual/manual.js index f4637c0..f2fb32f 100644 --- a/scraper/manual/manual.js +++ b/scraper/manual/manual.js @@ -71,7 +71,13 @@ async function reapplyEpisodeDecomposing(infoHash, includeSourceFiles = true) { const kitsuId = undefined; const imdbId = kitsuId ? undefined - : mostCommonValue(storedFiles.map(file => file.imdbId)) || await getImdbId(parse(torrent.title)); + : mostCommonValue(storedFiles.map(file => file.imdbId)) + || await getImdbId(parse(torrent.title)).catch(() => undefined); + + if (!imdbId && !kitsuId) { + console.log(`imdbId or kitsuId not found: ${torrent.provider} ${torrent.title}`); + return Promise.resolve(); + } return parseTorrentFiles({ ...torrent.get(), imdbId, kitsuId, files }) .then(torrentContents => torrentContents.videos)