Improve OS detection: identify AppleTV's tvOS as iOS

This commit is contained in:
Faisal Salman
2025-11-16 14:14:59 +07:00
parent 82801a36b6
commit f1b9a12bda
2 changed files with 38 additions and 1 deletions

View File

@@ -968,7 +968,8 @@
// iOS/macOS // iOS/macOS
/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w\.]+)/i, /(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,
/\btvos ?([\w\.]+)/i,
/cfnetwork\/.+darwin/i /cfnetwork\/.+darwin/i
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
/(mac os x) ?([\w\. ]*)/i, /(mac os x) ?([\w\. ]*)/i,

View File

@@ -142,5 +142,41 @@
"name" : "iOS", "name" : "iOS",
"version" : "11.2.5" "version" : "11.2.5"
} }
},
{
"desc": "iOS",
"ua": "iPlayTV/3.3.9 (Apple TV; iOS 16.1; Scale/1.00)",
"expect" :
{
"name" : "iOS",
"version" : "16.1"
}
},
{
"desc": "iOS",
"ua": "itunesstored/1.0 iOS/8.4.4 AppleTV/7.8 model/AppleTV3,2 build/12H937 (3; dt:12)",
"expect" :
{
"name" : "iOS",
"version" : "8.4.4"
}
},
{
"desc": "tvOS",
"ua": "iMPlayer/1.6.1 (tvOS 26.0.1)",
"expect" :
{
"name" : "iOS",
"version" : "26.0.1"
}
},
{
"desc": "tvOS",
"ua": "otg/1.5.1 (AppleTv Apple TV 4; tvOS16.2; appletv.client) libcurl/7.58.0 OpenSSL/1.0.2o zlib/1.2.11 clib/1.8.56",
"expect" :
{
"name" : "iOS",
"version" : "16.2"
}
} }
] ]