Content region and locale for playlet backend

This commit is contained in:
Brahim Hadriche committed 2024-12-23 13:29:23 -05:00
1 parent 82e55d7030
commit c6853cd2fc
2 files changed
+18 -6

No files matched your search

@@ -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