From 9ea008572d7200ec2ef2ebe60448697dae9926a9 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Wed, 8 Apr 2020 16:32:39 +0200 Subject: [PATCH] [scraper] updates hs mapping --- scraper/index.js | 9 ++++++--- scraper/lib/torrentEntries.js | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scraper/index.js b/scraper/index.js index 4a498c5..0ba0816 100644 --- a/scraper/index.js +++ b/scraper/index.js @@ -14,6 +14,8 @@ const thepiratebayDumpScraper = require('./scrapers/thepiratebay/thepiratebay_du const thepiratebayUnofficialDumpScraper = require('./scrapers/thepiratebay/thepiratebay_unofficial_dump_scraper'); const PROVIDERS = [ + // require('./scrapers/thepiratebay/thepiratebay_update_size_scraper') + // require('./scrapers/1337x/1337x_dump_scraper') horribleSubsScraper, rarbgScraper, thepiratebayScraper, @@ -23,8 +25,8 @@ const PROVIDERS = [ // thepiratebayDumpScraper // thepiratebayUnofficialDumpScraper ]; -const SCRAPE_CRON = process.env.SCRAPE_CRON || '0 0 */4 ? * *'; -const SEEDERS_CRON = '*/60 * * ? * *'; +const SCRAPE_CRON = process.env.SCRAPE_CRON || '0 0 */4 ? * *'; // every 4 hours +const SEEDERS_CRON = '0 */2 * ? * *'; // every 2 minutes async function scrape() { return PROVIDERS @@ -41,7 +43,8 @@ async function updateSeeders() { return getUpdateSeedersTorrents() .then(torrents => Promise.all(torrents .map(torrent => PROVIDERS.find(provider => provider.NAME === torrent.provider) - .updateSeeders(torrent)))); + .updateSeeders(torrent)))) + .then(() => console.log('Finished updating seeders')); } function enableScheduling() { diff --git a/scraper/lib/torrentEntries.js b/scraper/lib/torrentEntries.js index 27c419d..391ea25 100644 --- a/scraper/lib/torrentEntries.js +++ b/scraper/lib/torrentEntries.js @@ -63,8 +63,6 @@ async function updateTorrentSeeders(torrent) { .catch(() => undefined) .then(stored => { if (stored) { - console.log( - `Updated seeder for ${torrent.provider} [${torrent.infoHash}] ${torrent.title} from ${stored.seeders} to ${torrent.seeders}`); stored.seeders = torrent.seeders; stored.changed('updatedAt', true); return stored.save()