matomo-org / device-detector

The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.
http://devicedetector.net
GNU Lesser General Public License v3.0
2.94k stars 476 forks source link

TV Detection Improvements #7527

Closed EfekanPekel closed 10 months ago

EfekanPekel commented 11 months ago
EfekanPekel commented 11 months ago

Tivo OS

BOTECH

Brand: Botech (https://botech.com.tr/urunlerimiz.aspx?CategoryId=99)

Android

Device: tv (https://www.mynokia.com/streaming-devices/nokia-streaming-stick-800/)

Device: tv

liviuconcioiu commented 11 months ago

@sanchezzzhak I can't get the regex to work for Mozilla/5.0 (X11; Linux x86_64;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 SRAF/4.0 (; Arcelik; NF; v03.005.00; v1.0; ); CE-HTML/1.0 hbbtv NETRANGEMMH. If you could help on this one.

sanchezzzhak commented 11 months ago

https://netrange.com/

Mozilla/5.0 (X11; Linux x86_64;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 SRAF/4.0 (; Arcelik; NF; v03.005.00; v1.0; ); CE-HTML/1.0 hbbtv NETRANGEMMH

user_agent: Mozilla/5.0 (X11; Linux x86_64;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 SRAF/4.0 (; Arcelik; NF; v03.005.00; v1.0; ); CE-HTML/1.0 hbbtv NETRANGEMMH
os:
  name: GNU/Linux
  version: ""
  platform: x64
client:
  type: mobile app
  name: NetRanges
  version: ""
device:
  type: tv
  brand: "Arçelik"
  model: ""
os_family: GNU/Linux
browser_family: Unknown

modify AbstractDeviceParser::hasDesktopFragment method

 $this->matchUserAgent('(?:Windows (?:NT|IoT)|X11; Linux x86_64)') &&
            !$this->matchUserAgent('CE-HTML') &&
            !$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh|OculusBrowser') &&
            !$this->matchUserAgent('Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)');

or

 $this->matchUserAgent('(?:Windows (?:NT|IoT)|X11; Linux x86_64)') &&
            !$this->matchUserAgent('hbbtv') &&
            !$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh|OculusBrowser') &&
            !$this->matchUserAgent('Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)');
sanchezzzhak commented 10 months ago

@liviuconcioiu this user agent has not been processed

user_agent: HbbTV/1.5.1 (+DRM;ATMACA;SmartTV2021_LICENSE:KTSU2EL_ATM;T-21KTSU2EATMDEUC-1060.2;ATMACA_LICENSE;urn:samsungtv:familyname:21_ATMACA_UHD_LIC:2021;) Tizen/6.0 (+TVPLUS+SmartHubLink) Chrome/76 LaTivu_1.0.1_2021
os:
  name: Tizen
  version: "6.0"
  platform: ""
client:
  type: browser
  name: Chrome
  version: "76"
  engine: Blink
  engine_version: "76"
device:
  type: tv
  brand: Samsung
  model: Smart TV (2021)
os_family: Other Mobile
browser_family: Chrome