Improve bot detection
This commit is contained in:
parent
d28fe1a1b4
commit
595d6cfd20
@ -75,12 +75,12 @@ 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":
|
||||||
|
device_type = "ROBOT"
|
||||||
elif ua.is_tablet:
|
elif ua.is_tablet:
|
||||||
device_type = "TABLET"
|
device_type = "TABLET"
|
||||||
elif ua.is_pc:
|
elif ua.is_pc:
|
||||||
device_type = "DESKTOP"
|
device_type = "DESKTOP"
|
||||||
elif ua.is_bot:
|
|
||||||
device_type = "ROBOT"
|
|
||||||
session = Session.objects.create(
|
session = Session.objects.create(
|
||||||
service=service,
|
service=service,
|
||||||
ip=ip,
|
ip=ip,
|
||||||
|
Loading…
Reference in New Issue
Block a user