Closed TheBeastLT closed 5 years ago
you can also use the raw methods provided by the lib.
const {
getRating,
getGenre,
getPro,
getStory,
getTitle,
getRuntime,
getYear,
getEpisodeCount,
getStars,
getSimilarMoviesById
} = require("imdb-scrapper");
const request=require('request')
function scrapper(id) {
return request(`${BASE_URL}/title/${id}/?ref_=nv_sr_1`,{headers:{}})
.then(data => {
const $ = cheerio.load(data);
return {
...getTitle($),
...getRuntime($),
...getYear($),
...getStory($),
...getPro($),
...getGenre($),
...getRating($),
...getPoster($),
...getEpisodeCount($),
...getSimilarMoviesById($)
};
})
.catch(ifError);
}
Is it possible to pass some headers for request that are made to imdb? I'd like to pass a language header in order to get titles in specific language like
'accept-language': 'en-GB'