mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-04-19 21:32:02 +00:00
[scraper] fix single torrent seeders update
This commit is contained in:
parent
9c4bd3604e
commit
3f6515fbfa
1 changed files with 4 additions and 3 deletions
|
|
@ -43,9 +43,10 @@ async function updateCurrentSeeders(torrentsInput) {
|
|||
setTimeout(callback, SEEDS_CHECK_TIMEOUT);
|
||||
|
||||
async.each(Object.keys(perTrackerInfoHashes), function (tracker, ready) {
|
||||
BTClient.scrape({ infoHash: perTrackerInfoHashes[tracker], announce: tracker }, (error, results) => {
|
||||
if (results) {
|
||||
Object.entries(results)
|
||||
BTClient.scrape({ infoHash: perTrackerInfoHashes[tracker], announce: tracker }, (error, response) => {
|
||||
if (response) {
|
||||
const results = Array.isArray(torrentsInput) ? Object.entries(response) : [[response.infoHash, response]];
|
||||
results
|
||||
.filter(([infoHash]) => perTorrentResults[infoHash])
|
||||
.forEach(([infoHash, seeders]) =>
|
||||
perTorrentResults[infoHash][tracker] = [seeders.complete, seeders.incomplete])
|
||||
|
|
|
|||
Loading…
Reference in a new issue