mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-20 23:58:02 +08:00
fix(core): torrent searching error (#9407)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user