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

detecting streaming softwares #7391

Closed thib3113 closed 8 months ago

thib3113 commented 1 year ago

Hello, I try to start a PR, but I think I miss something ...

So, I open this issue .

I'm interessted about adding streaming softwares to user agent detection

All the UA are coming from a win 10 computer X64

Here is what I start to get (doesn't know how to set the engine version from UA) :


Open Broadcaster Software (OBS Studio) (https://obsproject.com/fr)

UA : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 OBS/29.0.2 Safari/537.36

Regex :

# OBS Studio (https://obsproject.com/fr)
- regex: 'OBS/(\d+[\.\d]+)'
  name: "Open Broadcaster Software"
  version: "$1"
  engine:
    default: "Blink"

Fixture :

- user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 OBS/29.0.2 Safari/537.36
  os:
    name: Windows
    version: "10"
    platform: x64
  client:
    type: browser
    name: Open Broadcaster Software
    version: "29.0.2"
    engine: Blink
    engine_version: "103.0.5060.134"
  device:
    type: desktop
    brand: ""
    model: ""
  os_family: Windows
  browser_family: Chrome

Twitch Studio (https://www.twitch.tv/broadcast/studio)

UA : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) twitch-desktop-electron-platform/1.0.0 Chrome/100.0.4896.160 Electron/18.3.9 Safari/537.36 spotlight/0.115.7

Regex :

# Twitch Studio (https://www.twitch.tv/broadcast/studio)
- regex: 'twitch-desktop-electron-platform.*spotlight/(\d+[\.\d]+)'
  name: "Twitch Studio"
  version: "$1"
  engine:
    default: "Blink"

Fixture :

- user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) twitch-desktop-electron-platform/1.0.0 Chrome/100.0.4896.160 Electron/18.3.9 Safari/537.36 spotlight/0.115.7
  os:
    name: Windows
    version: "10"
    platform: x64
  client:
    type: browser
    name: Twitch Studio
    version: "0.115.7"
    engine: Blink
    engine_version: "100.0.4896.160"
  device:
    type: desktop
    brand: ""
    model: ""
  os_family: Windows
  browser_family: Chrome

XSplit Broadcaster (https://www.xsplit.com/broadcaster)

UA : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 XSplitBroadcaster/4.4.2304.1201 Safari/537.36

Regex :

# Xsplit Broadcaster (https://www.xsplit.com/broadcaster)
- regex: 'XSplitBroadcaster/(\d+[\.\d]+)'
  name: "XSplit Broadcaster"
  version: "$1"
  engine:
    default: "Blink"

Fixture :

- user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 XSplitBroadcaster/4.4.2304.1201 Safari/537.36
  os:
    name: Windows
    version: "10"
    platform: x64
  client:
    type: browser
    name: XSplit Broadcaster
    version: "4.4.2304.1201"
    engine: Blink
    engine_version: "68.0.3440.106"
  device:
    type: desktop
    brand: ""
    model: ""
  os_family: Windows
  browser_family: Chrome
sanchezzzhak commented 1 year ago

I must say right away that such PR will not work if the client type is browser. (Since the application is not a'browser)

Add these rules better in mobile_apps.yml

thib3113 commented 1 year ago

@sanchezzzhak thanks for comment .

Why there are not a "browser" ? Is it linked to the detection logic ? ( because they are more a browser than a mobile app in fact ) .