Skip to content

Improve device and bot detection for 3.1.0 - #2

Merged
SAKMZ merged 1 commit into
masterfrom
improvements-3.1.0
Nov 1, 2026
Merged

SAKMZ merged 1 commit into
masterfrom
improvements-3.1.0

Conversation

@SAKMZ

@SAKMZ SAKMZ commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds is_tv; smart TVs and streaming devices no longer report as touch capable tablets, phones or PCs
  • is_bot now catches Applebot, Amazonbot, Bytespider, headless Chrome, and anything with a bot-style product token, contact URL or contact email
  • Adds a fast extra: about 20x faster on uncached user agents (3,440 strings in 0.08s vs 1.72s)
  • parse() accepts None and bytes instead of raising TypeError
  • Firefox on Android tablets is a tablet, Dalvik clients are phones, KaiOS is mobile
  • Moves to the current ua-parser API and requires ua-parser>=1.0.0
  • Bumps the version to 3.1.0

Addresses selwin#134, selwin#136, selwin#66, selwin#73 and selwin#64 in this fork.

Testing

64 tests pass on pure Python, the Rust parser, and the ua-parser==1.0.0 floor. CI now runs both parsers.

- Add is_tv for smart TVs and streaming devices, which were reported
  as touch capable tablets, phones or PCs
- Catch bots ua-parser misses, using product tokens, contact URLs,
  contact emails and headless browsers
- Treat Generic Tablet as a tablet and Dalvik clients as phones, and
  add KaiOS to the mobile OS families
- Accept None and bytes in parse() instead of raising TypeError
- Move to the current ua-parser API, requiring ua-parser>=1.0.0, and
  add a fast extra for the Rust-backed parser
- Run CI against both parsers and update the publish workflow actions
@SAKMZ
SAKMZ merged commit 8e43097 into master Nov 1, 2026
12 checks passed
@SAKMZ
SAKMZ deleted the improvements-3.1.0 branch November 1, 2026 12:06
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

Successfully merging this pull request may close these issues.

1 participant