mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] rework scraper scheduling and added seeders updating
This commit is contained in:
@@ -33,7 +33,7 @@ function search(imdbId, config = {}, retries = 2) {
|
||||
return Promises.first(defaultProxies
|
||||
.map(proxyUrl => singleRequest(`${proxyUrl}/api/get-torrents?limit=${limit}&page=${page}&imdb_id=${id}`, config)))
|
||||
.then(results => parseResults(results))
|
||||
.then(torrents => torrents.length === limit && page < maxPage
|
||||
.then(torrents => torrents.length === limit && page < maxPage && !torrents.find(t => t.imdbId === imdbId)
|
||||
? search(imdbId, { ...config, page: page + 1 })
|
||||
.catch(() => [])
|
||||
.then(nextTorrents => torrents.concat(nextTorrents))
|
||||
|
||||
Reference in New Issue
Block a user