Add "isLivingRoomDeeplink" param to /player payload, and remove auto-refresh of browser based tokens
browser based tokens are fallbacks now.
This commit is contained in:
1 parent
ce32d2f762
commit
5c5fe19440
9 files changed
+14
-77
No files matched your search
@@ -1,30 +0,0 @@
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/Services/Innertube/PoTokens.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Locale.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
m.top.itemSpacings = [8]
|
||||
m.button = m.top.findNode("Button")
|
||||
m.button.observeField("buttonSelected", FuncName(OnButtonSelected))
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
NodeSetFocus(m.button, true)
|
||||
end function
|
||||
|
||||
function BindPreference(_preferences as object, _key as string)
|
||||
' Do nothing
|
||||
end function
|
||||
|
||||
function OnButtonSelected()
|
||||
Innertube.PoTokens.ClearAllPoTokens()
|
||||
DialogUtils.ShowDialogEx({
|
||||
message: Tr(Locale.Settings.PoTokensCleared)
|
||||
title: Tr(Locale.Generic.Success)
|
||||
})
|
||||
end function
|
||||
@@ -1,19 +0,0 @@
|
||||
<component name="ClearPoTokensControl" extends="LayoutGroup" includes="Focus">
|
||||
<interface>
|
||||
<field id="displayText" type="string" alias="Button.text" />
|
||||
<field id="description" type="string" alias="DescriptionLabel.text" />
|
||||
<function name="BindPreference" />
|
||||
</interface>
|
||||
<children>
|
||||
<Button
|
||||
id="Button"
|
||||
minWidth="340"
|
||||
showFocusFootprint="true" />
|
||||
<Label id="DescriptionLabel"
|
||||
width="450"
|
||||
color="0xb4b4b4ff"
|
||||
wrap="true">
|
||||
<Font role="font" uri="font:SystemFontFile" size="18" />
|
||||
</Label>
|
||||
</children>
|
||||
</component>
|
||||
@@ -18,7 +18,8 @@ namespace Innertube
|
||||
datasyncIdToken = OptionUtils.Get(options, "datasyncIdToken")
|
||||
cpn = InnertubeService.CreateClientPlaybackNonce()
|
||||
|
||||
useAccessToken = (client = Innertube.ClientType.Tv or client = Innertube.ClientType.TvDowngraded) and not StringUtils.IsNullOrEmpty(accessToken)
|
||||
isTv = (client = Innertube.ClientType.Tv or client = Innertube.ClientType.TvDowngraded)
|
||||
useAccessToken = isTv and not StringUtils.IsNullOrEmpty(accessToken)
|
||||
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
@@ -58,6 +59,10 @@ namespace Innertube
|
||||
payload["playbackContext"]["contentPlaybackContext"]["signatureTimestamp"] = signatureTimestamp
|
||||
end if
|
||||
|
||||
if isTv
|
||||
payload["playbackContext"]["contentPlaybackContext"]["isLivingRoomDeeplink"] = true
|
||||
end if
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/player?prettyPrint=false&alt=json", payload)
|
||||
request.Headers(Innertube.CreateHeaders(client))
|
||||
|
||||
|
||||
Reference in new issue
Block a user