diff --git a/lib/utils/torrent.js b/lib/utils/torrent.js index a57562d6d..099ebaa45 100644 --- a/lib/utils/torrent.js +++ b/lib/utils/torrent.js @@ -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;