Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds detection for TiVo OS and improves detection for various devices #7511

Merged
merged 9 commits into from
Nov 13, 2023
Merged
2 changes: 1 addition & 1 deletion DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ protected function parseDevice(): void
/**
* All devices that contain Andr0id in string are assumed to be a tv
*/
if ($this->matchUserAgent('Andr0id|Android TV|\(lite\) TV|BRAVIA')) {
if ($this->matchUserAgent('Andr0id|(?:Android(?: UHD)?|Google) TV|\(lite\) TV|BRAVIA')) {
$this->device = AbstractDeviceParser::DEVICE_TYPE_TV;
}

Expand Down
4 changes: 2 additions & 2 deletions Parser/Client/Browser/Engine/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ public function parse(): ?array
$engineToken = $this->engine;

if ('Blink' === $this->engine) {
$engineToken = 'Chrome';
$engineToken = 'Chrome|Cronet';
}

\preg_match(
"~{$engineToken}\s*/?\s*((?(?=\d+\.\d)\d+[.\d]*|\d{1,7}(?=(?:\D|$))))~i",
"~(?:{$engineToken})\s*/?\s*((?(?=\d+\.\d)\d+[.\d]*|\d{1,7}(?=(?:\D|$))))~i",
$this->userAgent,
$matches
);
Expand Down
3 changes: 2 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class OperatingSystem extends AbstractParser
'TEN' => 'TencentOS',
'TDX' => 'ThreadX',
'TIZ' => 'Tizen',
'TIV' => 'TiVo OS',
'TOS' => 'TmaxOS',
'UBT' => 'Ubuntu',
'VID' => 'VIDAA',
Expand Down Expand Up @@ -204,7 +205,7 @@ class OperatingSystem extends AbstractParser
'ORD', 'TOS', 'RSO', 'DEE', 'FRE', 'MAG', 'FEN', 'CAI', 'PCL', 'HAS',
'LOS', 'DVK', 'ROK', 'OWR', 'OTV', 'KTV', 'PUR', 'PLA', 'FUC', 'PAR',
'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN', 'CST',
'NOV', 'ROU', 'ZOR', 'RED', 'VID',
'NOV', 'ROU', 'ZOR', 'RED', 'VID', 'TIV',
],
'Mac' => ['MAC'],
'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'],
Expand Down
9 changes: 9 additions & 0 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7621,3 +7621,12 @@
engine: Presto
engine_version: 2.5.25
family: Opera
-
user_agent: com.tcl.browser/660020 (Linux; U; Android 11; tr_TR; Arcelik Android UHD TV; Build/RTM6.230109.219; Cronet/114.0.5735.33)
client:
type: browser
name: BrowseHere
version: ""
engine: Blink
engine_version: 114.0.5735.33
family:
6 changes: 6 additions & 0 deletions Tests/Parser/Client/fixtures/mediaplayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,9 @@
type: mediaplayer
name: JHelioviewer
version: 4.4.2.10777
-
user_agent: com.devcoder.iptvxtreamplayer/111 (Linux; U; Android 12; en; Philips Google TV TA1; Build/STT2.220929.001; Cronet/114.0.5735.33)
client:
type: mediaplayer
name: Xtream Player
version: ""
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3942,3 +3942,11 @@
version: "4.21"
platform: ARM
family: GNU/Linux
-
user_agent: Mozilla/5.0 (Linux ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.128 Safari/537.36 OPR/46.0.2207.0 OMI/4.23.2.96.LIMA2.89 Model/Vestel-MB180 VSTVB MB100 FVC/8.0 (OEM; MB180; ) HbbTV/1.6.1 (+DRM; OEM; MB180; 0.32.0.0; ; _TV_G31_2023;) TiVoOS/1.0.0 (Vestel MB180 OEM) SmartTvA/3.0.0
os:
name: TiVo OS
short_name: TIV
version: 1.0.0
platform: ""
family: GNU/Linux
72 changes: 71 additions & 1 deletion Tests/fixtures/tv-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@
-
user_agent: Mozilla/5.0 (Linux; Android 11; 4K Google TV Stick Build/RTT0.210618.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/101.0.4951.61 Mobile Safari/537.36
os:
name: Android
name: Android TV
version: "11"
platform: ""
client:
Expand Down Expand Up @@ -5719,3 +5719,73 @@
model: OV50500
os_family: Other Mobile
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36 OPR/36.0.2128.0 OMI/4.8.0.129.JFK.651 TV Store/4.8 Model/TiVo-Cogeco-TCDD16000
os:
name: Opera TV
version: "4.8"
platform: ARM
client:
type: browser
name: Opera Devices
version: 4.8.0.129
engine: Blink
engine_version: 49.0.2623.112
device:
type: tv
brand: TiVo
model: TCDD16000
os_family: GNU/Linux
browser_family: Opera
-
user_agent: Mozilla/5.0 (Linux; Android 11; Arcelik Android UHD TV Build/RTM6.230109.219; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/119.0.6045.66 Mobile Safari/537.36
os:
name: Android TV
version: "11"
platform: ""
client:
type: browser
name: Chrome Webview
version: 119.0.6045.66
engine: Blink
engine_version: 119.0.6045.66
device:
type: tv
brand: Arçelik
model: ""
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 11; Arcelik Google TV Build/RTM6.230109.257; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/118.0.0.0 Mobile Safari/537.36
os:
name: Android TV
version: "11"
platform: ""
client:
type: browser
name: Chrome Webview
version: 118.0.0.0
engine: Blink
engine_version: 118.0.0.0
device:
type: tv
brand: Arçelik
model: ""
os_family: Android
browser_family: Chrome
-
user_agent: com.devcoder.iptvxtreamplayer/111 (Linux; U; Android 12; en; Philips Google TV TA1; Build/STT2.220929.001; Cronet/114.0.5735.33)
os:
name: Android TV
version: "12"
platform: ""
client:
type: mediaplayer
name: Xtream Player
version: ""
device:
type: tv
brand: Philips
model: Android TV
os_family: Android
browser_family: Unknown
7 changes: 6 additions & 1 deletion regexes/client/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,17 @@
engine:
default: 'Blink'

# T-Browser (https://play.google.com/store/apps/details?id=com.tcl.browser)
# T-Browser and new BrowseHere (https://play.google.com/store/apps/details?id=com.tcl.browser)
- regex: 'Tbrowser/(\d+[\.\d]+)'
name: 'T-Browser'
version: '$1'
engine:
default: 'Blink'
- regex: 'com.tcl.browser'
name: 'BrowseHere'
version: '$1'
engine:
default: 'Blink'

# SFive (https://sfive.vn/)
- regex: 'SFive(?:_Android)?/.+ Chrome/(\d+[\.\d]+)'
Expand Down
5 changes: 5 additions & 0 deletions regexes/client/mediaplayers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,8 @@
- regex: 'JHV/SWHV-([.\d+]+)'
name: 'JHelioviewer'
version: '$1'

# Xtream Player (https://play.google.com/store/apps/details?id=com.devcoder.iptvxtreamplayer)
- regex: 'com.devcoder.iptvxtreamplayer'
name: 'Xtream Player'
version: ''
6 changes: 4 additions & 2 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -885,13 +885,15 @@ TiPhone:

# TiVo (https://www.tivo.com/)
TiVo:
regex: 'TIVO[ ,]'
regex: 'TIVO[ ,-]'
device: 'tv'
models:
- regex: 'STREAM 4K'
model: 'Stream 4K'
- regex: 'TCD8F6000'
model: 'TCD8F6000'
- regex: 'TiVo-([a-z0-9]+)-([a-z0-9]+)'
model: '$2'

# Apple
Apple:
Expand Down Expand Up @@ -32782,7 +32784,7 @@ Philips:
model: 'Xenium $1'
- regex: '(?:Philips[_ ])?(S397|W5510)(?:[);/ ]|$)'
model: '$1'
- regex: 'AND1E(?: TV)?(?:[);/ ]|$)'
- regex: '(?:AND1E|Google)(?: TV)?(?:[);/ ]|$)'
model: 'Android TV'
device: 'tv'
- regex: '(PI3210G)'
Expand Down
9 changes: 8 additions & 1 deletion regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
###############

##########
# TiVo OS (https://business.tivo.com/products-solutions/tivo-os)
##########
- regex: 'TiVoOS/(\d+[\.\d]+)'
name: 'TiVo OS'
version: '$1'

##########
# VIDAA (https://www.vidaa.com/vidaa-os/)
##########
Expand Down Expand Up @@ -294,7 +301,7 @@
name: 'Android TV'
version: '$1'

- regex: 'Android[; ](\d+[\.\d]*).+(?:(?:Android|AT&T) TV|AOSP on r33a0|BRAVIA)'
- regex: 'Android[; ](\d+[\.\d]*).+(?:(?:Android( UHD)?|AT&T|Google) TV|AOSP on r33a0|BRAVIA)'
name: 'Android TV'
version: '$1'

Expand Down
Loading