diff --git a/scraper/scrapers/horriblesubs/horriblesubs_api.js b/scraper/scrapers/horriblesubs/horriblesubs_api.js index ad4cdfd..aff3cbb 100644 --- a/scraper/scrapers/horriblesubs/horriblesubs_api.js +++ b/scraper/scrapers/horriblesubs/horriblesubs_api.js @@ -45,13 +45,13 @@ function _getContent(endpoint, config = {},) { ? endpoint.replace(/https?:\/\/[^/]+/, baseUrl) : `${baseUrl}${endpoint}`; - return needle('get', url, { open_timeout: timeout, follow: 2 }) + return needle('get', url, { open_timeout: timeout }) .then((response) => response.body) .then((body) => cheerio.load(body)); } function _getShowId(showEndpoint) { - return _getContent(showEndpoint) + return _getContent(showEndpoint.replace(/(?:#\d+)?\/?$/, '/')) .then($ => $('div.entry-content').find('script').html().match(/var hs_showid = (\d+)/)[1]); }