fix(core): torrent searching error (#9407)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
parent
cd91931876
commit
95db3b4e99
|
|
@ -60,6 +60,7 @@ class HDHome extends TorrentProvider {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
TorrentSearchApi.loadProvider(HDHome);
|
||||
|
||||
const allProviders = ['HDHome', 'Rarbg', '1337x', 'Yts', 'Eztv'];
|
||||
|
|
@ -119,7 +120,14 @@ module.exports = {
|
|||
|
||||
const keyword = keywords[0];
|
||||
const normalizeKeyword = normalize(keyword);
|
||||
const torrents = await TorrentSearchApi.search(providers, keywords.join(' '), category);
|
||||
let torrents;
|
||||
try {
|
||||
torrents = await TorrentSearchApi.search(providers, keywords.join(' '), category);
|
||||
} catch (e) {
|
||||
// expect a status code error, but we don't mind catching all errors here
|
||||
// logger.debug(e);
|
||||
return {};
|
||||
}
|
||||
if (torrents && torrents.length > 0) {
|
||||
let bestRating = 0;
|
||||
let bestSize = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue