mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-04-21 15:11:56 +00:00
[scraper] retrieves update seeders torrent order by seeders and upload date
This commit is contained in:
parent
1be9a5f598
commit
129a9ed29d
2 changed files with 7 additions and 3 deletions
|
|
@ -182,8 +182,12 @@ function getTorrentsWithoutSize() {
|
||||||
function getUpdateSeedersTorrents() {
|
function getUpdateSeedersTorrents() {
|
||||||
const until = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
const until = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
||||||
return Torrent.findAll({
|
return Torrent.findAll({
|
||||||
where: literal(`torrent."updatedAt" < \'${until}\' and random() < 0.001`),
|
where: literal(`torrent."updatedAt" < \'${until}\'`),
|
||||||
limit: 100
|
limit: 100,
|
||||||
|
order: [
|
||||||
|
['seeders', 'DESC'],
|
||||||
|
['uploadDate', 'DESC']
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ const { updateTorrentSeeders } = require('../lib/torrentEntries')
|
||||||
|
|
||||||
const DELAY = 15 * 1000; // 15 seconds
|
const DELAY = 15 * 1000; // 15 seconds
|
||||||
const limiter = new Bottleneck({ maxConcurrent: 20, minTime: 250 });
|
const limiter = new Bottleneck({ maxConcurrent: 20, minTime: 250 });
|
||||||
const updateLimiter = new Bottleneck({ maxConcurrent: 20 });
|
const updateLimiter = new Bottleneck({ maxConcurrent: 5 });
|
||||||
const forceSeedersLimiter = new Bottleneck({ maxConcurrent: 5 });
|
const forceSeedersLimiter = new Bottleneck({ maxConcurrent: 5 });
|
||||||
const statistics = {};
|
const statistics = {};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue