Closed ndragon798 closed 2 weeks ago
I'm somewhat skeptical on adding this package into the project, especially since it hits an external API that we don't control.
Do you know what the fallback behavior is if the API isn't available?
Yeah it will fall back to using a default user-agent defined in the package. I only know this because I updated the package before I added here. https://github.com/Lennolium/simple-useragent/blob/249b6169749c71f8d5ff64e1d1f8347dd5ef47cb/src/simple_useragent/core.py#L42
_FALLBACK_DESKTOP = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/110.0.0.0 Safari/537.36"
]
If it is able to reach out once then it will just fall back to the cached UA. The cache is updated every 24 hours.
This PR is stale because it has been open 45 days with no activity.
Thanks for raising the PR @ndragon798, we do appreciate it! We've thought about this one a bit and decided not to proceed with it. Ultimately this is a very rare issue, and we don't think it's worth adding another dependency into the project for it. We can absolutely revisit that decision if this starts to become a regular issue, but it hasn't been historically.
What type of PR is this?
What this PR does / why we need it: Removes the chore of updating the user-agent that we use instead automatically grabbing the most popular user-agent every day.
Which issue(s) this PR fixes:
Fixes #3524 Fixes #3457
Testing
Tested locally using docker-compose and using built in testing via task py:check