mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] adds update seeders cron
This commit is contained in:
@@ -7,6 +7,7 @@ const repository = require('../../lib/repository');
|
||||
const { Type } = require('../../lib/types');
|
||||
const { updateCurrentSeeders, updateTorrentSize } = require('../../lib/torrent');
|
||||
const { parseTorrentFiles } = require('../../lib/torrentFiles');
|
||||
const { updateTorrentSeeders } = require('../../lib/torrentEntries');
|
||||
const { getMetadata, getKitsuId } = require('../../lib/metadata');
|
||||
const showMappings = require('./horriblesubs_mapping.json');
|
||||
|
||||
@@ -36,6 +37,11 @@ async function scrape() {
|
||||
}
|
||||
}
|
||||
|
||||
async function updateSeeders(torrent) {
|
||||
return entryLimiter.schedule(() => updateCurrentSeeders(torrent)
|
||||
.then(updated => updateTorrentSeeders(updated)));
|
||||
}
|
||||
|
||||
async function _scrapeLatestEntries() {
|
||||
const latestEntries = await horriblesubs.getLatestEntries();
|
||||
|
||||
@@ -209,4 +215,4 @@ async function checkIfExists(torrent) {
|
||||
return { ...torrent, size: existingTorrent.size, seeders: existingTorrent.seeders };
|
||||
}
|
||||
|
||||
module.exports = { scrape, NAME };
|
||||
module.exports = { scrape, updateSeeders, NAME };
|
||||
Reference in New Issue
Block a user