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

Add PetalBot #536

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ user_agent_parsers:
- regex: 'Mozilla.{1,200}Mobile.{1,100}(Phantom\/ios|android).(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Phantom'

# aspiegel.com spider (owned by Huawei)
- regex: 'Mozilla.{1,100}Mobile.{1,100}AspiegelBot'
# aspiegel.com spider (owned by Huawei, later called PetalBot)
- regex: 'Mozilla.{1,100}Mobile.{1,100}(AspiegelBot|PetalBot)'
family_replacement: 'Spider'

- regex: 'AspiegelBot'
- regex: 'AspiegelBot|PetalBot'
family_replacement: 'Spider'

# Basilisk
Expand Down Expand Up @@ -1077,8 +1077,8 @@ os_parsers:
# generic HbbTV, hoping to catch manufacturer name (always after 2nd comma) and the first string that looks like a 2011-2019 year
- regex: 'HbbTV/\d+\.\d+\.\d+ \(.{0,30}; ?([a-zA-Z]+) ?;.{0,30}(201[1-9]).{0,30}\)'

# aspiegel.com spider (owned by Huawei)
- regex: 'AspiegelBot'
# aspiegel.com spider (owned by Huawei, later renamed PetalBot)
- regex: 'AspiegelBot|PetalBot'
os_replacement: 'Other'

##########
Expand Down Expand Up @@ -1823,11 +1823,11 @@ device_parsers:
brand_replacement: 'Spider'

# aspiegel.com spider (owned by Huawei)
- regex: 'Mozilla.{1,100}Mobile.{1,100}AspiegelBot'
- regex: 'Mozilla.{1,100}Mobile.{1,100}(AspiegelBot|PetalBot)'
device_replacement: 'Spider'
brand_replacement: 'Spider'
model_replacement: 'Smartphone'
- regex: 'Mozilla.{0,200}AspiegelBot'
- regex: 'Mozilla.{0,200}(AspiegelBot|PetalBot)'
device_replacement: 'Spider'
brand_replacement: 'Spider'
model_replacement: 'Desktop'
Expand Down
10 changes: 10 additions & 0 deletions tests/test_device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80444,6 +80444,16 @@ test_cases:
brand: 'Spider'
model: 'Desktop'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; PetalBot;+https://webmaster.petalsearch.com/site/petalbot)'
family: 'Spider'
brand: 'Spider'
model: 'Smartphone'

- user_agent_string: 'Mozilla/5.0 (compatible;PetalBot;+https://webmaster.petalsearch.com/site/petalbot)'
family: 'Spider'
brand: 'Spider'
model: 'Desktop'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; AspiegelBot)'
family: 'Spider'
brand: 'Spider'
Expand Down