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]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Region and locale support for Playlet backend
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Start up crash on older OS version (11.5)
|
- Start up crash on older OS version (11.5)
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ namespace Innertube
|
|||||||
|
|
||||||
function CreateContextClientWeb(deviceInfo as object) as object
|
function CreateContextClientWeb(deviceInfo as object) as object
|
||||||
return {
|
return {
|
||||||
"hl": "en"
|
"hl": deviceInfo.GetCurrentLocale()
|
||||||
"gl": "US"
|
"gl": GetContentRegion(deviceInfo)
|
||||||
"remoteHost": ""
|
"remoteHost": ""
|
||||||
"screenDensityFloat": 1
|
"screenDensityFloat": 1
|
||||||
"screenHeightPoints": 1440
|
"screenHeightPoints": 1440
|
||||||
@@ -102,8 +102,8 @@ namespace Innertube
|
|||||||
|
|
||||||
function CreateContextClientIOS(deviceInfo as object) as object
|
function CreateContextClientIOS(deviceInfo as object) as object
|
||||||
return {
|
return {
|
||||||
"hl": "en"
|
"hl": deviceInfo.GetCurrentLocale()
|
||||||
"gl": "US"
|
"gl": GetContentRegion(deviceInfo)
|
||||||
"remoteHost": ""
|
"remoteHost": ""
|
||||||
"screenDensityFloat": 1
|
"screenDensityFloat": 1
|
||||||
"screenHeightPoints": 1440
|
"screenHeightPoints": 1440
|
||||||
@@ -128,8 +128,8 @@ namespace Innertube
|
|||||||
|
|
||||||
function CreateContextClientTv(deviceInfo as object) as object
|
function CreateContextClientTv(deviceInfo as object) as object
|
||||||
return {
|
return {
|
||||||
"hl": "en"
|
"hl": deviceInfo.GetCurrentLocale()
|
||||||
"gl": "US"
|
"gl": GetContentRegion(deviceInfo)
|
||||||
"remoteHost": ""
|
"remoteHost": ""
|
||||||
"deviceMake": INNERTUBE_TV_DEVICE_MAKE
|
"deviceMake": INNERTUBE_TV_DEVICE_MAKE
|
||||||
"deviceModel": INNERTUBE_TV_DEVICE_MODEL
|
"deviceModel": INNERTUBE_TV_DEVICE_MODEL
|
||||||
@@ -157,4 +157,12 @@ namespace Innertube
|
|||||||
"utcOffsetMinutes": -300
|
"utcOffsetMinutes": -300
|
||||||
}
|
}
|
||||||
end function
|
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
|
end namespace
|
||||||
Reference in new issue
Block a user