diff --git a/scraper/scrapers/thepiratebay/thepiratebay_api.js b/scraper/scrapers/thepiratebay/thepiratebay_api.js index f5921b2..f5114a5 100644 --- a/scraper/scrapers/thepiratebay/thepiratebay_api.js +++ b/scraper/scrapers/thepiratebay/thepiratebay_api.js @@ -117,7 +117,7 @@ function toTorrent(result) { name: escapeHTML(result.name), infoHash: result.info_hash.toLowerCase(), size: parseInt(result.size), - // seeders: parseInt(result.seeders), + seeders: parseInt(result.seeders), leechers: parseInt(result.leechers), subcategory: parseInt(result.category), uploadDate: new Date(result.added * 1000), diff --git a/scraper/scrapers/thepiratebay/thepiratebay_scraper.js b/scraper/scrapers/thepiratebay/thepiratebay_scraper.js index 1dee06e..ac52a35 100644 --- a/scraper/scrapers/thepiratebay/thepiratebay_scraper.js +++ b/scraper/scrapers/thepiratebay/thepiratebay_scraper.js @@ -4,13 +4,12 @@ const thepiratebay = require('./thepiratebay_api.js'); const { Type } = require('../../lib/types'); const repository = require('../../lib/repository'); const Promises = require('../../lib/promises'); -const { updateCurrentSeeders } = require('../../lib/torrent'); const { createTorrentEntry, checkAndUpdateTorrent } = require('../../lib/torrentEntries'); const NAME = 'ThePirateBay'; const UNTIL_PAGE = 5; -const limiter = new Bottleneck({ maxConcurrent: 5 }); +const limiter = new Bottleneck({ maxConcurrent: 10 }); const allowedCategories = [ thepiratebay.Categories.VIDEO.MOVIES, @@ -38,8 +37,7 @@ async function scrape() { } async function updateSeeders(torrent) { - // return limiter.schedule(() => thepiratebay.torrent(torrent.torrentId)); - return Promise.resolve([]); + return limiter.schedule(() => thepiratebay.torrent(torrent.torrentId)); } async function scrapeLatestTorrents() { @@ -68,9 +66,6 @@ async function processTorrentRecord(record) { if (!record || !allowedCategories.includes(record.subcategory)) { return Promise.resolve('Invalid torrent record'); } - if (record.seeders === null || record.seeders === undefined) { - await updateCurrentSeeders(record); - } const torrent = { infoHash: record.infoHash,