mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-04-20 22:32:05 +00:00
[scraper] fix rutor list seeders
This commit is contained in:
parent
3f6515fbfa
commit
e7d0c2b620
2 changed files with 4 additions and 4 deletions
|
|
@ -134,9 +134,9 @@ function filesAndSizeFromTorrentStream(torrent, timeout = 30000) {
|
||||||
if (!torrent.infoHash && !torrent.magnetLink) {
|
if (!torrent.infoHash && !torrent.magnetLink) {
|
||||||
return Promise.reject(new Error("no infoHash or 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) => {
|
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(() => {
|
engine.ready(() => {
|
||||||
const files = engine.files
|
const files = engine.files
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ function parseTableBody(body) {
|
||||||
magnetLink: magnetLink,
|
magnetLink: magnetLink,
|
||||||
torrentLink: $(links[0]).attr('href'),
|
torrentLink: $(links[0]).attr('href'),
|
||||||
torrentId: $(links[2]).attr('href').match(/torrent\/(\d+)/)[1],
|
torrentId: $(links[2]).attr('href').match(/torrent\/(\d+)/)[1],
|
||||||
seeds: parseInt(peers.find('.green').text()),
|
seeders: parseInt(peers.find('.green').text()),
|
||||||
leaches: parseInt(peers.find('.red').text()),
|
leechers: parseInt(peers.find('.red').text()),
|
||||||
uploadDate: parseRussianDate($(row[0]).text()),
|
uploadDate: parseRussianDate($(row[0]).text()),
|
||||||
size: $(row[row.length - 2]).html().replace(' ', ' '),
|
size: $(row[row.length - 2]).html().replace(' ', ' '),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue