Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] option to randomize user-agent using random or a secrets standard lib modules #1

Open
AkechiShiro opened this issue Oct 6, 2023 · 2 comments

Comments

@AkechiShiro
Copy link

Hi @ajuelosemmanuel

If the user-agent tends to get banned, as you mentioned in the README troubleshooting section, wouldn't it be better to set a different user-agent every time (with an option) instead of hard-coding it ?

Maybe using Faker, I could try to do a PR in order to introduce this new option.

@AkechiShiro AkechiShiro changed the title [Feature request] option to randomize user-agent using [Faker](https://faker.readthedocs.io/en/master/) or a random string [Feature request] option to randomize user-agent using Faker or a random string Oct 6, 2023
@ajuelosemmanuel
Copy link
Owner

Hi @ajuelosemmanuel

If the user-agent tends to get banned, as you mentioned in the README troubleshooting section, wouldn't it be better to set a different user-agent every time (with an option) instead of hard-coding it ?

Maybe using Faker, I could try to do a PR in order to introduce this new option.

Hi,

I'll add a user agent string, as I don't want to add too many libraries.

If you think you could help me doing it, I'll gladly appreciate it.

Thank you very much for your feedback !

@AkechiShiro
Copy link
Author

AkechiShiro commented Oct 6, 2023

We can use pseudo random generation random in the standard lib, then or secrets which is better for more random security value generation.

Both do not need any new dependencies installed.

I don't think the user-agent should be generated using the secrets module, random should be enough, as it is not a sensible value as a secret and using random with a predefined seed, would allow to have deterministic user-agent in case debugging an issue/or leaving traceable logs is needed.

@AkechiShiro AkechiShiro changed the title [Feature request] option to randomize user-agent using Faker or a random string [Feature request] option to randomize user-agent using random or a secrets standard lib modules Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants