Created
August 17, 2024 12:37
-
-
Save s3rgeym/339941470b30a3f0c870bd05ef138316 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def fake_chrome_useragent() -> str: | |
chrome_version = random.randint(112, 127) | |
webkit_version = "537.36" | |
platform = random.choice( | |
[ | |
"Windows NT 10.0; Win64; x64", | |
"Macintosh; Intel Mac OS X 10_15_7", | |
"X11; Linux x86_64", | |
] | |
) | |
return ( | |
f"Mozilla/5.0 ({platform}) AppleWebKit/{webkit_version} " | |
f"(KHTML, like Gecko) Chrome/{chrome_version}.0.0.0 " | |
f"Safari/{webkit_version}" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment