mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] fixes to not use eztv imdb id for talk shows
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const Bottleneck = require('bottleneck');
|
const Bottleneck = require('bottleneck');
|
||||||
|
const { parse } = require('parse-torrent-title');
|
||||||
const eztv = require('./eztv_api');
|
const eztv = require('./eztv_api');
|
||||||
const { Type } = require('../../lib/types');
|
const { Type } = require('../../lib/types');
|
||||||
const repository = require('../../lib/repository');
|
const repository = require('../../lib/repository');
|
||||||
@@ -59,6 +60,10 @@ async function processTorrentRecord(record) {
|
|||||||
return Promise.resolve('Invalid torrent record');
|
return Promise.resolve('Invalid torrent record');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// imdb id for talk shows is usually incorrect on eztv
|
||||||
|
const parsedTitle = parse(record.name);
|
||||||
|
const dateEpisode = !parsedTitle.season && parsedTitle.date;
|
||||||
|
|
||||||
const torrent = {
|
const torrent = {
|
||||||
infoHash: record.infoHash,
|
infoHash: record.infoHash,
|
||||||
provider: NAME,
|
provider: NAME,
|
||||||
@@ -68,7 +73,7 @@ async function processTorrentRecord(record) {
|
|||||||
size: record.size,
|
size: record.size,
|
||||||
seeders: record.seeders,
|
seeders: record.seeders,
|
||||||
uploadDate: record.uploadDate,
|
uploadDate: record.uploadDate,
|
||||||
imdbId: record.imdbId,
|
imdbId: !dateEpisode && record.imdbId,
|
||||||
};
|
};
|
||||||
|
|
||||||
return createTorrentEntry(torrent).then(() => torrent);
|
return createTorrentEntry(torrent).then(() => torrent);
|
||||||
|
|||||||
Reference in New Issue
Block a user