selwin / python-user-agents

A Python library that provides an easy way to identify devices like mobile phones, tablets and their capabilities by parsing (browser) user agent strings.
MIT License
1.43k stars 196 forks source link

VIZIO SmartCast User Agents Incorrectly Parsed as PC Devices #121

Closed jesseginsberg closed 1 year ago

jesseginsberg commented 1 year ago

VIZIO SmartCast User Agents are being incorrected labeled as with True for the is_pc property in the code below:

https://github.com/selwin/python-user-agents/blob/862c54baf1e6dd095390a8ebfdd3f5303a5b0a32/user_agents/parsers.py#L264

Examples of these user agents:

Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36 CrKey/1.0.999999 VIZIO SmartCast(Conjure/SX7B-2.0.9.0 FW/5.0.5.2 Model/E43-F1)
Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36 CrKey/1.0.999999 VIZIO SmartCast(Conjure/MTKA-1.4.39.3 FW/4.50.18 Model/D32h-F4),gzip(gfe),gzip(gfe)
Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 CrKey/1.0.999999 VIZIO SmartCast(Conjure/MTKD-7.520.90.0-qa FW/5.520.23.2-v-2 Model/P65Q9-J01)

It looks like because these user agents satisfies the both the "Linux" and "X11" conditions the logic is incorrectly classifying them as PC.