Content region and locale for playlet backend
This commit is contained in:
1 parent
82e55d7030
commit
c6853cd2fc
2 files changed
+18
-6
No files matched your search
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Region and locale support for Playlet backend
|
||||
|
||||
### Fixed
|
||||
|
||||
- Start up crash on older OS version (11.5)
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace Innertube
|
||||
|
||||
function CreateContextClientWeb(deviceInfo as object) as object
|
||||
return {
|
||||
"hl": "en"
|
||||
"gl": "US"
|
||||
"hl": deviceInfo.GetCurrentLocale()
|
||||
"gl": GetContentRegion(deviceInfo)
|
||||
"remoteHost": ""
|
||||
"screenDensityFloat": 1
|
||||
"screenHeightPoints": 1440
|
||||
@@ -102,8 +102,8 @@ namespace Innertube
|
||||
|
||||
function CreateContextClientIOS(deviceInfo as object) as object
|
||||
return {
|
||||
"hl": "en"
|
||||
"gl": "US"
|
||||
"hl": deviceInfo.GetCurrentLocale()
|
||||
"gl": GetContentRegion(deviceInfo)
|
||||
"remoteHost": ""
|
||||
"screenDensityFloat": 1
|
||||
"screenHeightPoints": 1440
|
||||
@@ -128,8 +128,8 @@ namespace Innertube
|
||||
|
||||
function CreateContextClientTv(deviceInfo as object) as object
|
||||
return {
|
||||
"hl": "en"
|
||||
"gl": "US"
|
||||
"hl": deviceInfo.GetCurrentLocale()
|
||||
"gl": GetContentRegion(deviceInfo)
|
||||
"remoteHost": ""
|
||||
"deviceMake": INNERTUBE_TV_DEVICE_MAKE
|
||||
"deviceModel": INNERTUBE_TV_DEVICE_MODEL
|
||||
@@ -157,4 +157,12 @@ namespace Innertube
|
||||
"utcOffsetMinutes": -300
|
||||
}
|
||||
end function
|
||||
|
||||
function GetContentRegion(deviceInfo as object) as string
|
||||
region = deviceInfo.GetUserCountryCode()
|
||||
if region.len() <> 2 or region = "OT"
|
||||
region = "US"
|
||||
end if
|
||||
return region
|
||||
end function
|
||||
end namespace
|
||||
Reference in new issue
Block a user