[scraper] disables imdb id seeders update for eztv

This commit is contained in:
TheBeastLT
2020-09-18 21:19:42 +02:00
parent fe6f92bb31
commit a7b23a1313
2 changed files with 11 additions and 6 deletions

View File

@@ -15,8 +15,12 @@ const statistics = {};
function scheduleUpdateSeeders() {
console.log('Starting seeders update...')
return repository.getUpdateSeedersTorrents()
.then(torrents => Promise.all(torrents.map(torrent => limiter.schedule(() =>
timeout(TIMEOUT_MS, _updateSeeders(torrent), `Failed [${torrent.infoHash}] torrent seeders update`)))))
.then(torrents => Promise.all(torrents.map(torrent => limiter
.schedule(() => timeout(TIMEOUT_MS, _updateSeeders(torrent)))
.catch(error => {
console.log(`Failed [${torrent.infoHash}] ${torrent.title} seeders update: `, error);
return []
}))))
.then(torrents => updateStatistics(torrents))
.then(() => console.log('Finished seeders update:', statistics))
.catch(error => console.warn('Failed seeders update:', error))

View File

@@ -25,10 +25,11 @@ async function scrape() {
}
async function updateSeeders(torrent, getImdbIdsMethod) {
return getImdbIdsMethod()
.then(imdbIds => Promise.all(imdbIds.map(imdbId => limiter.schedule(() => eztv.search(imdbId)))))
.then(results => results.reduce((a, b) => a.concat(b), []))
.catch(() => limiter.schedule(() => eztv.torrent(torrent.torrentId)));
// return getImdbIdsMethod()
// .then(imdbIds => Promise.all(imdbIds.map(imdbId => limiter.schedule(() => eztv.search(imdbId)))))
// .then(results => results.reduce((a, b) => a.concat(b), []))
// .catch(() => limiter.schedule(() => eztv.torrent(torrent.torrentId)));
return limiter.schedule(() => eztv.torrent(torrent.torrentId));
}
async function scrapeLatestTorrents() {