Compare commits

..
28 Commits
Author SHA1 Message Date
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
Brahim Hadriche 16df893c2c Release v0.44.7 (#845) 2026-04-23 08:52:58 -04:00
Brahim Hadriche 6129afd695 [chore] update dependencies (#835)
* update dependencies

* Disable memory related telemetry warnings
2026-04-23 08:45:41 -04:00
Brahim Hadriche 84504a5931 fix channel sort 2026-04-08 19:33:27 -04:00
Brahim Hadriche 0123f9fa8e [chore] update dependencies (#832)
* update dependencies

* Update deps and fix
2026-03-18 09:15:04 -04:00
Brahim Hadriche 7227d4e26b Fix for watch progress 2026-03-10 21:07:36 -04:00
Brahim Hadriche 58fe601b25 Release v0.44.6 (#828) 2026-02-08 12:55:16 -05:00
Brahim Hadriche a61d132b57 update dependencies (#825) 2026-02-08 12:55:06 -05:00
Brahim Hadriche ee4acfc8e7 [skip ci] Add February 2026 update link to README 2026-02-08 11:39:20 -05:00
Brahim Hadriche fcd798a2fa update dependencies (#817) 2026-01-31 17:58:42 -05:00
Brahim Hadriche f5be0e5842 Close dialog on play state success (#821) 2026-01-31 17:57:46 -05:00
Brahim Hadriche 2d9f3abe5d Fix audio track display names (#820) 2026-01-31 17:56:51 -05:00
Brahim Hadriche 69fe737006 Release v0.44.5 (#814) 2026-01-17 14:04:46 -05:00
Brahim Hadriche ac6c9122c2 update dependencies (#800) 2026-01-17 13:56:27 -05:00
Brahim Hadriche d3e0883332 Fix/ytjs missing urls (#811)
* ytjs fix

* ignore shoppingTimelyShelfViewModel
2026-01-08 19:30:47 -05:00
Brahim Hadriche 5c39405255 [chore] update dependencies (#799)
* update dependencies

* Update CHANGELOG.md
2025-11-30 20:33:18 -05:00
Brahim Hadriche 6535006d66 Release v0.44.4 (#798) 2025-11-23 14:07:41 -05:00
Brahim Hadriche a43cb91e1e update dependencies (#796) 2025-11-23 13:21:11 -05:00
Brahim Hadriche 58ce807e42 Fix subscriptions looping instead of loading older videos (#797) 2025-11-23 13:20:49 -05:00
Brahim Hadriche 2319ae7025 [skip ci] update invidious readme 2025-11-16 09:23:27 -05:00
Brahim Hadriche 1f2058abce Remove Trending endpoints from code base 2025-11-16 09:16:03 -05:00
Brahim Hadriche aadbde330d update dependencies (#795) 2025-11-15 16:39:02 -05:00
Brahim Hadriche 60df07c95c [skip ci] missing lock file 2025-11-15 16:38:54 -05:00
Brahim Hadriche 71757bb9d5 [skip ci] add readme 2025-11-15 14:57:07 -05:00
Brahim Hadriche 630176d8aa [skip ci] Add playground 2025-11-15 14:53:09 -05:00
Brahim Hadriche 03c7f9afe6 [skip ci] changelog 2025-11-14 22:22:50 -05:00
59 changed files with 1906 additions and 3226 deletions

No files matched your search

+23
View File
@@ -76,6 +76,29 @@
"args": "--log-level info --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"cwd": "${workspaceFolder}/playlet-lib",
"console": "integratedTerminal"
},
{
"name": "Playground",
"type": "brightscript",
"request": "launch",
"envFile": "${workspaceFolder}/.env",
"host": "${env:ROKU_DEV_TARGET}",
"password": "${env:ROKU_DEVPASSWORD}",
"stopOnEntry": false,
"enableDebuggerAutoRecovery": false,
"stopDebuggerOnAppExit": false,
"rootDir": "${workspaceFolder}/build/playground",
"sourceDirs": [
"${workspaceFolder}/playground/src"
],
"files": [
"**"
],
"preLaunchTask": "build-playground",
"injectRdbOnDeviceComponent": true,
"injectRaleTrackerTask": true,
"raleTrackerTaskFileLocation": "${workspaceFolder}/tools/RALE/TrackerTask.xml",
"enableDebugProtocol": true
}
],
"compounds": [
+5
View File
@@ -49,6 +49,11 @@
"label": "build-web",
"script": "build:web",
"type": "npm"
},
{
"label": "build-playground",
"script": "build:playground",
"type": "npm"
}
]
}
+37
View File
@@ -5,6 +5,43 @@ 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.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
- Attempt to fix watch history and watch progress
- Channel sort
## [0.44.6] - 2026-02-08
### Fixed
- Error dialog doesn't close automatically when playback recovers after an error
- All audio track names are shown as "Other" in multi audio track videos
## [0.44.5] - 2026-01-17
### Fixed
- Error handling when ytjs formats have missing urls
## [0.44.4] - 2025-11-23
### Fixed
- Subscriptions looping instead of loading older videos
### Removed
- Trending endpoints from code base
## [0.44.3] - 2025-11-14
### Fixed
+3
View File
@@ -27,6 +27,9 @@
Playlet is an unofficial YouTube client for Roku 📺
**[Playlet February 2026 Update](https://github.com/iBicha/playlet/discussions/827)**
## Screenshots
<a href="./docs/screenshots/README.md">
+168 -1201
View File
File diff suppressed because it is too large. Load diff
+16 -15
View File
@@ -1,38 +1,38 @@
{
"name": "playlet",
"version": "0.44.3",
"version": "0.44.8",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.38",
"@rokucommunity/bslint": "^0.8.39",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^24.10.0",
"@types/node": "^25.5.0",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.70.3",
"brighterscript-formatter": "^1.7.19",
"brighterscript-formatter": "^1.7.21",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^17.2.3",
"fs-extra": "^11.3.2",
"glob": "^11.0.3",
"dotenv": "^17.3.1",
"fs-extra": "^11.3.4",
"glob": "^13.0.6",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.9.0",
"mailparser": "^3.9.4",
"protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.29.1",
"roku-deploy": "^3.14.4",
"puppeteer": "^24.40.0",
"roku-deploy": "^3.16.2",
"roku-test-automation": "^2.2.1",
"rooibos-roku": "5.15.5",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.7.3",
"semver": "^7.7.4",
"shelljs": "^0.10.0",
"ts-node": "^10.9.2",
"typescript": "5.9.3",
"telnet-client": "^2.2.6",
"telnet-client": "^2.2.11",
"xml2js": "^0.6.2",
"yaml": "^2.8.1"
"yaml": "^2.8.2"
},
"engines": {
"node": "22"
@@ -48,6 +48,7 @@
"build:lib:dev": "cd playlet-lib && npm run build:dev",
"build:lib:prod": "cd playlet-lib && npm run build:prod",
"build:web": "cd playlet-web && npm run build",
"build:playground": "cd playground && npm run build",
"lint": "cd playlet-lib && npm run lint && cd ../playlet-app && npm run lint && cd ../playlet-web && npm run lint",
"lint:fix": "cd playlet-lib && npm run lint:fix && cd ../playlet-app && npm run lint:fix && cd ../playlet-web && npm run lint",
"format": "cd playlet-lib && npm run format && cd ../playlet-app && npm run format",
@@ -65,7 +66,7 @@
"screenshot": "node tools/screenshot.js",
"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 ../playlet-web && npm install",
"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",
"registry:write": "node tools/registry.js --input registry.json",
"registry:read": "node tools/registry.js --output registry.json",
@@ -75,6 +76,6 @@
"shutdown": "node tools/shutdown.js"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.53.1"
"@rollup/rollup-linux-x64-gnu": "^4.59.0"
}
}
+7
View File
@@ -0,0 +1,7 @@
# Playground
Playground is a test project to try things out or iterate on a concept.
Playlet app relies on playlet lib, and playlet lib relies on web app, so sometimes iteration speed can be slower when building everything everytime.
Just like Playlet, Playground can be launched from the VSCode "Run and debug" menu.
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../config/bsconfig.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playground",
"outFile": "../dist/playground.zip"
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "bsconfig.json",
"createPackage": false,
"deploy": false,
"retainStagingDir": false,
"sourceMap": false
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../config/bsconfig.tests.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playground-tests",
"outFile": "../build/playground-tests.zip"
}
+12
View File
@@ -0,0 +1,12 @@
{
"name": "playground",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playground",
"version": "0.1.0"
}
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"name": "playground",
"version": "0.1.0",
"description": "A playground for testing Roku development",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playground",
"build": "bsc --debug --create-package --sourceMap=true --lintConfig ../config/bslint.jsonc",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" --bsfmt-path ../config/bsfmt.jsonc",
"format": "npm run format:base -- --check",
"format:fix": "npm run format:base -- --write",
"test": "npm run test:build && npm run test:run",
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"test:run": "node ../tools/run-test-app.js --package ../build/playground-tests.zip"
}
}
+3
View File
@@ -0,0 +1,3 @@
function Init()
print "Playground Init"
end function
+10
View File
@@ -0,0 +1,10 @@
<component name="Playground" extends="Scene">
<interface>
<field id="exitChannel" type="bool" alwaysNotify="true" />
<field id="launchArgs" type="assocarray" />
<field id="inputArgs" type="assocarray" alwaysNotify="true" />
</interface>
<children>
<Label text="Welcome to Playlet Playground!" />
</children>
</component>
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+31
View File
@@ -0,0 +1,31 @@
title=Playlet Playground
major_version=0
minor_version=1
build_version=00000
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
## Channel Assets
### Main Menu Icons / Channel Poster Artwork
#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 246x140px
mm_icon_focus_fhd=pkg:/images/channel-poster_fhd.png
mm_icon_focus_hd=pkg:/images/channel-poster_hd.png
mm_icon_focus_sd=pkg:/images/channel-poster_sd.png
### Splash Screen + Loading Screen Artwork
#### Image sizes are FHD: 1920x1080px | HD: 1280x720px | SD: 720x480px
splash_screen_fhd=pkg:/images/splash-screen_fhd.jpg
splash_screen_hd=pkg:/images/splash-screen_hd.jpg
splash_screen_sd=pkg:/images/splash-screen_sd.jpg
splash_color=#242424
splash_min_time=0
confirm_partner_button=1
supports_input_launch=1
requires_widevine_drm=1
requires_widevine_version=1.0
+56
View File
@@ -0,0 +1,56 @@
' Playlet (App to play videos from an Invidious server on Roku TVs)
' Copyright (C) 2025 Brahim Hadriche
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU Affero General Public License for more details.
' You should have received a copy of the GNU Affero General Public License
' along with this program. If not, see <https://www.gnu.org/licenses/>.
function Main(args as object) as void
screen = CreateObject("roSGScreen")
port = CreateObject("roMessagePort")
screen.setMessagePort(port)
scene = screen.CreateScene("Playground")
screen.show()
scene.ObserveField("exitChannel", port)
scene.launchArgs = args
input = CreateObject("roInput")
input.setMessagePort(port)
' The following comment is to enable the SceneGraph inspector
' on the VSCode BrightScript plugin.
' vscode_rdb_on_device_component_entry
' The following comment is to enable RALE tracking
' vscode_rale_tracker_entry
while true
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
return
end if
else if msgType = "roSGNodeEvent"
field = msg.getField()
data = msg.getData()
if field = "exitChannel" and data = true
return
end if
else if msgType = "roInputEvent"
scene.inputArgs = msg.getInfo()
end if
end while
end function
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.44.3",
"version": "0.44.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.44.3"
"version": "0.44.8"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.44.3",
"version": "0.44.8",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-app",
+1 -1
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=44
build_version=00003
build_version=00008
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.44.3",
"version": "0.44.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.44.3"
"version": "0.44.8"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.44.3",
"version": "0.44.8",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
+10 -10
View File
@@ -145,11 +145,11 @@ function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logs
return
end if
LogTelemetryEvent({
level: "warning"
message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
fingerprint: [message]
})
' LogTelemetryEvent({
' level: "warning"
' message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
' fingerprint: [message]
' })
end function
function OnLineLogDeviceInfoMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
@@ -168,11 +168,11 @@ function OnLineLogDeviceInfoMemoryWarning(event as object, dateTime as object, l
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
LogTelemetryEvent({
level: "warning"
message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
fingerprint: [message]
})
' LogTelemetryEvent({
' level: "warning"
' message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
' fingerprint: [message]
' })
end function
' Returns true if the event should be throttled
@@ -324,7 +324,7 @@ end function
function CanFetchWithCors(instance as string, testNode as object, cancellation as object) as void
try
url = `${instance}/api/v1/trending`
url = `${instance}/api/v1/popular`
response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess()
@@ -289,8 +289,13 @@ class DashManifest
"contentType": "audio"
}
if IsAssociativeArray(firstFormat.audioTrack) and IsString(firstFormat.audioTrack.languageCode)
adaptationSetAttributes["lang"] = firstFormat.audioTrack.languageCode
if IsAssociativeArray(firstFormat.audioTrack)
if IsString(firstFormat.audioTrack.languageCode)
adaptationSetAttributes["lang"] = firstFormat.audioTrack.languageCode
else if IsString(firstFormat.audioTrack.id)
' ID is in the format "CODE.DIGIT" e.g. "en.4"
adaptationSetAttributes["lang"] = firstFormat.audioTrack.id.split(".")[0]
end if
end if
' Hoist common attributes
@@ -267,63 +267,6 @@ namespace InnertubeService
return Innertube.Search(query, options)
end function
function GetTrending(options = invalid as object) as object
cancellation = OptionUtils.Get(options, "cancellation")
trendingType = LCase(OptionUtils.GetOrDefault(options, "type", ""))
disableShorts = OptionUtils.GetOrDefault(options, "disableShorts", false)
raw = OptionUtils.GetOrDefault(options, "raw", false)
browseId = "FEtrending"
params = ""
if trendingType = "music"
' {"44:proto": {"3:string": "ytma_charts"}}
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
else if trendingType = "gaming"
' {"44:proto": {"3:string": "gaming_corpus_most_popular"}}
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
else if trendingType = "movies"
' {"44:proto": {"3:string": "trailers"}}
params = "4gIKGgh0cmFpbGVycw%3D%3D"
end if
request = Innertube.CreateBrowseRequest(browseId, Innertube.ClientType.WEB, { params: params })
request.Cancellation(cancellation)
if raw
request.LogCurlCommand(true)
request.NoCache()
end if
response = request.Await()
if not response.IsSuccess()
return {
error: response.ErrorMessage()
}
end if
if raw
return response.Json()
end if
feeds = Innertube.ParseResponseDataForFeeds(response.Json(), {
response: response
disableCreatorOnTheRise: true
disableShorts: disableShorts
browseId: browseId
})
result = {
feeds: feeds
}
cacheControl = Innertube.ParseResponseForCacheControl(response)
if cacheControl <> invalid
result["cache-control"] = cacheControl
end if
return result
end function
function GetHome(options = invalid as object) as object
return GetBrowseAuthenticatedPage("FEwhat_to_watch", options)
end function
@@ -419,6 +362,7 @@ namespace InnertubeService
cancellation = OptionUtils.Get(options, "cancellation")
accessToken = OptionUtils.Get(options, "accessToken")
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
cpn = OptionUtils.Get(options, "cpn")
videostatsPlaybackUrl = videostatsPlaybackUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
@@ -426,8 +370,8 @@ namespace InnertubeService
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
queryParams["cmt"] = 0
queryParams["cmt"] = "0"
queryParams["cpn"] = cpn
queryParams["final"] = "1"
videostatsPlaybackUrl = UrlUtils.SetQueryParams(videostatsPlaybackUrl, queryParams)
@@ -456,6 +400,7 @@ namespace InnertubeService
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
timeStr = time.ToStr("%.3f")
cpn = OptionUtils.Get(options, "cpn")
videostatsWatchtimeUrl = videostatsWatchtimeUrl.replace("https://s.", "https://www.")
queryParams = UrlUtils.ParseQueryComponents(videostatsWatchtimeUrl)
@@ -463,11 +408,11 @@ namespace InnertubeService
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
queryParams["ver"] = "2"
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
queryParams["cmt"] = 0
queryParams["final"] = "1"
queryParams["cpn"] = cpn
queryParams["cmt"] = "0"
queryParams["st"] = timeStr
queryParams["et"] = timeStr
queryParams["final"] = "1"
videostatsWatchtimeUrl = UrlUtils.SetQueryParams(videostatsWatchtimeUrl, queryParams)
request = HttpClient.Get(videostatsWatchtimeUrl)
@@ -86,6 +86,7 @@ namespace Innertube
"richGridRenderer": ParseRichGridRenderer
"richItemRenderer": ParseRichItemRenderer
"feedFilterChipBarRenderer": ParseFeedFilterChipBarRenderer
"chipBarViewModel": ParseChipBarViewModel
"continuationItemRenderer": ParseContinuationItemRenderer
"appendContinuationItemsAction": ParseAppendContinuationItemsAction
"reloadContinuationItemsCommand": ParseReloadContinuationItemsCommand
@@ -163,6 +164,7 @@ namespace Innertube
"emergencyOneboxRenderer": ParseNotImplemented
' Suicide & crisis lifeline, within search
"searchFrictionViewModel": ParseNotImplemented
"shoppingTimelyShelfViewModel": ParseNotImplemented
"backstagePostRenderer": ParseNotImplemented
"backstagePostThreadRenderer": ParseNotImplemented
"counterfactualRenderer": ParseNotImplemented
@@ -251,6 +253,15 @@ namespace Innertube
context.currentFeed.sortOptions = sortOptions
end if
end if
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)
if not StringUtils.IsNullOrEmpty(context.currentFeed.continuation)
StartNewFeed("", context)
end if
context.currentFeed.continuation = continuation
end if
return nodeData["contents"]
end function
@@ -1710,13 +1721,64 @@ namespace Innertube
end function
function ParseRichGridRenderer(nodeData as object, context as object) as object
feedFilterChipBarRenderer = ObjectUtils.Dig(nodeData, ["header", "feedFilterChipBarRenderer"])
header = nodeData["header"]
feedFilterChipBarRenderer = invalid
chipBarViewModel = invalid
if IsAssociativeArray(header)
feedFilterChipBarRenderer = header["feedFilterChipBarRenderer"]
chipBarViewModel = header["chipBarViewModel"]
end if
if feedFilterChipBarRenderer <> invalid
ParseFeedFilterChipBarRenderer(feedFilterChipBarRenderer, context)
else if chipBarViewModel <> invalid
ParseChipBarViewModel(chipBarViewModel, context)
end if
return nodeData["contents"]
end function
function ParseChipBarViewModel(nodeData as object, context as object) as object
chips = ObjectUtils.Dig(nodeData, ["chips"])
if not IsArray(chips)
return invalid
end if
sortOptions = []
for each chip in chips
chipViewModel = chip["chipViewModel"]
if not IsAssociativeArray(chipViewModel)
continue for
end if
title = ValidString(chipViewModel["text"])
isSelected = ValidBool(chipViewModel["selected"])
token = invalid
tapCommand = chipViewModel["tapCommand"]
if IsAssociativeArray(tapCommand)
innertubeCommand = tapCommand["innertubeCommand"]
if IsAssociativeArray(innertubeCommand)
continuationCommand = innertubeCommand["continuationCommand"]
if IsAssociativeArray(continuationCommand)
token = ValidString(continuationCommand["token"])
end if
end if
end if
if title = "" or StringUtils.IsNullOrEmpty(token)
continue for
end if
sortOptions.Push({
"title": title
"continuation": token
"isSelected": isSelected
})
end for
if sortOptions.Count() > 0
context.currentFeed.sortOptions = sortOptions
end if
return invalid
end function
function ParseRichItemRenderer(nodeData as object, _context as object) as object
return nodeData["content"]
end function
@@ -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)
@@ -162,6 +162,20 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
isDirty = true
end if
if userPrefs.__version = 5
filteredLayout = []
homeScreenLayout = ValidArray(userPrefs["misc.home_screen_layout"])
for each item in homeScreenLayout
if item.id = "trending" or item.id = "trending_music" or item.id = "trending_gaming" or item.id = "trending_movies"
continue for
end if
filteredLayout.Push(item)
end for
userPrefs["misc.home_screen_layout"] = filteredLayout
userPrefs.__version = 6
isDirty = true
end if
' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded)
#if DEBUG
@@ -5,7 +5,7 @@
user prefs saved need to be migrated. If the version is less than the
current version, a migration is needed.
-->
<field id="__version" type="integer" value="5" />
<field id="__version" type="integer" value="6" />
<field id="prefsModel" type="array" />
<field id="preferenceFields" type="assocarray" />
<function name="GetUserPreferences" />
@@ -230,10 +230,11 @@ function RemoveSingleFailedRow(error as dynamic, feedSource as object, feedSourc
end if
isError = error = Invidious.ERROR_NOT_AUTHENTICATED
' Invidious admins disable endpoints sometimes
isError = isError or error.instr("Administrator has disabled this endpoint") <> -1
isError = isError or error.instr("API disabled") <> -1
isError = isError or feedSource.id.instr("inv_trending") <> -1
isError = isError or feedSource.id.instr("inv_popular") <> -1
' Playlet not supporting popular
isError = isError or feedSource.id = "inv_popular"
if not isError
return false
end if
@@ -11,6 +11,7 @@ function ExecuteJob() as void
authToken = input.authToken
profileType = input.profileType
playbackTrackingUrls = input.playbackTrackingUrls
cpn = input.cpn
cancellation = JobGetCancellation()
@@ -43,9 +44,14 @@ function ExecuteJob() as void
return
end if
if StringUtils.IsNullOrEmpty(cpn)
cpn = InnertubeService.CreateClientPlaybackNonce()
end if
markedAsWatched = InnertubeService.AuthMarkVideoWatched(playbackTrackingUrls.videostatsPlaybackUrl, {
accessToken: authToken.token
onBehalfOfUser: authToken.activeIdentifyToken
cpn: cpn
cancellation: cancellation
})
if not markedAsWatched
@@ -93,6 +99,7 @@ function ExecuteJob() as void
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.
@@ -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 })
@@ -226,7 +226,7 @@ function OnVideoContentJobDone(event as object) as void
SeekToInitialPosition(content)
PlayAfterPreviousPlayerHasStopped()
MarkVideoWatched(content.videoId, metadata.playbackTrackingUrls)
MarkVideoWatched(content.videoId, metadata.playbackTrackingUrls, metadata.cpn)
end function
function SeekToInitialPosition(content as object) as void
@@ -329,6 +329,9 @@ function OnVideoContentJobErrorDialogResponse(event as object)
shouldPlayNext = false
if event <> invalid
dialog = event.getRoSGNode()
if m.errorDialog <> invalid and dialog.isSameNode(m.errorDialog)
m.errorDialog = invalid
end if
dialog.unobserveFieldScoped("wasClosed")
shouldPlayNext = dialog.actualButtonSelected = 0
end if
@@ -342,7 +345,7 @@ function OnVideoContentJobErrorDialogResponse(event as object)
Lounge.SendOnStateChange()
end function
function MarkVideoWatched(videoId as dynamic, playbackTrackingUrls as dynamic) as void
function MarkVideoWatched(videoId as dynamic, playbackTrackingUrls as dynamic, cpn as dynamic) as void
if StringUtils.IsNullOrEmpty(videoId)
return
end if
@@ -365,6 +368,7 @@ function MarkVideoWatched(videoId as dynamic, playbackTrackingUrls as dynamic) a
authToken: authToken
profileType: profileType
playbackTrackingUrls: playbackTrackingUrls
cpn: cpn
}
m.markVideoWatchedJob = JobSystem.CreateCallback()
@@ -444,6 +448,14 @@ function OnVideoPlayerStateChange() as void
' Reset isSeekingPosition when started to play the video
if state = "playing"
m.isSeekingPosition = false
' If we somehow was able to recover playback after an error dialog, close the dialog
errorDialog = m.errorDialog
if errorDialog <> invalid
m.errorDialog = invalid
errorDialog.unobserveFieldScoped("wasClosed")
errorDialog.close = true
end if
end if
' If we successfully played the video, then any error that comes later is not due to a 403 (FORBIDDEN).
@@ -520,6 +532,7 @@ function OnVideoPlayerStateChange() as void
dialog = DialogUtils.ShowTimedDialogButtons(errorData.body, errorData.title, buttons, 0, 10, true)
if dialog <> invalid
m.errorDialog = dialog
dialog.observeFieldScoped("wasClosed", FuncName(OnVideoContentJobErrorDialogResponse))
else
OnVideoContentJobErrorDialogResponse(invalid)
@@ -253,9 +253,8 @@ namespace Http
return true
end function
@get("/playlet-invidious-backend/api/v1/trending")
@get("/playlet-invidious-backend/api/v1/popular")
function GetTrending(context as object) as boolean
function GetPopular(context as object) as boolean
request = context.request
response = context.response
@@ -264,40 +263,10 @@ namespace Http
return m.GetAuthRecommended(context)
end if
raw = request.query.raw <> invalid
options = {
"disableShorts": m.preferences["content_feed.disable_shorts"]
raw: raw
type: request.query.type
}
result = InnertubeService.GetTrending(options)
if raw
response.Json(result)
return true
end if
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
response.Json({
"error": "Failed to get trending feed"
})
response.http_code = 500
return true
end if
response.Json(ValidArray(result.feeds[0].items))
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
response.Json({
"error": "Playlet built-in Invidious backend does not support popular videos."
})
response.http_code = 400
return true
end function
@@ -346,10 +315,6 @@ namespace Http
response.Json(result.feeds[0])
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
return true
end function
@@ -619,7 +584,6 @@ namespace Http
}
end if
else
options["signatureTimestamp"] = true
options["credentialTransferToken"] = m.loungeService.credentialTransferToken
metadata = InnertubeService.GetVideoMetadata(videoId, options)
end if
@@ -14,44 +14,6 @@
apiType: Invidious
endpoint: auth_recommended
- title: Trending
id: trending
feedSources:
- id: inv_trending
title: Trending
apiType: Invidious
endpoint: trending
- title: Trending - Music
id: trending_music
feedSources:
- id: inv_trending_music
title: Trending - Music
apiType: Invidious
endpoint: trending
queryParams:
type: Music
- title: Trending - Gaming
id: trending_gaming
feedSources:
- id: inv_trending_gaming
title: Trending - Gaming
apiType: Invidious
endpoint: trending
queryParams:
type: Gaming
- title: Trending - Movies
id: trending_movies
feedSources:
- id: inv_trending_movies
title: Trending - Movies
apiType: Invidious
endpoint: trending
queryParams:
type: Movies
- title: Popular
id: popular
feedSources:
@@ -1,17 +1,3 @@
trending:
title: Trending
url: /api/v1/trending
cacheSeconds: 21600 # 6 hours
queryParams:
type:
type:
- Music
- Gaming
- Movies
region:
type: "#ISO3166"
default: GetUserCountryCode
popular:
title: Popular
url: /api/v1/popular
-16
View File
@@ -243,22 +243,6 @@
id: "recommended",
enabled: true,
},
{
id: "trending",
enabled: true,
},
{
id: "trending_music",
enabled: true,
},
{
id: "trending_gaming",
enabled: true,
},
{
id: "trending_movies",
enabled: true,
},
{
id: "popular",
enabled: true,
@@ -312,22 +312,6 @@
<source>Watch history</source>
<translation>Wiedergabeverlauf</translation>
</message>
<message>
<source>Trending</source>
<translation>Trends</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Trends - Filme</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Trends - Musik</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Trends - Gaming</translation>
</message>
<message>
<source>Popular</source>
<translation>Populär</translation>
@@ -88,22 +88,6 @@
<source>Watch history</source>
<translation>Watch history</translation>
</message>
<message>
<source>Trending</source>
<translation>Trending</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Trending - Movies</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Trending - Music</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Trending - Gaming</translation>
</message>
<message>
<source>Popular</source>
<translation>Popular</translation>
@@ -80,22 +80,6 @@
<source>Watch history</source>
<translation>Ver el historial</translation>
</message>
<message>
<source>Trending</source>
<translation>Tendencias</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Tendencias - Películas</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Tendencias - Música</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Tendencias - Juegos</translation>
</message>
<message>
<source>Popular</source>
<translation>Popular</translation>
@@ -36,10 +36,6 @@
<source>Filters</source>
<translation>Filtros</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Tendencias - Música</translation>
</message>
<message>
<source>Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.</source>
<translation>Accede a Invidious para ver tus suscripciones, playlists, y usar el historial de reproducción.</translation>
@@ -80,18 +76,6 @@
<source>Watch history</source>
<translation>Historial de reproducción</translation>
</message>
<message>
<source>Trending</source>
<translation>Tendencias</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Tendencias - Películas</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Tendencias - Videojuegos</translation>
</message>
<message>
<source>Edit</source>
<translation>Editar</translation>
@@ -76,22 +76,6 @@
<source>Watch history</source>
<translation>Historique</translation>
</message>
<message>
<source>Trending</source>
<translation>Tendances</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Tendances - Films</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Tendances - Musique</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Tendances - Jeux vidéo</translation>
</message>
<message>
<source>Popular</source>
<translation>Populaire</translation>
@@ -140,22 +140,6 @@
<source>Watch history</source>
<translation>Histórico de assistidos</translation>
</message>
<message>
<source>Trending</source>
<translation>Em alta</translation>
</message>
<message>
<source>Trending - Movies</source>
<translation>Em alta - Flimes</translation>
</message>
<message>
<source>Trending - Music</source>
<translation>Em alta - Música</translation>
</message>
<message>
<source>Trending - Gaming</source>
<translation>Em alta - Jogos</translation>
</message>
<message>
<source>Popular</source>
<translation>Popular</translation>
+1 -1
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=44
build_version=00003
build_version=00008
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
-4
View File
@@ -41,10 +41,6 @@ namespace Locale
Recommended = "Recommended"
Playlists = "Playlists"
WatchHistory = "Watch history"
Trending = "Trending"
TrendingMovies = "Trending - Movies"
TrendingMusic = "Trending - Music"
TrendingGaming = "Trending - Gaming"
Popular = "Popular"
Videos = "Videos"
Shorts = "Shorts"
+1286 -1644
View File
File diff suppressed because it is too large. Load diff
+16 -17
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.44.3",
"version": "0.44.8",
"type": "module",
"scripts": {
"dev": "vite",
@@ -9,29 +9,28 @@
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tailwindcss/postcss": "^4.1.17",
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/typography": "^0.5.19",
"@tsconfig/svelte": "^5.0.5",
"@vitejs/plugin-legacy": "^7.2.1",
"autoprefixer": "^10.4.21",
"@tsconfig/svelte": "^5.0.8",
"@vitejs/plugin-legacy": "^8.0.0",
"autoprefixer": "^10.4.27",
"bgutils-js": "^3.2.0",
"daisyui": "^5.4.7",
"dotenv": "^17.2.3",
"daisyui": "^5.5.19",
"dotenv": "^17.3.1",
"ip": "^2.0.1",
"jszip": "^3.10.1",
"postcss": "^8.5.6",
"rollup-plugin-visualizer": "^6.0.5",
"svelte": "^5.43.4",
"svelte-check": "^4.3.3",
"postcss": "^8.5.8",
"rollup-plugin-visualizer": "^7.0.1",
"svelte": "^5.54.0",
"svelte-check": "^4.4.5",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^4.1.17",
"terser": "^5.44.1",
"tailwindcss": "^4.2.2",
"terser": "^5.46.1",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"vite": "^7.2.2",
"vite": "^8.0.1",
"vite-plugin-compression": "^0.5.1",
"vite-tsconfig-paths": "^5.1.4",
"youtubei.js": "^16.0.1"
"youtubei.js": "^17.0.1"
}
}
+11 -15
View File
@@ -141,20 +141,8 @@ export class YoutubeJs {
static initJsEvaluator() {
Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => {
const properties = [];
if (env.n) {
properties.push(`n: exportedVars.nFunction("${env.n}")`)
}
if (env.sig) {
properties.push(`sig: exportedVars.sigFunction("${env.sig}")`)
}
const code = `${data.output}\nreturn { ${properties.join(', ')} }`;
return new Function(code)();
}
return new Function(data.output)();
};
}
static async generateVisitorData() {
@@ -255,6 +243,10 @@ export class YoutubeJs {
po_token: await YoutubeJs.generatePoToken(videoId),
});
if (info.playability_status.status !== 'OK') {
throw new Error(`Video is not playable: ${info.playability_status.status}\nReason: ${info.playability_status.reason}`);
}
// We can't generate a proper dash from live videos.
// By returning null, we're telling Playlet to fetch video info itself.
if (info.basic_info.is_live) {
@@ -320,12 +312,16 @@ export class YoutubeJs {
init: format.init_range ? `${format.init_range.start}-${format.init_range.end}` : "",
index: format.index_range ? `${format.index_range.start}-${format.index_range.end}` : "",
bitrate: `${format.bitrate}`,
url: await format.decipher(YoutubeJs.innerTube.session.player),
itag: `${format.itag}`,
type: format.mime_type,
clen: `${format.approx_duration_ms}`,
lmt: `${format.last_modified}`,
};
if (format.url || format.signature_cipher || format.cipher) {
result.url = await format.decipher(YoutubeJs.innerTube.session.player);
}
if (format.audio_quality) {
result.audioQuality = format.audio_quality;
}
@@ -49,28 +49,43 @@
});
async function playOnTv() {
const videoInfo = getVideoInfo();
await PlayletApi.playVideo(videoInfo);
try {
const videoInfo = getVideoInfo();
await PlayletApi.playVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
}
async function playOnTvYtjs() {
const videoInfo = getVideoInfo() as any;
try {
const videoInfo = getVideoInfo() as any;
// measure length of time it takes to get video info
const start = performance.now();
const metadata = await YoutubeJs.getVideoInfo(videoId);
const end = performance.now();
console.log(`Time to get video info: ${end - start}ms`);
// measure length of time it takes to get video info
const start = performance.now();
const metadata = await YoutubeJs.getVideoInfo(videoId);
const end = performance.now();
console.log(`Time to get video info: ${end - start}ms`);
if (metadata) {
videoInfo.metadata = metadata;
if (metadata) {
videoInfo.metadata = metadata;
}
await PlayletApi.playVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
await PlayletApi.playVideo(videoInfo);
}
async function queueOnTv() {
const videoInfo = getVideoInfo();
await PlayletApi.queueVideo(videoInfo);
try {
const videoInfo = getVideoInfo();
await PlayletApi.queueVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
}
function openInvidious() {
+3 -2
View File
@@ -2,7 +2,6 @@ import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig, UserConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import viteCompression from 'vite-plugin-compression';
import tsconfigPaths from 'vite-tsconfig-paths'
import ip from 'ip';
import { existsSync, readFileSync } from 'fs'
import { join as joinPath } from 'path'
@@ -13,7 +12,6 @@ const PORT = 5173
const config: UserConfig = {
plugins: [
tsconfigPaths(),
svelte(),
legacy({
targets: ['defaults', 'not IE 11'],
@@ -23,6 +21,9 @@ const config: UserConfig = {
deleteOriginFile: true
})
],
resolve: {
tsconfigPaths: true
},
build: {
outDir: "../playlet-lib/src/www",
emptyOutDir: true
+1 -1
View File
@@ -15,6 +15,6 @@ INVIDIOUS_HMAC_KEY=PASSWORD_1
INVIDIOUS_COMPANION_KEY=PASSWORD_2
```
- Run `docker-compose up`
- Run `docker compose up -d --pull always`
Invidious should now be running locally on port 3000.
+1 -1
View File
@@ -32,7 +32,7 @@ services:
# Use the key generated in the 2nd step
hmac_key: $INVIDIOUS_HMAC_KEY
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/popular || exit 1
interval: 30s
timeout: 5s
retries: 2