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

Add random fake user agent. #1053

Closed
wants to merge 3 commits into from
Closed

Add random fake user agent. #1053

wants to merge 3 commits into from

Conversation

stevenhubhub
Copy link

Hi, I added the ability to randomize useragent information to init.py from the fake_useragent module (also open source on github).

I tried to follow the style of the main code as much as possible. Like some other parameters, the user can also set this function switch.

If you turn on the random user agent function, I don't think you need to overwrite the agent whether it's headless mode or not, because like the other convenience parameters, it's global, Therefore, I made a small transformation to the code of agent js modification in headless mode to match the switch mode.

@fabifont
Copy link

fabifont commented Feb 9, 2023

This stuff is useless. Faking the useragent can lead to detection. If you want to fake an useragent you must be sure that it is compatible with the OS you are running, update all the client hints and so on...

@stevenhubhub
Copy link
Author

stevenhubhub commented Feb 9, 2023

This stuff is useless. Faking the useragent can lead to detection. If you want to fake an useragent you must be sure that is it compatible with the OS you are running, update all the client hints and so on...

**Unfortunately, Your reply is useless, I'd more like to be a practitioner, so I can simply debate with you, so funny, just like when you visit a website are you worried about your computer installed a few sticks of memory will be found, hmm.

Because you don't understand how the bot checks the visitor's os information, you don't understand various languages, such as how JS gets the user agent by navigator, how PHP gets the user agent by $_SERVER and so on, and you don't have a basic understanding of HTTP requests such like from Boston to Newyork- all your information needs to be transmitted via http transfer, but as it stands, you're stuck with your local computer.

There are many ways to obtain information, but no matter how it is processed, there is only one agent information be transformed with HTTP.

Or you can go to the github page of fake-useragent and learn from the author.
Or unless you can first write an open source project that will get thousands of stars like the author did.

No matter how many methods are used, no one can guarantee that they will never be detected.

Maybe this request won't go through, but I'm happy and proud to be involved and make uc more lively and it workd very well for me.

I'll also be following along with thousands of friends on fake-useragent (https://github.com/fake-useragent/fake-useragent/actions/workflows/action.yml?query=branch%3Amaster).**

@fabifont
Copy link

fabifont commented Feb 9, 2023

As I said, your PR will introduce detectable stuffs. You are setting random useragents. What if you set an useragent that is used only on Windows on you running OS that may be Linux? The useragent is NOT the only way to detect it. That library also contains useragents that are too old and some websites can easily block them. Also some useragents are used only by bots because they could be some special versions that real users have never used. Also you can get a mobile useragent and bot detectors can easily confirm that you are not on a mobile device and so on... If you wanna learn more about detection I suggest you to start from here: https://bot.incolumitas.com

@ultrafunkamsterdam
Copy link
Owner

Will never merge. Not now not in any future

@ultrafunkamsterdam
Copy link
Owner

Remember that this package core intent is undetectabily, not features. And while I can connect and run undetected with a user agent string of "Leon" , it is out of scope.

@ultrafunkamsterdam
Copy link
Owner

ultrafunkamsterdam commented Feb 9, 2023

side note 2: User agents are being phased out atm, so not of any use in the future.

https://www.zdnet.com/article/google-to-phase-out-user-agent-strings-in-chrome/

And while it's Google doing this, there certainly WILL be some form of replacement mechanism, where one can only use google's servers or cloudflare's just as DNS-over-HTTP, which is disgusting, there will certainly be enough work for the future :(

@stevenhubhub stevenhubhub closed this by deleting the head repository Feb 11, 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

Successfully merging this pull request may close these issues.

3 participants