Improve bot detection
This commit is contained in:
parent
868cfd3cb9
commit
654b628fc9
@ -74,7 +74,7 @@ def ingress_request(
|
|||||||
device_type = "OTHER"
|
device_type = "OTHER"
|
||||||
if ua.is_mobile:
|
if ua.is_mobile:
|
||||||
device_type = "PHONE"
|
device_type = "PHONE"
|
||||||
elif ua.is_bot or ua.browser.family == "Googlebot":
|
elif ua.is_bot or (ua.browser.family or "").strip() == "Googlebot":
|
||||||
device_type = "ROBOT"
|
device_type = "ROBOT"
|
||||||
elif ua.is_tablet:
|
elif ua.is_tablet:
|
||||||
device_type = "TABLET"
|
device_type = "TABLET"
|
||||||
|
Loading…
Reference in New Issue
Block a user