mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] simplifies nyaa 404 error message
This commit is contained in:
@@ -23,7 +23,13 @@ function torrent(torrentId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return pantsu.infoRequest(torrentId)
|
return pantsu.infoRequest(torrentId)
|
||||||
.then(result => parseTorrent(result));
|
.then(result => parseTorrent(result))
|
||||||
|
.catch(error => {
|
||||||
|
if (error.statusCode && error.statusCode === 404) {
|
||||||
|
return Promise.reject(new Error(`404: [${torrentId}] not found on NyaaPantsu`));
|
||||||
|
}
|
||||||
|
return Promise.reject(error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function search(query) {
|
function search(query) {
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ function torrent(torrentId) {
|
|||||||
|
|
||||||
return si.infoRequest(torrentId)
|
return si.infoRequest(torrentId)
|
||||||
.then(result => parseTorrent(result))
|
.then(result => parseTorrent(result))
|
||||||
.then(result => ({ ...result, torrentId }));
|
.then(result => ({ ...result, torrentId }))
|
||||||
|
.catch(error => {
|
||||||
|
if (error.statusCode && error.statusCode === 404) {
|
||||||
|
return Promise.reject(new Error(`404: [${torrentId}] not found on NyaaSi`));
|
||||||
|
}
|
||||||
|
return Promise.reject(error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function search(query) {
|
function search(query) {
|
||||||
|
|||||||
Reference in New Issue
Block a user