Add visitor data (#545)
* Add visitor data * Tweak * Changelog * Do not load video details in video queue view
This commit is contained in:
1 parent
6f74ee61f6
commit
f8988e9d13
27 files changed
+178
-17
No files matched your search
+11
-1
@@ -7,7 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Nothing worth mentioning yet.
|
### Fixed
|
||||||
|
|
||||||
|
- Added `Visitor Data` to payload in Playlet backend
|
||||||
|
- Session data persists for 24 hours
|
||||||
|
- It reduces the privacy of the app, but can help with `Sign in to confirm you're not a bot errors`
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Video queue view might be missing video titles and durations
|
||||||
|
- This is done to reduce the risk of rate limiting. No video titles in the queue is better than no videos playing at all.
|
||||||
|
- Only affects casting playlists from the YouTube mobile app.
|
||||||
|
|
||||||
## [0.36.0] - 2025-01-16
|
## [0.36.0] - 2025-01-16
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
<BookmarksService id="BookmarksService" />
|
<BookmarksService id="BookmarksService" />
|
||||||
<SearchHistory id="SearchHistory" />
|
<SearchHistory id="SearchHistory" />
|
||||||
<ProfilesService id="ProfilesService" />
|
<ProfilesService id="ProfilesService" />
|
||||||
|
<Innertube id="Innertube" />
|
||||||
<Invidious id="Invidious" />
|
<Invidious id="Invidious" />
|
||||||
<PlayletWebServer id="WebServer" port="8888" />
|
<PlayletWebServer id="WebServer" port="8888" />
|
||||||
<DialServer id="DialServer" />
|
<DialServer id="DialServer" />
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
<VideoQueue id="VideoQueue"
|
<VideoQueue id="VideoQueue"
|
||||||
appController="bind:/AppController"
|
appController="bind:/AppController"
|
||||||
videoContainer="bind:../VideoContainer"
|
videoContainer="bind:../VideoContainer"
|
||||||
|
innertube="bind:../Innertube"
|
||||||
invidious="bind:../Invidious"
|
invidious="bind:../Invidious"
|
||||||
notifications="bind:../Notifications"
|
notifications="bind:../Notifications"
|
||||||
preferences="bind:../Preferences"
|
preferences="bind:../Preferences"
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
<ProfilesService id="ProfilesService"
|
<ProfilesService id="ProfilesService"
|
||||||
invidious="bind:../Invidious" />
|
invidious="bind:../Invidious" />
|
||||||
|
|
||||||
|
<Innertube id="Innertube" />
|
||||||
<Invidious id="Invidious"
|
<Invidious id="Invidious"
|
||||||
webServer="bind:../WebServer"
|
webServer="bind:../WebServer"
|
||||||
applicationInfo="bind:../ApplicationInfo"
|
applicationInfo="bind:../ApplicationInfo"
|
||||||
@@ -81,6 +83,7 @@
|
|||||||
port="8888"
|
port="8888"
|
||||||
appController="bind:/AppController"
|
appController="bind:/AppController"
|
||||||
applicationInfo="bind:../ApplicationInfo"
|
applicationInfo="bind:../ApplicationInfo"
|
||||||
|
innertube="bind:../Innertube"
|
||||||
invidious="bind:../Invidious"
|
invidious="bind:../Invidious"
|
||||||
profilesService="bind:../ProfilesService"
|
profilesService="bind:../ProfilesService"
|
||||||
preferences="bind:../Preferences"
|
preferences="bind:../Preferences"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ function InitializeBindings()
|
|||||||
"VideoQueue": {
|
"VideoQueue": {
|
||||||
"appController": "/AppController",
|
"appController": "/AppController",
|
||||||
"videoContainer": "../VideoContainer",
|
"videoContainer": "../VideoContainer",
|
||||||
|
"innertube": "../Innertube",
|
||||||
"invidious": "../Invidious",
|
"invidious": "../Invidious",
|
||||||
"notifications": "../Notifications",
|
"notifications": "../Notifications",
|
||||||
"preferences": "../Preferences",
|
"preferences": "../Preferences",
|
||||||
@@ -38,6 +39,7 @@ function InitializeBindings()
|
|||||||
"WebServer": {
|
"WebServer": {
|
||||||
"appController": "/AppController",
|
"appController": "/AppController",
|
||||||
"applicationInfo": "../ApplicationInfo",
|
"applicationInfo": "../ApplicationInfo",
|
||||||
|
"innertube": "../Innertube",
|
||||||
"invidious": "../Invidious",
|
"invidious": "../Invidious",
|
||||||
"profilesService": "../ProfilesService",
|
"profilesService": "../ProfilesService",
|
||||||
"preferences": "../Preferences",
|
"preferences": "../Preferences",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Innertube
|
|||||||
deviceInfo = CreateObject("roDeviceInfo")
|
deviceInfo = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"context": Innertube.CreateContext(clienType, deviceInfo, "")
|
"context": Innertube.CreateContext(clienType, deviceInfo, "", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if not StringUtils.IsNullOrEmpty(continuation)
|
if not StringUtils.IsNullOrEmpty(continuation)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Innertube
|
|||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function CreateContext(clienType as Innertube.ClientType, deviceInfo as object, ctt as string) as object
|
function CreateContext(clienType as Innertube.ClientType, deviceInfo as object, ctt as string, visitorData as string) as object
|
||||||
client = invalid
|
client = invalid
|
||||||
if clienType = ClientType.Web
|
if clienType = ClientType.Web
|
||||||
client = CreateContextClientWeb(deviceInfo)
|
client = CreateContextClientWeb(deviceInfo)
|
||||||
@@ -64,6 +64,10 @@ namespace Innertube
|
|||||||
}]
|
}]
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if not StringUtils.IsNullOrEmpty(visitorData)
|
||||||
|
context["client"]["visitorData"] = visitorData
|
||||||
|
end if
|
||||||
|
|
||||||
return context
|
return context
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -76,7 +80,6 @@ namespace Innertube
|
|||||||
"screenHeightPoints": 1440
|
"screenHeightPoints": 1440
|
||||||
"screenPixelDensity": 1
|
"screenPixelDensity": 1
|
||||||
"screenWidthPoints": 2560
|
"screenWidthPoints": 2560
|
||||||
"visitorData": ""
|
|
||||||
"clientName": "WEB"
|
"clientName": "WEB"
|
||||||
"clientVersion": INNERTUBE_WEB_CLIENT_VERSION
|
"clientVersion": INNERTUBE_WEB_CLIENT_VERSION
|
||||||
"osName": "Windows"
|
"osName": "Windows"
|
||||||
@@ -110,7 +113,6 @@ namespace Innertube
|
|||||||
"screenHeightPoints": 1440
|
"screenHeightPoints": 1440
|
||||||
"screenPixelDensity": 1
|
"screenPixelDensity": 1
|
||||||
"screenWidthPoints": 2560
|
"screenWidthPoints": 2560
|
||||||
"visitorData": ""
|
|
||||||
"clientName": "iOS"
|
"clientName": "iOS"
|
||||||
"clientVersion": INNERTUBE_IOS_CLIENT_VERSION
|
"clientVersion": INNERTUBE_IOS_CLIENT_VERSION
|
||||||
"osName": "iOS"
|
"osName": "iOS"
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||||
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
|
|
||||||
|
function Init()
|
||||||
|
AsyncTask.Start(Tasks.InnertubeInitTask, {
|
||||||
|
innertube: m.top
|
||||||
|
})
|
||||||
|
end function
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="Innertube" extends="Node">
|
||||||
|
<interface>
|
||||||
|
<field id="visitorData" type="string" />
|
||||||
|
</interface>
|
||||||
|
</component>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import "pkg:/components/Services/Innertube/SessionData.bs"
|
||||||
|
|
||||||
|
@asynctask
|
||||||
|
function InnertubeInitTask(input as object) as object
|
||||||
|
innertubeNode = input.innertube
|
||||||
|
|
||||||
|
sessionData = Innertube.GetSessionData()
|
||||||
|
if sessionData = invalid
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
innertubeNode.visitorData = sessionData.visitorData
|
||||||
|
|
||||||
|
return invalid
|
||||||
|
end function
|
||||||
@@ -18,6 +18,7 @@ namespace InnertubeService
|
|||||||
cancellation = invalid
|
cancellation = invalid
|
||||||
fetchNext = true
|
fetchNext = true
|
||||||
ctt = ""
|
ctt = ""
|
||||||
|
visitorData = ""
|
||||||
raw = false
|
raw = false
|
||||||
|
|
||||||
if options <> invalid
|
if options <> invalid
|
||||||
@@ -33,9 +34,12 @@ namespace InnertubeService
|
|||||||
if options.DoesExist("raw")
|
if options.DoesExist("raw")
|
||||||
raw = options.raw
|
raw = options.raw
|
||||||
end if
|
end if
|
||||||
|
if options.DoesExist("visitorData")
|
||||||
|
visitorData = options.visitorData
|
||||||
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
playerRequest = Innertube.CreatePlayerRequest(videoId, ctt)
|
playerRequest = Innertube.CreatePlayerRequest(videoId, ctt, visitorData)
|
||||||
playerRequest.Cancellation(cancellation)
|
playerRequest.Cancellation(cancellation)
|
||||||
playerRequest.Send()
|
playerRequest.Send()
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Innertube
|
|||||||
deviceInfo = CreateObject("roDeviceInfo")
|
deviceInfo = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"context": Innertube.CreateContext(Innertube.ClientType.Web, deviceInfo, ctt)
|
"context": Innertube.CreateContext(Innertube.ClientType.Web, deviceInfo, ctt, "")
|
||||||
}
|
}
|
||||||
payload.Append(payloadArgs)
|
payload.Append(payloadArgs)
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import "pkg:/source/utils/Types.bs"
|
|||||||
|
|
||||||
namespace Innertube
|
namespace Innertube
|
||||||
|
|
||||||
function CreatePlayerRequest(videoId as string, ctt as string) as object
|
function CreatePlayerRequest(videoId as string, ctt as string, visitorData as string) as object
|
||||||
deviceInfo = CreateObject("roDeviceInfo")
|
deviceInfo = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"videoId": videoId
|
"videoId": videoId
|
||||||
"context": Innertube.CreateContext(Innertube.ClientType.IOS, deviceInfo, ctt)
|
"context": Innertube.CreateContext(Innertube.ClientType.IOS, deviceInfo, ctt, visitorData)
|
||||||
"playbackContext": {
|
"playbackContext": {
|
||||||
"contentPlaybackContext": {
|
"contentPlaybackContext": {
|
||||||
"vis": 0
|
"vis": 0
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Innertube
|
|||||||
deviceInfo = CreateObject("roDeviceInfo")
|
deviceInfo = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"context": CreateContext(ClientType.Web, deviceInfo, "")
|
"context": CreateContext(ClientType.Web, deviceInfo, "", "")
|
||||||
"url": url
|
"url": url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Innertube
|
|||||||
deviceInfo = CreateObject("roDeviceInfo")
|
deviceInfo = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
context: Innertube.CreateContext(Innertube.ClientType.WEB, deviceInfo, "")
|
context: Innertube.CreateContext(Innertube.ClientType.WEB, deviceInfo, "", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if continuation <> ""
|
if continuation <> ""
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||||
|
import "pkg:/source/services/HttpClient.bs"
|
||||||
|
import "pkg:/source/utils/Logging.bs"
|
||||||
|
import "pkg:/source/utils/ObjectUtils.bs"
|
||||||
|
import "pkg:/source/utils/RegistryUtils.bs"
|
||||||
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
|
import "pkg:/source/utils/TimeUtils.bs"
|
||||||
|
|
||||||
|
namespace Innertube
|
||||||
|
|
||||||
|
const SESSION_DATA_VERSION = 1
|
||||||
|
const INNERTUBE_VISITOR_DATA_LIFESPAN = 1000 * 60 * 60 * 24
|
||||||
|
|
||||||
|
function GetSessionData() as object
|
||||||
|
sessionData = ReadSessionDataFromRegistry()
|
||||||
|
if sessionData <> invalid
|
||||||
|
return sessionData
|
||||||
|
end if
|
||||||
|
|
||||||
|
sessionData = RequestSessionData()
|
||||||
|
if sessionData = invalid
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
RegistryUtils.Write(RegistryUtils.INNERTUBE_SESSION_DATA, FormatJson(sessionData))
|
||||||
|
return sessionData
|
||||||
|
end function
|
||||||
|
|
||||||
|
function RequestSessionData() as object
|
||||||
|
request = HttpClient.Get("https://www.youtube.com/sw.js_data")
|
||||||
|
request.Headers({
|
||||||
|
"Accept-Language": "en-US,en;q=0.9"
|
||||||
|
"User-Agent": INNERTUBE_WEB_USER_AGENT
|
||||||
|
"Accept": "*/*"
|
||||||
|
"Referer": "https://www.youtube.com/sw.js"
|
||||||
|
})
|
||||||
|
|
||||||
|
response = request.Await()
|
||||||
|
if not response.IsSuccess()
|
||||||
|
LogError("Failed to fetch session data", response.ErrorMessage())
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
text = ValidString(response.Text())
|
||||||
|
if not text.StartsWith(")]}'")
|
||||||
|
LogError("Invalid session data response", text)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
text = text.Replace(")]}'", "")
|
||||||
|
json = ParseJson(text)
|
||||||
|
if json = invalid
|
||||||
|
LogError("Failed to parse session data", text)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
visitorData = ObjectUtils.Dig(json, [0, 2, 0, 0, 13])
|
||||||
|
if StringUtils.IsNullOrEmpty(visitorData)
|
||||||
|
LogError("Visitor data not found", text)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
return {
|
||||||
|
"__version": SESSION_DATA_VERSION
|
||||||
|
"timestamp": TimeUtils.Now().AsSeconds()
|
||||||
|
"visitorData": visitorData
|
||||||
|
}
|
||||||
|
end function
|
||||||
|
|
||||||
|
function ReadSessionDataFromRegistry() as object
|
||||||
|
sessionData = RegistryUtils.Read(RegistryUtils.INNERTUBE_SESSION_DATA)
|
||||||
|
if StringUtils.IsNullOrEmpty(sessionData)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
sessionData = ParseJson(sessionData)
|
||||||
|
if sessionData = invalid
|
||||||
|
RegistryUtils.Delete(RegistryUtils.INNERTUBE_SESSION_DATA)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
timestamp = sessionData.timestamp
|
||||||
|
nowSeconds = TimeUtils.Now().AsSeconds()
|
||||||
|
if nowSeconds - timestamp > INNERTUBE_VISITOR_DATA_LIFESPAN
|
||||||
|
RegistryUtils.Delete(RegistryUtils.INNERTUBE_SESSION_DATA)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
return sessionData
|
||||||
|
end function
|
||||||
|
end namespace
|
||||||
@@ -5,6 +5,7 @@ import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
|||||||
function VideoContentTask(input as object) as object
|
function VideoContentTask(input as object) as object
|
||||||
contentNode = input.content
|
contentNode = input.content
|
||||||
invidiousNode = input.invidious
|
invidiousNode = input.invidious
|
||||||
|
innertubeNode = input.innertube
|
||||||
preferencesNode = input.preferences
|
preferencesNode = input.preferences
|
||||||
loungeServiceNode = input.loungeService
|
loungeServiceNode = input.loungeService
|
||||||
playletServerPort = input.playletServerPort
|
playletServerPort = input.playletServerPort
|
||||||
@@ -22,8 +23,9 @@ function VideoContentTask(input as object) as object
|
|||||||
backend = preferencesNode["playback.backend"]
|
backend = preferencesNode["playback.backend"]
|
||||||
if backend = "playlet"
|
if backend = "playlet"
|
||||||
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
||||||
cancellation: m.top.cancellation
|
"cancellation": m.top.cancellation
|
||||||
ctt: loungeServiceNode.ctt
|
"ctt": loungeServiceNode.ctt
|
||||||
|
"visitorData": innertubeNode.visitorData
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ function StartVideoContentTask(videoContentNode as object)
|
|||||||
m.videoContentTask = AsyncTask.Start(Tasks.VideoContentTask, {
|
m.videoContentTask = AsyncTask.Start(Tasks.VideoContentTask, {
|
||||||
content: videoContentNode
|
content: videoContentNode
|
||||||
invidious: m.top.invidious
|
invidious: m.top.invidious
|
||||||
|
innertube: m.top.innertube
|
||||||
preferences: m.top.preferences
|
preferences: m.top.preferences
|
||||||
loungeService: m.top.loungeService
|
loungeService: m.top.loungeService
|
||||||
playletServerPort: m.top.webServer.port
|
playletServerPort: m.top.webServer.port
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<field id="notifications" type="node" bind="../../Notifications" />
|
<field id="notifications" type="node" bind="../../Notifications" />
|
||||||
<field id="videoQueue" type="node" bind="../../VideoQueue" />
|
<field id="videoQueue" type="node" bind="../../VideoQueue" />
|
||||||
<field id="preferences" type="node" bind="../../Preferences" />
|
<field id="preferences" type="node" bind="../../Preferences" />
|
||||||
|
<field id="innertube" type="node" bind="../../Innertube" />
|
||||||
<field id="invidious" type="node" bind="../../Invidious" />
|
<field id="invidious" type="node" bind="../../Invidious" />
|
||||||
<field id="webServer" type="node" bind="../../WebServer" />
|
<field id="webServer" type="node" bind="../../WebServer" />
|
||||||
<field id="loungeService" type="node" bind="../../LoungeService" />
|
<field id="loungeService" type="node" bind="../../LoungeService" />
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<field id="player" type="node" />
|
<field id="player" type="node" />
|
||||||
<field id="nowPlaying" type="node" />
|
<field id="nowPlaying" type="node" />
|
||||||
|
|
||||||
|
<field id="innertube" type="node" />
|
||||||
<field id="invidious" type="node" />
|
<field id="invidious" type="node" />
|
||||||
<field id="notifications" type="node" />
|
<field id="notifications" type="node" />
|
||||||
<field id="preferences" type="node" />
|
<field id="preferences" type="node" />
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ function OnContentSet() as void
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
AdjustFocus(videoCount)
|
AdjustFocus(videoCount)
|
||||||
LoadVideoDetailsIfNeeded()
|
' TODO:P1 LoadVideoDetailsIfNeeded is disabled for now.
|
||||||
|
' Trying to fetch video info (especially one by one) can lead to rate limiting.
|
||||||
|
' That would result in all videos being blocked. So for now, this is just a
|
||||||
|
' nice to have, and should not be used.
|
||||||
|
' LoadVideoDetailsIfNeeded()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnKeyEvent(key as string, press as boolean) as boolean
|
function OnKeyEvent(key as string, press as boolean) as boolean
|
||||||
@@ -143,6 +147,7 @@ function LoadVideoDetailsIfNeeded() as void
|
|||||||
|
|
||||||
m.loadDetailsTask = AsyncTask.Start(Tasks.VideoQueueViewContentTask, {
|
m.loadDetailsTask = AsyncTask.Start(Tasks.VideoQueueViewContentTask, {
|
||||||
videoNodes: m.videosDetailsToLoad
|
videoNodes: m.videosDetailsToLoad
|
||||||
|
innertube: m.top.innertube
|
||||||
invidious: m.top.invidious
|
invidious: m.top.invidious
|
||||||
preferences: m.top.preferences
|
preferences: m.top.preferences
|
||||||
index: indexInLoadingArray
|
index: indexInLoadingArray
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<field id="jumpToItem" type="integer" alias="queueList.jumpToItem" />
|
<field id="jumpToItem" type="integer" alias="queueList.jumpToItem" />
|
||||||
<field id="videoQueue" type="node" />
|
<field id="videoQueue" type="node" />
|
||||||
<field id="appController" type="node" />
|
<field id="appController" type="node" />
|
||||||
|
<field id="innertube" type="node" />
|
||||||
<field id="invidious" type="node" />
|
<field id="invidious" type="node" />
|
||||||
<field id="preferences" type="node" />
|
<field id="preferences" type="node" />
|
||||||
<function name="Show" />
|
<function name="Show" />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import "pkg:/source/utils/MathUtils.bs"
|
|||||||
@asynctask
|
@asynctask
|
||||||
function VideoQueueViewContentTask(input as object) as object
|
function VideoQueueViewContentTask(input as object) as object
|
||||||
videoNodes = input.videoNodes
|
videoNodes = input.videoNodes
|
||||||
|
innertubeNode = input.innertube
|
||||||
invidiousNode = input.invidious
|
invidiousNode = input.invidious
|
||||||
preferencesNode = input.preferences
|
preferencesNode = input.preferences
|
||||||
service = new Invidious.InvidiousService(invidiousNode)
|
service = new Invidious.InvidiousService(invidiousNode)
|
||||||
@@ -22,6 +23,7 @@ function VideoQueueViewContentTask(input as object) as object
|
|||||||
cancellation: cancellation
|
cancellation: cancellation
|
||||||
tryCount: 1
|
tryCount: 1
|
||||||
fetchNext: false
|
fetchNext: false
|
||||||
|
visitorData: innertubeNode.visitorData
|
||||||
}
|
}
|
||||||
|
|
||||||
' TODO:P1: Use InnertubeService.GetVideoInfoBatched instead of loading each video individually
|
' TODO:P1: Use InnertubeService.GetVideoInfoBatched instead of loading each video individually
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ namespace VideoQueueViewUtils
|
|||||||
videoQueueView = CreateObject("roSGNode", "VideoQueueView")
|
videoQueueView = CreateObject("roSGNode", "VideoQueueView")
|
||||||
videoQueueView.videoQueue = videoQueue
|
videoQueueView.videoQueue = videoQueue
|
||||||
videoQueueView.appController = appController
|
videoQueueView.appController = appController
|
||||||
|
videoQueueView.innertube = videoQueue.innertube
|
||||||
videoQueueView.invidious = videoQueue.invidious
|
videoQueueView.invidious = videoQueue.invidious
|
||||||
videoQueueView.preferences = videoQueue.preferences
|
videoQueueView.preferences = videoQueue.preferences
|
||||||
appController@.PushScreen(videoQueueView)
|
appController@.PushScreen(videoQueueView)
|
||||||
|
|||||||
+5
-2
@@ -5,8 +5,10 @@ namespace Http
|
|||||||
|
|
||||||
class PlayletInvidiousBackendRouter extends HttpRouter
|
class PlayletInvidiousBackendRouter extends HttpRouter
|
||||||
|
|
||||||
function new()
|
function new(server as object)
|
||||||
super()
|
super()
|
||||||
|
|
||||||
|
m.innertube = server.task.innertube
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/authorize_token")
|
@get("/playlet-invidious-backend/authorize_token")
|
||||||
@@ -426,7 +428,8 @@ namespace Http
|
|||||||
raw = request.query.raw <> invalid
|
raw = request.query.raw <> invalid
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
raw: raw
|
"raw": raw
|
||||||
|
"visitorData": m.innertube.visitorData
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata = InnertubeService.GetVideoMetadata(videoId, options)
|
metadata = InnertubeService.GetVideoMetadata(videoId, options)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ function SetupRoutes(server as object)
|
|||||||
server.UseRouter(new Http.DialRouter(server))
|
server.UseRouter(new Http.DialRouter(server))
|
||||||
server.UseRouter(new Http.CacheRouter())
|
server.UseRouter(new Http.CacheRouter())
|
||||||
server.UseRouter(new Http.RegistryRouter(server))
|
server.UseRouter(new Http.RegistryRouter(server))
|
||||||
server.UseRouter(new Http.PlayletInvidiousBackendRouter())
|
server.UseRouter(new Http.PlayletInvidiousBackendRouter(server))
|
||||||
|
|
||||||
etags = new Http.EtagUtils()
|
etags = new Http.EtagUtils()
|
||||||
server.UseRouter(new Http.HttpStaticFilesRouter("/", "libpkg:/www", etags, { staticFiles: true, staticCompressed: true }))
|
server.UseRouter(new Http.HttpStaticFilesRouter("/", "libpkg:/www", etags, { staticFiles: true, staticCompressed: true }))
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<field id="appController" type="node" />
|
<field id="appController" type="node" />
|
||||||
<field id="preferences" type="node" />
|
<field id="preferences" type="node" />
|
||||||
|
<field id="innertube" type="node" />
|
||||||
<field id="invidious" type="node" />
|
<field id="invidious" type="node" />
|
||||||
<field id="profilesService" type="node" />
|
<field id="profilesService" type="node" />
|
||||||
<field id="applicationInfo" type="node" />
|
<field id="applicationInfo" type="node" />
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace RegistryUtils
|
|||||||
const BOOKMARKS = "bookmarks"
|
const BOOKMARKS = "bookmarks"
|
||||||
const MESSAGES = "messages"
|
const MESSAGES = "messages"
|
||||||
|
|
||||||
|
const INNERTUBE_SESSION_DATA = "innertube_session_data"
|
||||||
const LAST_LOUNGE_DATA = "last_lounge_data"
|
const LAST_LOUNGE_DATA = "last_lounge_data"
|
||||||
|
|
||||||
' "invidious_instances" is deprecated, but we keep for migration purposes
|
' "invidious_instances" is deprecated, but we keep for migration purposes
|
||||||
|
|||||||
Reference in new issue
Block a user