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.45k stars 198 forks source link

VZW edition of Galaxy S4 comes up as tablet. #13

Open jameyc opened 10 years ago

jameyc commented 10 years ago

The Verizon edition S4 (SCH-I545) has the user agent string "Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SCH-I545 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36"

which erroniously comes back as true in parsers.py's _is_android_tablet() line 116 due to the "SCH-" prefix.

Glancing through the other recent Samsung phones, I don't see any others using the prefix - this seems to be an odd (but widespread) case.

selwin commented 10 years ago

I wonder if we should just hardcode the three tablet model numbers found on tera-wurfl.com: http://www.tera-wurfl.com/explore/search.php?search=samsung+sch&mode=all&action=search&submit=Search+Devices .

Alternatively, we could also drop the check altogether as future tablet devices shouldn't have "Mobile" in their user agent string.