amazon-buddy
Advanced tools
Comparing version 2.2.35 to 2.2.36
@@ -37,2 +37,3 @@ // @ts-nocheck | ||
reviewFilter, | ||
referer, | ||
}) { | ||
@@ -67,2 +68,3 @@ this.asyncTasks = asyncTasks; | ||
}; | ||
this.referer = referer; | ||
this.fileType = filetype; | ||
@@ -106,2 +108,6 @@ this.jsonToCsv = new Parser({ flatten: true }); | ||
/** | ||
* Get proxy method | ||
* {this.proxy} should an array of proxies | ||
*/ | ||
get getProxy() { | ||
@@ -114,3 +120,16 @@ if (Array.isArray(this.proxy)) { | ||
} | ||
/** | ||
* Get referer method | ||
* {this.referer} should an array of referers | ||
*/ | ||
get getReferer() { | ||
if (Array.isArray(this.referer)) { | ||
return this.referer[Math.floor(Math.random() * this.referer.length)]; | ||
} | ||
return ''; | ||
} | ||
/** | ||
* Main request method | ||
@@ -134,3 +153,3 @@ * @param {*} param0 | ||
'accept-encoding': 'gzip, deflate, br', | ||
//referer: this.mainHost, | ||
...(this.getReferer ? { referer: this.getReferer } : {}), | ||
...(Math.round(Math.random()) ? { downlink: Math.floor(Math.random() * 30) + 10 } : {}), | ||
@@ -137,0 +156,0 @@ ...(Math.round(Math.random()) ? { rtt: Math.floor(Math.random() * 100) + 50 } : {}), |
{ | ||
"name": "amazon-buddy", | ||
"version": "2.2.35", | ||
"version": "2.2.36", | ||
"description": "Amazon Scraper. You can scrape products from amazon search result and you can also scrape reviews from a specific product", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
164029
2687