feat: add support for multiple browser user agents #547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added the ability to define a pool of many browser user agents in the environment file.
On each request a random user agent will get used from the defined pool.
The idea is to keep the bot more anonymized and harder to detect by having many user agents instead of just one.
It would be better to have each user agent separated by a line break, but sadly the version of dotenv doesn't support it yet?
Supported in:
https://github.com/bkeepers/dotenv#multi-line-values
But not in:
https://github.com/motdotla/dotenv
Example source for common user agents:
https://developers.whatismybrowser.com/useragents/explore/
NOTICE
Breaking change duo to rename from USER_AGENT to USER_AGENTS in env file!
Maybe this feature could create an additional entry instead of rename or just use old name.
Testing
New dependencies