diff --git a/scraper/lib/torrent.js b/scraper/lib/torrent.js index f6b29e2..981cb3c 100644 --- a/scraper/lib/torrent.js +++ b/scraper/lib/torrent.js @@ -134,9 +134,9 @@ function filesAndSizeFromTorrentStream(torrent, timeout = 30000) { if (!torrent.infoHash && !torrent.magnetLink) { return Promise.reject(new Error("no infoHash or magnetLink")); } - // const magnet = decode.encode({ infoHash: torrent.infoHash, announce: torrent.trackers }); + const magnet = torrent.magnetLink || decode.encode({ infoHash: torrent.infoHash, announce: torrent.trackers }); return new Promise((resolve, rejected) => { - const engine = new torrentStream(torrent.infoHash, { connections: MAX_PEER_CONNECTIONS }); + const engine = new torrentStream(magnet, { connections: MAX_PEER_CONNECTIONS }); engine.ready(() => { const files = engine.files diff --git a/scraper/scrapers/rutor/rutor_api.js b/scraper/scrapers/rutor/rutor_api.js index 63dfbd8..374310c 100644 --- a/scraper/scrapers/rutor/rutor_api.js +++ b/scraper/scrapers/rutor/rutor_api.js @@ -86,8 +86,8 @@ function parseTableBody(body) { magnetLink: magnetLink, torrentLink: $(links[0]).attr('href'), torrentId: $(links[2]).attr('href').match(/torrent\/(\d+)/)[1], - seeds: parseInt(peers.find('.green').text()), - leaches: parseInt(peers.find('.red').text()), + seeders: parseInt(peers.find('.green').text()), + leechers: parseInt(peers.find('.red').text()), uploadDate: parseRussianDate($(row[0]).text()), size: $(row[row.length - 2]).html().replace(' ', ' '), }