selwin / python-user-agents

A Python library that provides an easy way to identify devices like mobile phones, tablets and their capabilities by parsing (browser) user agent strings.
MIT License
1.43k stars 196 forks source link

GooglePlusBot is not identified as a bot #125

Open sangaline opened 1 year ago

sangaline commented 1 year ago

GooglePlusBot was originally used to generate link previews on Google Plus, but is now used for other use-cases like generating previews for links in SMS messages on Android (see fnando/browser#515 for additional context). The library doesn't tag this as a bot despite it being one.

Here's an example of the user agent processing:

from user_agents import parse

ua_string = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Google-PageRenderer Google (+https://developers.google.com/+/web/snippet/)'
user_agent = parse(ua_string)
print('Browser?', user_agent.get_browser())
print('Is Bot?', user_agent.is_bot)
Browser? GooglePlusBot
Is Bot? False
sangaline commented 1 year ago

This seems like a special case of #35, there isn't really much logic around the bot detection.

PetrDlouhy commented 1 year ago

The logic is in uap-core. Shouldn't the problem be reported there?