fix(core): torrent searching error (#9407)

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
Rongrong 2022-03-29 21:12:16 +08:00 committed by GitHub
parent cd91931876
commit 95db3b4e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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;