mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-03-11 17:15:37 +00:00
[scraper] fixes hs api to not use redirects due to node hotfix
This commit is contained in:
parent
50aa4d4f1e
commit
9dba42ebfe
1 changed files with 2 additions and 2 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue