mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-16 17:11:52 +00:00
fix torrent9 scraper
This commit is contained in:
parent
a4eb290871
commit
01337005de
2 changed files with 3 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ const { parse } = require('parse-torrent-title');
|
||||||
const { getRandomUserAgent } = require('../../lib/requestHelper');
|
const { getRandomUserAgent } = require('../../lib/requestHelper');
|
||||||
const { parseSize } = require("../scraperHelper");
|
const { parseSize } = require("../scraperHelper");
|
||||||
|
|
||||||
const baseUrl = 'https://www.torrent9.pw'
|
const baseUrl = 'https://torrent9.nl'
|
||||||
const defaultTimeout = 10000;
|
const defaultTimeout = 10000;
|
||||||
const pageSize = 50;
|
const pageSize = 50;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const Bottleneck = require('bottleneck');
|
const Bottleneck = require('bottleneck');
|
||||||
const torrent9 = require('./torrent9_api');
|
const torrent9 = require('./torrent9_api');
|
||||||
const torrent9v2 = require('./torrent9v2_api');
|
|
||||||
const { Type } = require('../../lib/types');
|
const { Type } = require('../../lib/types');
|
||||||
const repository = require('../../lib/repository');
|
const repository = require('../../lib/repository');
|
||||||
const Promises = require('../../lib/promises');
|
const Promises = require('../../lib/promises');
|
||||||
const { createTorrentEntry, checkAndUpdateTorrent } = require('../../lib/torrentEntries');
|
const { createTorrentEntry, checkAndUpdateTorrent } = require('../../lib/torrentEntries');
|
||||||
const { Op } = require("sequelize");
|
|
||||||
|
|
||||||
const NAME = 'Torrent9';
|
const NAME = 'Torrent9';
|
||||||
const TYPE_MAPPING = typeMapping();
|
const TYPE_MAPPING = typeMapping();
|
||||||
|
|
@ -18,8 +16,7 @@ const allowedCategories = [
|
||||||
torrent9.Categories.TV,
|
torrent9.Categories.TV,
|
||||||
];
|
];
|
||||||
const clients = [
|
const clients = [
|
||||||
torrent9,
|
torrent9
|
||||||
torrent9v2
|
|
||||||
];
|
];
|
||||||
|
|
||||||
async function scrape() {
|
async function scrape() {
|
||||||
|
|
@ -57,8 +54,7 @@ async function scrapeLatestTorrentsForCategory(client, category, page = 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function processTorrentRecord(client, record) {
|
async function processTorrentRecord(client, record) {
|
||||||
if (await checkAndUpdateTorrent(
|
if (await checkAndUpdateTorrent({ provider: NAME, torrentId: record.torrentId })) {
|
||||||
{ provider: NAME, torrentId: { [Op.endsWith]: record.torrentId.replace(/^\d+/, '') } })) {
|
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue