mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
fix torrent9 null inforhash error
This commit is contained in:
@@ -103,7 +103,7 @@ function parseTorrentPage(body) {
|
|||||||
const languages = parse(name).languages;
|
const languages = parse(name).languages;
|
||||||
const torrent = {
|
const torrent = {
|
||||||
title: name.trim(),
|
title: name.trim(),
|
||||||
infoHash: decode(magnetLink).infoHash,
|
infoHash: magnetLink ? decode(magnetLink).infoHash : undefined,
|
||||||
magnetLink: magnetLink,
|
magnetLink: magnetLink,
|
||||||
torrentLink: torrentLink ? `${baseUrl}${torrentLink}` : undefined,
|
torrentLink: torrentLink ? `${baseUrl}${torrentLink}` : undefined,
|
||||||
seeders: parseInt(details.find('.movie-information ul:nth-of-type(1) li:nth-of-type(3)').text(), 10),
|
seeders: parseInt(details.find('.movie-information ul:nth-of-type(1) li:nth-of-type(3)').text(), 10),
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ async function processTorrentRecord(client, record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const foundTorrent = await api_limiter.schedule(() => client.torrent(record.torrentId)).catch(() => undefined);
|
const foundTorrent = await api_limiter.schedule(() => client.torrent(record.torrentId)).catch(() => undefined);
|
||||||
if (!foundTorrent) {
|
if (!foundTorrent || !foundTorrent.infoHash) {
|
||||||
console.warn(`Failed retrieving torrent ${record.torrentId}`);
|
console.warn(`Failed retrieving torrent ${record.torrentId}`);
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function parseTorrentPage(body) {
|
|||||||
const languages = parse(name).languages;
|
const languages = parse(name).languages;
|
||||||
const torrent = {
|
const torrent = {
|
||||||
title: name.trim(),
|
title: name.trim(),
|
||||||
infoHash: decode(magnetLink).infoHash,
|
infoHash: magnetLink ? decode(magnetLink).infoHash : undefined,
|
||||||
magnetLink: magnetLink,
|
magnetLink: magnetLink,
|
||||||
seeders: parseInt(details.find('.movie-information ul:nth-of-type(1) li:nth-of-type(3)').text(), 10),
|
seeders: parseInt(details.find('.movie-information ul:nth-of-type(1) li:nth-of-type(3)').text(), 10),
|
||||||
category: details.find('ul:nth-of-type(4) a').attr('href').match(/_(\w+)\.html$/)[1],
|
category: details.find('ul:nth-of-type(4) a').attr('href').match(/_(\w+)\.html$/)[1],
|
||||||
|
|||||||
Reference in New Issue
Block a user