node-csfd-api
Advanced tools
Comparing version 1.1.0-alpha.1 to 1.1.0-alpha.3
@@ -9,5 +9,14 @@ "use strict"; | ||
const vars_1 = require("../vars"); | ||
const USER_AGENTS = [ | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', | ||
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1', | ||
'Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36', | ||
'Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36' | ||
]; | ||
const headers = { | ||
'User-Agent': USER_AGENTS[Math.floor(Math.random() * USER_AGENTS.length)] | ||
}; | ||
const fetchUserRatings = async (user, page) => { | ||
const url = vars_1.userRatingsUrl(user, page); | ||
const response = await cross_fetch_1.default(url); | ||
const response = await cross_fetch_1.default(url, { headers }); | ||
return await response.text(); | ||
@@ -18,5 +27,5 @@ }; | ||
const url = vars_1.movieUrl(+movieId); | ||
const response = await cross_fetch_1.default(url); | ||
const response = await cross_fetch_1.default(url, { headers }); | ||
return await response.text(); | ||
}; | ||
exports.fetchMovie = fetchMovie; |
{ | ||
"name": "node-csfd-api", | ||
"version": "1.1.0-alpha.1", | ||
"version": "1.1.0-alpha.3", | ||
"description": "Simple NPM library for scraping CSFD", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30255
570