Compare commits

...
24 Commits
Author SHA1 Message Date
Brahim Hadriche 99f606610c Release v0.45.0 (#876) 2026-05-24 20:49:51 -04:00
Brahim Hadriche 62b4a90a7e Fixed bug where large playlists (1k+ videos) only load the first page (#875) 2026-05-24 20:44:03 -04:00
Brahim Hadriche ee98f0f368 [chore] update dependencies (#866)
* update dependencies

* Fix
2026-05-24 10:41:07 -04:00
Brahim Hadriche 81db556699 changelog 2026-05-22 17:59:45 -04:00
Hector Oswaldo Caballeroandclaude Bot 81ee5b3262 Add preference to disable auto-dubbed audio tracks (#714) (#869)
YouTube has been rolling out AI-generated dubbed audio tracks on videos.
Roku's player automatically selects the dubbed track matching the device
language, overriding the original audio — and the app provides no way to
switch back. The only workaround is a cumbersome device-level setting.

This adds a "Disable auto-dubbed audio" boolean preference under
Playback settings. When enabled, auto-dubbed audio groups (identified
by the existing isAutoDubbed flag from xtags parsing) are excluded from
the locally-generated DASH manifest, so only the original audio track
is available for playback.

A softer approach — keeping dubbed tracks available but defaulting to
the original — was also investigated. Both DASH `selectionPriority`
attributes and AdaptationSet reordering were tested on a Hisense 65R6107
Roku TV, but Roku's player ignores both and always selects the track
matching the device language. Removing the tracks from the manifest is
the only reliable approach.

Tested on a Hisense 65R6107 (Roku OS). With the preference enabled,
auto-dubbed tracks are no longer listed and the original audio plays
by default. With the preference disabled (default), behavior is
unchanged.

Scope: DASH (local) path only. HLS and DRM DASH paths are not yet
covered and will be addressed in follow-up work.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 17:58:53 -04:00
Brahim Hadriche 338ad6f82c [skip ci] stats 2 hours sooner 2026-05-21 08:10:38 -04:00
Brahim Hadriche c89eb3ccce [skip ci] Invidious login error message clarification 2026-05-20 19:24:52 -04:00
Brahim Hadriche 7a38245630 update dependencies (#860) 2026-05-14 20:45:25 -04:00
Brahim Hadriche 6ca16bd0b2 playback speed from mobile app 2026-05-14 20:16:13 -04:00
Brahim Hadriche 70fc97ae38 Release v0.44.10 (#855) 2026-05-03 16:08:16 -04:00
Brahim Hadriche 22f8031b91 Fix bug where home screen editor is empty with a fresh install 2026-05-03 16:02:14 -04:00
Brahim Hadriche 1e121fdddd Update deps 2026-05-02 19:44:35 -04:00
Brahim Hadriche 97f4a0ed61 [skip ci] a couple of telemetry fixes 2026-04-29 21:45:29 -04:00
Brahim Hadriche 277c5e0562 [skip ci] ignore normal errors 2026-04-25 10:52:30 -04:00
Brahim Hadriche fa64af7ff5 [skip ci] small fix in logging job name 2026-04-25 10:45:15 -04:00
Brahim Hadriche 10bcf9f1f4 plugin fix 2026-04-25 10:33:50 -04:00
Brahim Hadriche a75c42f4ac [skip ci] refactor token validation 2026-04-25 10:22:25 -04:00
Brahim Hadriche f5b81eff4d Release v0.44.9 (#848) 2026-04-25 09:52:15 -04:00
Brahim Hadriche b6bdbee42f [skip ci] updated dependencies and innertube versions 2026-04-25 09:49:22 -04:00
Brahim Hadriche 0fc9fbb79a [skip ci] Update PRIVACY.md with telemetry details
Added detailed explanation of current telemetry implementation, including data collected and its usage.
2026-04-24 17:15:33 -04:00
Brahim Hadriche f3c159218a [skip ci] log job name in errors 2026-04-24 16:34:01 -04:00
Brahim Hadriche e8624cdb1f Release v0.44.8 (#847) 2026-04-24 11:01:28 -04:00
Brahim Hadriche d427989576 Watch history fix 2026-04-23 15:08:25 -04:00
Brahim Hadriche 4706d71639 Fix warning 2026-04-23 14:31:38 -04:00
44 changed files with 1224 additions and 832 deletions

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ name: Stats
on:
schedule:
- cron: "0 11 * * *"
- cron: "0 9 * * *"
workflow_dispatch:
jobs:
+30
View File
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.45.0] - 2026-05-25
### Added
- Experimental support for changing playback speed from YouTube mobile app using Leanback/Lounge api
- Support for disabling AI auto-dubbed audio tracks
### Fixed
- Bug where large playlists (1k+ videos) only load the first page
## [0.44.10] - 2026-05-03
### Fixed
- Bug where home screen editor is empty with a fresh install
## [0.44.9] - 2026-04-25
### Fixed
- Updated dependencies and innertube versions
## [0.44.8] - 2026-04-24
### Fixed
- Always use `signatureTimestamp` in `/player` calls to prevent "reload page" errors. This affects watch history.
- Attempt 2 to fix watch history and watch progress
## [0.44.7] - 2026-04-23
### Fixed
+20
View File
@@ -8,6 +8,26 @@ Playlet does not show advertising, whether personalized or non personalized.
Playlet may integrate with 3rd party telemetry services in order to capture anonymous diagnostics data. The only purpose of this data is to diagnose issues and improve the app.
### Current telemetry implementation
> This section tries to explain in more detail what data is collected and how it is used. Due to the granularity and details of the following explanation, it might be slightly out of date, but mostly represents the reality of the "Playlet may integrate with 3rd party telemetry services"
Currently, Playlet captures a bunch of errors through the [telemetry client code](https://github.com/iBicha/playlet/tree/f3c159218ac8e3eec08eb7b62cbd45ad6c451b99/playlet-lib/src/components/Telemetry).
It's mostly OS info (version, device model, etc), app info, user country code, locale, error messages, and stack traces. Nothing more than necessary is captured to debug problems.
In addition to that, an anonymous user id (just a guid stable across app launches of Playlet) and a session id (generated on every launch) are collected.
The user id is used to understand how many people an error affects. Sometimes one issue is spread out evenly among users, sometimes it's a handful of users (or even just one) spamming the same errors. This helps investigate that aspect.
The session id is used to understand how an error happened. By isolating a specific error to a session, it helps understand what led to said error.
This data is currently sent to a server, then forwarded to a self-hosted instance [Glitch-Tip](https://gitlab.com/glitchtip/glitchtip) which provides a simple dashboard showing how frequent errors are, and on which versions they occur.
This data is anonymous. The data is not collected in a way that can be linked back to a real person, or a YouTube profile for example.
The data is stored on a local hard drive, does not leave said hard drive, and accessed only by the currently single developer of Playlet, and frequently purged (because honestly I don't have the disk space).
The data is used to investigate errors, like playback errors, feed load errors, login errors, and so on.
## Invidious
Playlet may request information from one or more [Invidious](https://invidious.io/)
+563 -342
View File
File diff suppressed because it is too large. Load diff
+19 -19
View File
@@ -1,38 +1,38 @@
{
"name": "playlet",
"version": "0.44.7",
"version": "0.45.0",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.39",
"@rokucommunity/bslint": "^0.8.43",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^25.5.0",
"@types/node": "^25.9.1",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.70.3",
"brighterscript-formatter": "^1.7.21",
"brighterscript": "0.72.2",
"brighterscript-formatter": "^1.7.26",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^17.3.1",
"fs-extra": "^11.3.4",
"dotenv": "^17.4.2",
"fs-extra": "^11.3.5",
"glob": "^13.0.6",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.9.4",
"protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.40.0",
"roku-deploy": "^3.16.2",
"roku-test-automation": "^2.2.1",
"rooibos-roku": "5.15.5",
"mailparser": "^3.9.8",
"protocol-buffers-schema": "^3.6.1",
"puppeteer": "^25.0.4",
"roku-deploy": "^3.17.4",
"roku-test-automation": "^2.2.2",
"rooibos-roku": "5.16.3",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.7.4",
"semver": "^7.8.1",
"shelljs": "^0.10.0",
"ts-node": "^10.9.2",
"typescript": "5.9.3",
"telnet-client": "^2.2.11",
"typescript": "6.0.3",
"telnet-client": "^2.2.13",
"xml2js": "^0.6.2",
"yaml": "^2.8.2"
"yaml": "^2.9.0"
},
"engines": {
"node": "22"
@@ -67,7 +67,7 @@
"convert-images": "node tools/convert-images.js",
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playground && npm install && cd ../playlet-web && npm install",
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject rooibos-roku",
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject typescript,svelte-preprocess",
"registry:write": "node tools/registry.js --input registry.json",
"registry:read": "node tools/registry.js --output registry.json",
"registry:clear": "node tools/registry.js --clear",
@@ -76,6 +76,6 @@
"shutdown": "node tools/shutdown.js"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.59.0"
"@rollup/rollup-linux-x64-gnu": "^4.60.4"
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.44.7",
"version": "0.45.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.44.7"
"version": "0.45.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.44.7",
"version": "0.45.0",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-app",
+2 -2
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=44
build_version=00007
minor_version=45
build_version=00000
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.44.7",
"version": "0.45.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.44.7"
"version": "0.45.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.44.7",
"version": "0.45.0",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
@@ -50,7 +50,7 @@ end function
function JobError(error as dynamic) as void
error = ErrorUtils.Format(error)
LogError(error)
LogError(`[${m.top.subtype()}]${error}`)
callbackNode = JobGetCallbackNode()
if callbackNode = invalid
return
+6 -1
View File
@@ -115,12 +115,17 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
if info.LogType <> "http.error"
return
end if
httpCode = ValidInt(info.HttpCode)
if httpCode >= 200 and httpCode < 300
return
end if
line = FormatTime(dateTime) + "[ERROR][SysLog] " + ToString(info)
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
fingerprint = `SysLog${info.Status}${info.LogType}${info.HttpCode}${info.Method}`
fingerprint = `SysLog${info.Status}${info.LogType}${httpCode}${info.Method}`
if ThrottleEvent("SysLogError", fingerprint, 60)
return
@@ -68,8 +68,8 @@ function LoginWithInvidious() as void
DialogUtils.ShowDialogEx({
title: "No Invidious Instance"
message: [
"Playlet built-in backend does not support login yet.",
"Can only login if an Invidious instance is set in the settings."
"Playlet built-in backend does not support Invidious login.",
"Can only login with Invidious if an Invidious instance is set in the settings."
]
})
return
@@ -7,10 +7,10 @@ import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.homeLayout = {}
homeLayout = StringUtils.ParseJsonSafe(ReadAsciiFile("libpkg:/config/default_home_layout.yaml"))
for each item in homeLayout
m.homeLayout[item.id] = item
m.homeLayoutMap = {}
homeLayoutMap = StringUtils.ParseJsonSafe(ReadAsciiFile("libpkg:/config/default_home_layout.yaml"))
for each item in homeLayoutMap
m.homeLayoutMap[item.id] = item
end for
m.checkList = m.top.findNode("checkList")
@@ -81,17 +81,34 @@ function OnValueChange()
nodes = []
checkedState = []
homeLayoutMap = {}
homeLayoutMap.Append(m.homeLayoutMap)
for each item in value
feed = m.homeLayout[item.id]
feed = homeLayoutMap[item.id]
if feed = invalid
LogWarn("unknown feed id:", item.id)
continue for
end if
homeLayoutMap.Delete(item.id)
node = CreateObject("roSGNode", "ContentNode")
node.id = feed.id
node.title = Tr(feed.title)
nodes.push(node)
checkedState.push(item.enabled)
end for
for each id in homeLayoutMap
feed = homeLayoutMap[id]
if feed = invalid
LogWarn("unknown feed id:", id)
continue for
end if
node = CreateObject("roSGNode", "ContentNode")
node.id = feed.id
node.title = Tr(feed.title)
nodes.push(node)
checkedState.push(item.enabled)
checkedState.push(false)
end for
labelCount = content.getChildCount()
@@ -7,9 +7,11 @@ import "pkg:/source/utils/UrlUtils.bs"
class DashManifest
public invidiousInstance as dynamic
public disableAutoDubbed as boolean
function new(invidiousInstance as string)
function new(invidiousInstance as string, disableAutoDubbed = false as boolean)
m.invidiousInstance = invidiousInstance
m.disableAutoDubbed = disableAutoDubbed
m.utils = new Http.Utils()
@@ -279,6 +281,9 @@ class DashManifest
function GenerateAudioAdaptationSets(xml as object, audioGroups as object, id as integer, metadata as object) as integer
for each group in audioGroups
firstFormat = group[0]
if m.disableAutoDubbed and ValidBool(firstFormat.isAutoDubbed)
continue for
end if
hoisted = {}
adaptationSetAttributes = {
@@ -1,23 +1,23 @@
const PLAYLET_SUPPORT_SERVER = "https://playlet-v8556.ondigitalocean.app"
const VIDEO_PLAYER_USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
const VIDEO_PLAYER_USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0"
const INNERTUBE_IOS_CLIENT_NAME = "5"
const INNERTUBE_IOS_CLIENT_VERSION = "20.39.4"
const INNERTUBE_IOS_CLIENT_VERSION = "21.16.2"
const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2"
const INNERTUBE_IOS_OS_VERSION = "18.1"
const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/20.39.4 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X)"
const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/21.16.2 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X)"
const INNERTUBE_WEB_BROWSER_NAME = "Chrome"
const INNERTUBE_WEB_BROWSER_VERSION = "140.0.0.0"
const INNERTUBE_WEB_BROWSER_VERSION = "147.0.0.0"
const INNERTUBE_WEB_CLIENT_NAME = "1"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250927.00.01"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20260424.01.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"
const INNERTUBE_TV_BROWSER_NAME = "SamsungBrowser"
const INNERTUBE_TV_BROWSER_VERSION = "9.2"
const INNERTUBE_TV_CLIENT_NAME = "2"
const INNERTUBE_TV_CLIENT_VERSION = "7.20251015.07.00"
const INNERTUBE_TV_CLIENT_VERSION = "7.20260422.12.00"
const INNERTUBE_TV_DEVICE_MAKE = "Samsung"
const INNERTUBE_TV_DEVICE_MODEL = "SmartTV"
const INNERTUBE_TV_OS_NAME = "Tizen"
@@ -363,8 +363,6 @@ namespace InnertubeService
accessToken = OptionUtils.Get(options, "accessToken")
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
cpn = OptionUtils.Get(options, "cpn")
cmt = OptionUtils.GetOrDefault(options, "cmt", 0)
cmtStr = cmt.ToStr("%.3f")
videostatsPlaybackUrl = videostatsPlaybackUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
@@ -372,8 +370,9 @@ namespace InnertubeService
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cmt"] = "0"
queryParams["cpn"] = cpn
queryParams["cmt"] = cmtStr
queryParams["final"] = "1"
videostatsPlaybackUrl = UrlUtils.SetQueryParams(videostatsPlaybackUrl, queryParams)
request = HttpClient.Get(videostatsPlaybackUrl)
@@ -395,15 +394,13 @@ namespace InnertubeService
return true
end function
function AuthMarkVideoWatchTime(startTime as float, endTime as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
function AuthMarkVideoWatchTime(time as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
cancellation = OptionUtils.Get(options, "cancellation")
accessToken = OptionUtils.Get(options, "accessToken")
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
timeStr = time.ToStr("%.3f")
cpn = OptionUtils.Get(options, "cpn")
cmt = OptionUtils.GetOrDefault(options, "cmt", 0)
cmtStr = cmt.ToStr("%.3f")
stStr = startTime.ToStr("%.3f")
etStr = endTime.ToStr("%.3f")
videostatsWatchtimeUrl = videostatsWatchtimeUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsWatchtimeUrl)
@@ -412,9 +409,10 @@ namespace InnertubeService
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cpn"] = cpn
queryParams["cmt"] = cmtStr
queryParams["st"] = stStr
queryParams["et"] = etStr
queryParams["cmt"] = "0"
queryParams["st"] = timeStr
queryParams["et"] = timeStr
queryParams["final"] = "1"
videostatsWatchtimeUrl = UrlUtils.SetQueryParams(videostatsWatchtimeUrl, queryParams)
request = HttpClient.Get(videostatsWatchtimeUrl)
@@ -432,7 +430,7 @@ namespace InnertubeService
return false
end if
LogDebug("Marked video watch time:", stStr, "-", etStr)
LogDebug("Marked video watch time:", timeStr)
return true
end function
@@ -218,7 +218,7 @@ namespace Innertube
playlistId = ObjectUtils.Dig(primaryInfo, ["navigationEndpoint", "watchEndpoint", "playlistId"])
title = ParseText(ObjectUtils.Dig(primaryInfo, ["title"]))
description = ParseText(ObjectUtils.Dig(primaryInfo, ["description"]))
videoCount = ParseText(ObjectUtils.Dig(primaryInfo, ["stats", 0, "runs", 0, "text"])).ToInt()
videoCount = ParseText(ObjectUtils.Dig(primaryInfo, ["stats", 0, "runs", 0, "text"])).Replace(",", "").ToInt()
thumbnail = ObjectUtils.Dig(primaryInfo, ["thumbnailRenderer", "playlistVideoThumbnailRenderer", "thumbnail", "thumbnails", 0, "url"])
author = ParseText(ObjectUtils.Dig(secondaryInfo, ["videoOwner", "videoOwnerRenderer", "title"]))
@@ -13,8 +13,6 @@ namespace Innertube
cancellation = OptionUtils.Get(options, "cancellation")
visitorData = OptionUtils.Get(options, "visitorData")
accessToken = OptionUtils.Get(options, "accessToken")
doSignatureTimestamp = ValidBool(OptionUtils.Get(options, "signatureTimestamp"))
cpn = InnertubeService.CreateClientPlaybackNonce()
useAccessToken = client = Innertube.ClientType.TV and not StringUtils.IsNullOrEmpty(accessToken)
@@ -52,12 +50,9 @@ namespace Innertube
"contentCheckOk": true
}
signatureTimestamp = invalid
if doSignatureTimestamp
signatureTimestamp = GetSignatureTimestamp(cancellation)
if signatureTimestamp <> invalid
payload["playbackContext"]["contentPlaybackContext"]["signatureTimestamp"] = signatureTimestamp
end if
signatureTimestamp = GetSignatureTimestamp(cancellation)
if signatureTimestamp <> invalid
payload["playbackContext"]["contentPlaybackContext"]["signatureTimestamp"] = signatureTimestamp
end if
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/player?prettyPrint=false&alt=json", payload)
@@ -1,5 +1,5 @@
' Auto-generated file - do not modify manually
' md5:252058d604a761c9fd33d800fce1b72b
' md5:1dc03998a561a4b1270454e10a4d7ead
import "pkg:/source/Protobuf/BinaryReader.bs"
import "pkg:/source/Protobuf/BinaryWriter.bs"
@@ -69,6 +69,7 @@ class LoungeApi
commandHandlers[COMMAND_TYPE_GET_RECEIVER_STATUS] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_SEND_DEBUG_COMMAND] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_SET_AUTOPLAY_MODE] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_GET_PARTY_GAMES_MODE] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_GET_NOW_PLAYING] = m.HandleGetPlayingNow
commandHandlers[COMMAND_TYPE_SESSION_ID] = m.HandleSessionId
@@ -84,6 +85,7 @@ class LoungeApi
commandHandlers[COMMAND_TYPE_NEXT] = m.HandleNext
commandHandlers[COMMAND_TYPE_STOP_VIDEO] = m.HandleStopVideo
commandHandlers[COMMAND_TYPE_SEEK_TO] = m.HandleSeekTo
commandHandlers[COMMAND_TYPE_SET_PLAYBACK_SPEED] = m.HandleSetPlaybackSpeed
for each key in commandHandlers
m[COMMAND_HANDLER_PREFIX + key] = commandHandlers[key]
@@ -176,7 +178,7 @@ class LoungeApi
queryParams = {
"device": "LOUNGE_SCREEN"
"theme": "cl"
"capabilities": ""
"capabilities": "vsp"
"mdxVersion": "2"
"VER": "8"
"v": "2"
@@ -224,7 +226,7 @@ class LoungeApi
queryParams = {
"device": "LOUNGE_SCREEN"
"theme": "cl"
"capabilities": ""
"capabilities": "vsp"
"mdxVersion": "2"
"VER": "8"
"v": "2"
@@ -490,6 +492,48 @@ class LoungeApi
player.seek = seekTo
end function
function HandleSetPlaybackSpeed(_commandId as integer, _commandType as string, commandArgs as object, messagesToSend as object) as void
player = m.videoQueueNode.player
if player = invalid
return
end if
if not player.hasField("playbackSpeed")
LogWarn("Video node does not support 'playbackSpeed' field on this device, ignoring setPlaybackSpeed command")
return
end if
speed = Val(commandArgs[FIELD_PLAYBACK_SPEED])
if speed <= 0
speed = 1.0
end if
currentSpeed = ValidFloat(player.playbackSpeed)
if Abs(currentSpeed - speed) < 0.001
LogDebug("Playback speed is already close to the requested speed. current:", currentSpeed, "requested:", speed)
return
end if
LogInfo("Setting playback speed to:", speed)
' Usually playbackSpeed doesn't get applied without pausing and resuming.
didPause = false
state = player.state
if state = "playing"
player.control = "pause"
didPause = true
end if
player.playbackSpeed = speed
if didPause
player.control = "resume"
end if
messagesToSend.Push(LoungeMessages.OnPlaybackSpeedChanged(speed, true))
end function
function SendMessages(messages as object, loungeData = invalid as object) as void
if messages.Count() = 0
return
@@ -498,7 +542,7 @@ class LoungeApi
queryParams = {
"device": "LOUNGE_SCREEN"
"theme": "cl"
"capabilities": ""
"capabilities": "vsp"
"mdxVersion": "2"
"VER": "8"
"v": "2"
@@ -3,6 +3,7 @@ const COMMAND_NOW_PLAYING = "nowPlaying"
const COMMAND_ON_STATE_CHANGE = "onStateChange"
const COMMAND_ON_VOLUME_CHANGED = "onVolumeChanged"
const COMMAND_ON_PREVIOUS_NEXT_CHANGE = "onHasPreviousNextChanged"
const COMMAND_ON_PLAYBACK_SPEED_CHANGED = "onPlaybackSpeedChanged"
const COMMAND_LOUNGE_SCREEN_DISCONNECTED = "loungeScreenDisconnected"
' Incoming commands
const COMMAND_TYPE_SET_PLAYLIST = "setPlaylist"
@@ -12,6 +13,7 @@ const COMMAND_TYPE_REMOTE_DISCONNECTED = "remoteDisconnected"
const COMMAND_TYPE_GET_NOW_PLAYING = "getNowPlaying"
const COMMAND_TYPE_GET_VOLUME = "getVolume"
const COMMAND_TYPE_GET_SUBTITLES_TRACK = "getSubtitlesTrack"
const COMMAND_TYPE_GET_PARTY_GAMES_MODE = "getPartyGamesMode"
const COMMAND_TYPE_UPDATE_PLAYLIST = "updatePlaylist"
const COMMAND_TYPE_NOOP = "noop"
const COMMAND_TYPE_PLAY = "play"
@@ -31,6 +33,7 @@ const COMMAND_TYPE_GRACEFUL_RECONNECT = "gracefulReconnect"
const COMMAND_TYPE_GET_RECEIVER_STATUS = "getReceiverStatus"
const COMMAND_TYPE_SEND_DEBUG_COMMAND = "sendDebugCommand"
const COMMAND_TYPE_SET_AUTOPLAY_MODE = "setAutoplayMode"
const COMMAND_TYPE_SET_PLAYBACK_SPEED = "setPlaybackSpeed"
' Special commands
const COMMAND_TYPE_SESSION_ID = "c"
const COMMAND_TYPE_G_SESSION_ID = "S"
@@ -64,6 +67,8 @@ const FIELD_SEEKABLE_END_TIME = "seekableEndTime"
const FIELD_HAS_PREVIOUS = "hasPrevious"
const FIELD_HAS_NEXT = "hasNext"
const FIELD_NEW_TIME = "newTime"
const FIELD_PLAYBACK_SPEED = "playbackSpeed"
const FIELD_PLAYBACK_SPEED_INFO = "playbackSpeedInfo"
enum PlayerState
UNSTARTED = -1
@@ -15,6 +15,20 @@ namespace LoungeMessages
return message
end function
function OnPlaybackSpeedChanged(speed as float, isContentSupportVSP as boolean) as object
message = {
commandType: COMMAND_ON_PLAYBACK_SPEED_CHANGED
}
commandArgs = {}
commandArgs[FIELD_PLAYBACK_SPEED] = speed
commandArgs[FIELD_PLAYBACK_SPEED_INFO] = FormatJson({
"playbackSpeed": speed
"isContentSupportVSP": isContentSupportVSP
})
message.commandArgs = commandArgs
return message
end function
function OnStateChange(player as object, overrides = invalid as object) as object
message = {
commandType: COMMAND_ON_STATE_CHANGE
@@ -171,7 +171,9 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
end if
filteredLayout.Push(item)
end for
userPrefs["misc.home_screen_layout"] = filteredLayout
if filteredLayout.Count() > 0
userPrefs["misc.home_screen_layout"] = filteredLayout
end if
userPrefs.__version = 6
isDirty = true
end if
@@ -15,7 +15,7 @@ end function
function OnNodeReady() as void
m.top.ObserveField("enabled", FuncName(OnEnabledChanged))
m.preferences.ObserveFieldScoped("dev.diagnostics.enabled", FuncName(OnPreferencesChanged))
enabled = m.preferences["dev.diagnostics.enabled"]
enabled = ValidBool(m.preferences["dev.diagnostics.enabled"])
OnPreferencesChanged({
enabled: enabled
getData: function() as boolean
@@ -4,7 +4,7 @@ import "pkg:/source/utils/StringUtils.bs"
namespace Lounge
function SendNowPlayingLoading(videoId as dynamic) as void
function SendNowPlayingLoading(videoId as dynamic, playbackSpeed as float) as void
if StringUtils.IsNullOrEmpty(m.loungeService.loungeToken)
return
end if
@@ -16,7 +16,9 @@ namespace Lounge
overrides[FIELD_VIDEO_ID] = videoId
end if
nowPlayingMsg = LoungeMessages.NowPlaying(m.top, overrides)
m.loungeService.outgoingMessages = [nowPlayingMsg, loungeStateMsg]
' Sending playback speed to indicate that we will reset it to 1.0 when the content starts playing
playbackSpeedMsg = LoungeMessages.OnPlaybackSpeedChanged(playbackSpeed, true)
m.loungeService.outgoingMessages = [nowPlayingMsg, loungeStateMsg, playbackSpeedMsg]
end function
function SendOnStateChange() as void
@@ -74,7 +74,6 @@ function ExecuteJob() as void
MessagePortUtils.ObserveFieldScopedExSafe(callbackNode, "watchTime", port)
CancellationUtils.ObserveCancellationScoped(cancellation, port)
successiveFailures = 0
lastReportedTime = 0.0
while true
message = wait(60000, port)
if CancellationUtils.IsCancellationEvent(cancellation, message)
@@ -97,27 +96,17 @@ function ExecuteJob() as void
end while
watchTime = message.getData()
' On seek-back, clamp st to not exceed et - I don't know if we really need to
if lastReportedTime > watchTime
lastReportedTime = watchTime - 20
if lastReportedTime < 0
lastReportedTime = 0
end if
end if
success = InnertubeService.AuthMarkVideoWatchTime(lastReportedTime, watchTime, playbackTrackingUrls.videostatsWatchtimeUrl, {
success = InnertubeService.AuthMarkVideoWatchTime(watchTime, playbackTrackingUrls.videostatsWatchtimeUrl, {
accessToken: authToken.token
onBehalfOfUser: authToken.activeIdentifyToken
cpn: cpn
' TODO:P1 if we pass cancellation here, http client will remove scoped
' observer, which is stored on the current node.
' This requires an extra observer node to be independent.
cmt: lastReportedTime
cancellation: invalid
})
if success
successiveFailures = 0
lastReportedTime = watchTime
else
successiveFailures += 1
end if
@@ -61,7 +61,6 @@ function ExecuteJob() as void
"visitorData": visitorData
"accessToken": accessToken
"onBehalfOfUser": onBehalfOfUser
"signatureTimestamp": true
})
else
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
@@ -164,7 +164,12 @@ function PlayWithContent(contentNode as object)
end if
StartVideoContentJob(videoContentNode)
Lounge.SendNowPlayingLoading(contentNode.videoId)
playbackSpeed = ValidFloat(m.top.playbackSpeed)
if playbackSpeed <= 0
playbackSpeed = 1.0
end if
Lounge.SendNowPlayingLoading(contentNode.videoId, playbackSpeed)
end function
function StartVideoContentJob(videoContentNode as object)
@@ -12,6 +12,7 @@ namespace Http
m.videoQueueNode = server.sceneNodes.videoQueue
m.invidiousNode = server.sceneNodes.invidious
m.preferencesNode = server.sceneNodes.preferences
m.invidiousService = new Invidious.InvidiousService(m.invidiousNode)
' No need to pass the invidious instance here, we will refresh it for
' each request to make sure we are using the latest one
@@ -51,6 +52,7 @@ namespace Http
end if
m.dashManifest.invidiousInstance = m.invidiousService.GetInstance()
m.dashManifest.disableAutoDubbed = ValidBool(m.preferencesNode["playback.disable_auto_dubbed"])
qualityFilter = m.CreateQualityFilter(quality)
xmlContent = m.dashManifest.FromVideoMetadata(metadata, qualityFilter, ValidString(local) = "true")
@@ -56,17 +56,13 @@ namespace Http
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
"disableShorts": m.preferences["content_feed.disable_shorts"]
}
@@ -117,12 +113,8 @@ namespace Http
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
@@ -135,17 +127,13 @@ namespace Http
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
}
activeIdentifyToken = request.query.activeIdentifyToken
@@ -187,17 +175,13 @@ namespace Http
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
}
activeIdentifyToken = request.query.activeIdentifyToken
@@ -274,17 +258,13 @@ namespace Http
request = context.request
response = context.response
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
"disableShorts": m.preferences["content_feed.disable_shorts"]
}
@@ -584,7 +564,6 @@ namespace Http
}
end if
else
options["signatureTimestamp"] = true
options["credentialTransferToken"] = m.loungeService.credentialTransferToken
metadata = InnertubeService.GetVideoMetadata(videoId, options)
end if
@@ -625,9 +604,9 @@ namespace Http
raw: raw
}
accessToken = request.headers["authorization"]
if not StringUtils.IsNullOrEmpty(accessToken) and accessToken.StartsWith("Bearer ")
options["accessToken"] = accessToken.Mid("Bearer ".Len())
accessToken = m.GetAccessToken(request)
if accessToken <> invalid
options["accessToken"] = accessToken
activeIdentifyToken = request.query.activeIdentifyToken
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
@@ -693,12 +672,8 @@ namespace Http
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
@@ -851,12 +826,8 @@ namespace Http
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
@@ -874,7 +845,7 @@ namespace Http
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
}
activeIdentifyToken = request.query.activeIdentifyToken
@@ -911,12 +882,8 @@ namespace Http
response = context.response
route = request.route
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
response.Json({
"error": "Missing or invalid 'Authorization' header"
})
response.http_code = 403
accessToken = m.RequireAccessToken(request, response)
if accessToken = invalid
return true
end if
@@ -934,7 +901,7 @@ namespace Http
end if
options = {
"accessToken": accessToken.Mid("Bearer ".Len())
"accessToken": accessToken
}
activeIdentifyToken = request.query.activeIdentifyToken
@@ -1014,6 +981,29 @@ namespace Http
return true
end function
function GetAccessToken(request as object) as dynamic
accessToken = request.headers["authorization"]
if StringUtils.IsNullOrEmpty(accessToken) or not accessToken.StartsWith("Bearer ")
return invalid
end if
return accessToken.Mid("Bearer ".Len())
end function
function RequireAccessToken(request as object, response as object) as dynamic
accessToken = m.GetAccessToken(request)
if accessToken = invalid
response.Json({
"error": "Missing or invalid 'Authorization' header. Please login again."
})
response.http_code = 403
return invalid
end if
return accessToken
end function
end class
end namespace
@@ -83,10 +83,10 @@ namespace Web
for i = 7 to 0 step -1
m.payload_size_buffer[i] = payloadSize and &hFF
payloadSize = payloadSize >> 8
next
end for
for i = 0 to 7
m.WriteByte(m.payload_size_buffer[i])
next
end for
end if
end function
+7
View File
@@ -27,6 +27,13 @@
visibility: "web",
svelteComponent: "EditQualityControl",
},
{
displayText: "Disable auto-dubbed audio",
key: "playback.disable_auto_dubbed",
description: "Remove AI-generated dubbed audio tracks.",
type: "boolean",
defaultValue: false,
},
],
},
{
@@ -800,6 +800,14 @@
<source>Feed preferences</source>
<translation>Feed preferences</translation>
</message>
<message>
<source>Disable auto-dubbed audio</source>
<translation>Disable auto-dubbed audio</translation>
</message>
<message>
<source>Remove AI-generated dubbed audio tracks.</source>
<translation>Remove AI-generated dubbed audio tracks.</translation>
</message>
<message>
<source>Disable Shorts</source>
<translation>Disable Shorts</translation>
+2 -2
View File
@@ -2,8 +2,8 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=44
build_version=00007
minor_version=45
build_version=00000
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+9 -10
View File
@@ -1,6 +1,7 @@
namespace DebugUtils
function PrintStackTrace(message = invalid as dynamic)
#if DEBUG
#if DEBUG
namespace DebugUtils
function PrintStackTrace(message = invalid as dynamic)
try
throw "Handled throw in DebugUtils.PrintStackTrace()"
catch error
@@ -15,11 +16,9 @@ namespace DebugUtils
end for
PrintInABox(lines)
end try
#end if
end function
end function
function PrintInABox(lines as object)
#if DEBUG
function PrintInABox(lines as object)
maxLen = 0
for each line in lines
if line.len() > maxLen
@@ -32,6 +31,6 @@ namespace DebugUtils
end for
out += `\n` + "╚" + string(maxLen + 2, "═") + "╝"
print out
#end if
end function
end namespace
end function
end namespace
#end if
@@ -26,14 +26,14 @@ function DisposeObservers()
if m._disposableObserveFields <> invalid
for each item in m._disposableObserveFields
item.node.UnobserveField(item.field)
next
end for
m._disposableObserveFields = invalid
end if
if m._disposableObserveFieldsScoped <> invalid
for each item in m._disposableObserveFieldsScoped
item.node.UnobserveFieldScoped(item.field)
next
end for
m._disposableObserveFieldsScoped = invalid
end if
end function
+3
View File
@@ -253,6 +253,9 @@ namespace Locale
PreferredQualityDescription = "Preferred video quality"
AutoQuality = "Auto"
DisableAutoDubbedAudio = "Disable auto-dubbed audio"
DisableAutoDubbedAudioDescription = "Remove AI-generated dubbed audio tracks."
Backend = "Backend"
BackendPreferences = "Backend preferences"
SelectedBackend = "Selected backend"
+333 -307
View File
File diff suppressed because it is too large. Load diff
+14 -14
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.44.7",
"version": "0.45.0",
"type": "module",
"scripts": {
"dev": "vite",
@@ -9,27 +9,27 @@
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/postcss": "^4.3.0",
"@tailwindcss/typography": "^0.5.19",
"@tsconfig/svelte": "^5.0.8",
"@vitejs/plugin-legacy": "^8.0.0",
"autoprefixer": "^10.4.27",
"@vitejs/plugin-legacy": "^8.0.2",
"autoprefixer": "^10.5.0",
"bgutils-js": "^3.2.0",
"daisyui": "^5.5.19",
"dotenv": "^17.3.1",
"daisyui": "^5.5.20",
"dotenv": "^17.4.2",
"ip": "^2.0.1",
"jszip": "^3.10.1",
"postcss": "^8.5.8",
"postcss": "^8.5.15",
"rollup-plugin-visualizer": "^7.0.1",
"svelte": "^5.54.0",
"svelte-check": "^4.4.5",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^4.2.2",
"terser": "^5.46.1",
"svelte": "^5.55.9",
"svelte-check": "^4.4.8",
"svelte-preprocess": "6.0.3",
"tailwindcss": "^4.3.0",
"terser": "^5.48.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"vite": "^8.0.1",
"vite": "^8.0.14",
"vite-plugin-compression": "^0.5.1",
"youtubei.js": "^17.0.1"
}
+6 -4
View File
@@ -1,8 +1,10 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node"
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": ["vite.config.ts"]
}
"include": [
"vite.config.ts"
]
}
+1 -1
View File
@@ -260,7 +260,7 @@ end function`;
bsfmtPath: bsfmtPath
});
return new Formatter(options);
return new Formatter(options ?? undefined);
}
getCurrentFileHash() {
+3
View File
@@ -44,6 +44,9 @@ export class ValidationPlugin implements CompilerPlugin {
this.validation.forEach((validation) => {
const regex = validation.regexObject;
if (!regex) {
return;
}
const fileContents = file.fileContents;
let match: RegExpExecArray | null;
+2 -1
View File
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "ES6",
"moduleResolution": "Node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true
}
}