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

is_bot() returns True then False for the same user agent #26

Closed
pierrocknroll opened this issue Nov 13, 2019 · 3 comments
Closed

is_bot() returns True then False for the same user agent #26

pierrocknroll opened this issue Nov 13, 2019 · 3 comments

Comments

@pierrocknroll
Copy link

pierrocknroll commented Nov 13, 2019

Hello,

I've noticed that the first time, is_bot() will return True, then False the next times for the same user agent.

With this simple script you will see :

from device_detector import DeviceDetector

user_agent = "Mozilla/5.0 (compatible; CloudFlare-AlwaysOnline/1.0; +http://www.cloudflare.com/always-online) AppleWebKit/534.34"

parsed = DeviceDetector(user_agent).parse()
print(parsed.is_bot()) #True
parsed = DeviceDetector(user_agent).parse()
print(parsed.is_bot()) #False

A cache problem ?

Maybe it's not only is_bot() but os_name(), os_version(), etc. that returns incorrect values too.

Thanks

@pierrocknroll
Copy link
Author

The problematic commit is the last one : dab74c3

@pierrocknroll
Copy link
Author

Any update about this ? @thinkwelltwd

@pierrocknroll
Copy link
Author

Thanks!

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

1 participant