mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] adds a warning if horriblesubs episode is out of mapped bounds
This commit is contained in:
@@ -13,12 +13,12 @@ const thepiratebayDumpScraper = require('./scrapers/thepiratebay/thepiratebay_du
|
|||||||
const thepiratebayUnofficialDumpScraper = require('./scrapers/thepiratebay/thepiratebay_unofficial_dump_scraper');
|
const thepiratebayUnofficialDumpScraper = require('./scrapers/thepiratebay/thepiratebay_unofficial_dump_scraper');
|
||||||
|
|
||||||
const PROVIDERS = [
|
const PROVIDERS = [
|
||||||
// horribleSubsScraper,
|
horribleSubsScraper,
|
||||||
// rarbgScraper,
|
rarbgScraper,
|
||||||
// thepiratebayScraper,
|
thepiratebayScraper,
|
||||||
// kickassScraper,
|
kickassScraper,
|
||||||
// leetxScraper
|
leetxScraper
|
||||||
rarbgDumpScraper
|
// rarbgDumpScraper
|
||||||
];
|
];
|
||||||
const SCRAPE_CRON = process.env.SCRAPE_CRON || '* * 0/4 * * *';
|
const SCRAPE_CRON = process.env.SCRAPE_CRON || '* * 0/4 * * *';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const { parse } = require('parse-torrent-title');
|
const { parse } = require('parse-torrent-title');
|
||||||
const { torrentFiles } = require('../lib/torrent');
|
const { torrentFiles } = require('../lib/torrent');
|
||||||
const { escapeTitle, getMetadata, getImdbId } = require('../lib/metadata');
|
const { getMetadata, getImdbId } = require('../lib/metadata');
|
||||||
const { Type } = require('./types');
|
const { Type } = require('./types');
|
||||||
|
|
||||||
const MIN_SIZE = 10 * 1024 * 1024; // 10 MB
|
const MIN_SIZE = 10 * 1024 * 1024; // 10 MB
|
||||||
@@ -16,7 +16,7 @@ async function parseTorrentFiles(torrent) {
|
|||||||
// throw new Error(`Mismatching entry type for ${torrent.name}: ${torrent.type}!=${metadata.type}`);
|
// throw new Error(`Mismatching entry type for ${torrent.name}: ${torrent.type}!=${metadata.type}`);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (torrent.type === Type.MOVIE && !parsedTorrentName.seasons || metadata.type === Type.MOVIE) {
|
if (torrent.type === Type.MOVIE && !parsedTorrentName.seasons || metadata && metadata.type === Type.MOVIE) {
|
||||||
if (parsedTorrentName.complete) {
|
if (parsedTorrentName.complete) {
|
||||||
return torrentFiles(torrent)
|
return torrentFiles(torrent)
|
||||||
.then(files => files.filter(file => file.size > MIN_SIZE))
|
.then(files => files.filter(file => file.size > MIN_SIZE))
|
||||||
|
|||||||
@@ -131,7 +131,13 @@ async function _parseShowData(showData) {
|
|||||||
const getKitsuId = inputEpisode => {
|
const getKitsuId = inputEpisode => {
|
||||||
const episodeString = inputEpisode.includes('-') && inputEpisode.split('-')[0] || inputEpisode;
|
const episodeString = inputEpisode.includes('-') && inputEpisode.split('-')[0] || inputEpisode;
|
||||||
const episode = parseInt(episodeString, 10);
|
const episode = parseInt(episodeString, 10);
|
||||||
return kitsuIdsMapping[episode] && kitsuIdsMapping[episode].kitsuId || kitsuId;
|
if (kitsuIdsMapping[episode]) {
|
||||||
|
return kitsuIdsMapping[episode].kitsuId;
|
||||||
|
} else if (Array.isArray(kitsuId)) {
|
||||||
|
console.warn(`Unmapped episode number for ${showData.title} - ${inputEpisode}`);
|
||||||
|
return kitsuId[kitsuId.length - 1];
|
||||||
|
}
|
||||||
|
return kitsuId;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Promise.all([].concat(showData.singleEpisodes).concat(showData.packEpisodes)
|
return Promise.all([].concat(showData.singleEpisodes).concat(showData.packEpisodes)
|
||||||
|
|||||||
Reference in New Issue
Block a user