Repository navigation
Improve device and bot detection for 3.1.0 - #2
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_tv; smart TVs and streaming devices no longer report as touch capable tablets, phones or PCsis_botnow catches Applebot, Amazonbot, Bytespider, headless Chrome, and anything with a bot-style product token, contact URL or contact emailfastextra: about 20x faster on uncached user agents (3,440 strings in 0.08s vs 1.72s)parse()acceptsNoneandbytesinstead of raisingTypeErrorua-parserAPI and requiresua-parser>=1.0.0Addresses 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.0floor. CI now runs both parsers.