Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16df893c2c | ||
|
|
6129afd695 | ||
|
|
84504a5931 | ||
|
|
0123f9fa8e | ||
|
|
7227d4e26b | ||
|
|
58fe601b25 | ||
|
|
a61d132b57 | ||
|
|
ee4acfc8e7 | ||
|
|
fcd798a2fa | ||
|
|
f5be0e5842 | ||
|
|
2d9f3abe5d | ||
|
|
69fe737006 | ||
|
|
ac6c9122c2 | ||
|
|
d3e0883332 | ||
|
|
5c39405255 | ||
|
|
6535006d66 | ||
|
|
a43cb91e1e | ||
|
|
58ce807e42 | ||
|
|
2319ae7025 | ||
|
|
1f2058abce | ||
|
|
aadbde330d | ||
|
|
60df07c95c | ||
|
|
71757bb9d5 | ||
|
|
630176d8aa | ||
|
|
03c7f9afe6 |
No files matched your search
Vendored
+23
@@ -76,6 +76,29 @@
|
|||||||
"args": "--log-level info --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
|
"args": "--log-level info --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
|
||||||
"cwd": "${workspaceFolder}/playlet-lib",
|
"cwd": "${workspaceFolder}/playlet-lib",
|
||||||
"console": "integratedTerminal"
|
"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": [
|
"compounds": [
|
||||||
|
|||||||
Vendored
+5
@@ -49,6 +49,11 @@
|
|||||||
"label": "build-web",
|
"label": "build-web",
|
||||||
"script": "build:web",
|
"script": "build:web",
|
||||||
"type": "npm"
|
"type": "npm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build-playground",
|
||||||
|
"script": "build:playground",
|
||||||
|
"type": "npm"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [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
|
## [0.44.3] - 2025-11-14
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
|
|
||||||
Playlet is an unofficial YouTube client for Roku 📺
|
Playlet is an unofficial YouTube client for Roku 📺
|
||||||
|
|
||||||
|
**[Playlet February 2026 Update](https://github.com/iBicha/playlet/discussions/827)**
|
||||||
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
<a href="./docs/screenshots/README.md">
|
<a href="./docs/screenshots/README.md">
|
||||||
|
|||||||
Generated
+168
-1201
File diff suppressed because it is too large.
Load diff
+16
-15
@@ -1,38 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.38",
|
"@rokucommunity/bslint": "^0.8.39",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^24.10.0",
|
"@types/node": "^25.5.0",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"argparse": "^2.0.1",
|
"argparse": "^2.0.1",
|
||||||
"brighterscript": "0.70.3",
|
"brighterscript": "0.70.3",
|
||||||
"brighterscript-formatter": "^1.7.19",
|
"brighterscript-formatter": "^1.7.21",
|
||||||
"convert-svg-to-png": "^0.7.1",
|
"convert-svg-to-png": "^0.7.1",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.3.1",
|
||||||
"fs-extra": "^11.3.2",
|
"fs-extra": "^11.3.4",
|
||||||
"glob": "^11.0.3",
|
"glob": "^13.0.6",
|
||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mailparser": "^3.9.0",
|
"mailparser": "^3.9.4",
|
||||||
"protocol-buffers-schema": "^3.6.0",
|
"protocol-buffers-schema": "^3.6.0",
|
||||||
"puppeteer": "^24.29.1",
|
"puppeteer": "^24.40.0",
|
||||||
"roku-deploy": "^3.14.4",
|
"roku-deploy": "^3.16.2",
|
||||||
"roku-test-automation": "^2.2.1",
|
"roku-test-automation": "^2.2.1",
|
||||||
"rooibos-roku": "5.15.5",
|
"rooibos-roku": "5.15.5",
|
||||||
"rounded-rect-9patch": "^1.1.2",
|
"rounded-rect-9patch": "^1.1.2",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.4",
|
||||||
"shelljs": "^0.10.0",
|
"shelljs": "^0.10.0",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "5.9.3",
|
"typescript": "5.9.3",
|
||||||
"telnet-client": "^2.2.6",
|
"telnet-client": "^2.2.11",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"yaml": "^2.8.1"
|
"yaml": "^2.8.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "22"
|
"node": "22"
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
"build:lib:dev": "cd playlet-lib && npm run build:dev",
|
"build:lib:dev": "cd playlet-lib && npm run build:dev",
|
||||||
"build:lib:prod": "cd playlet-lib && npm run build:prod",
|
"build:lib:prod": "cd playlet-lib && npm run build:prod",
|
||||||
"build:web": "cd playlet-web && npm run build",
|
"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": "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",
|
"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",
|
"format": "cd playlet-lib && npm run format && cd ../playlet-app && npm run format",
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
"screenshot": "node tools/screenshot.js",
|
"screenshot": "node tools/screenshot.js",
|
||||||
"convert-images": "node tools/convert-images.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",
|
"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",
|
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject rooibos-roku",
|
||||||
"registry:write": "node tools/registry.js --input registry.json",
|
"registry:write": "node tools/registry.js --input registry.json",
|
||||||
"registry:read": "node tools/registry.js --output registry.json",
|
"registry:read": "node tools/registry.js --output registry.json",
|
||||||
@@ -75,6 +76,6 @@
|
|||||||
"shutdown": "node tools/shutdown.js"
|
"shutdown": "node tools/shutdown.js"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@rollup/rollup-linux-x64-gnu": "^4.53.1"
|
"@rollup/rollup-linux-x64-gnu": "^4.59.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../config/bsconfig.base.jsonc",
|
||||||
|
"rootDir": "src/",
|
||||||
|
"stagingDir": "../build/playground",
|
||||||
|
"outFile": "../dist/playground.zip"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"extends": "bsconfig.json",
|
||||||
|
"createPackage": false,
|
||||||
|
"deploy": false,
|
||||||
|
"retainStagingDir": false,
|
||||||
|
"sourceMap": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../config/bsconfig.tests.base.jsonc",
|
||||||
|
"rootDir": "src/",
|
||||||
|
"stagingDir": "../build/playground-tests",
|
||||||
|
"outFile": "../build/playground-tests.zip"
|
||||||
|
}
|
||||||
Generated
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "playground",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "playground",
|
||||||
|
"version": "0.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
function Init()
|
||||||
|
print "Playground Init"
|
||||||
|
end function
|
||||||
@@ -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 |
@@ -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
|
||||||
@@ -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
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.44.3"
|
"version": "0.44.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node ../tools/rm.js ../build/playlet-app",
|
"prebuild": "node ../tools/rm.js ../build/playlet-app",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title=Playlet
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=44
|
minor_version=44
|
||||||
build_version=00003
|
build_version=00007
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.44.3"
|
"version": "0.44.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
|
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
|
||||||
|
|||||||
@@ -145,11 +145,11 @@ function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logs
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
LogTelemetryEvent({
|
' LogTelemetryEvent({
|
||||||
level: "warning"
|
' level: "warning"
|
||||||
message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
|
' message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
|
||||||
fingerprint: [message]
|
' fingerprint: [message]
|
||||||
})
|
' })
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnLineLogDeviceInfoMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
|
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.FromAsciiString(line + `\n`)
|
||||||
buffer.AppendFile(logsFile)
|
buffer.AppendFile(logsFile)
|
||||||
|
|
||||||
LogTelemetryEvent({
|
' LogTelemetryEvent({
|
||||||
level: "warning"
|
' level: "warning"
|
||||||
message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
|
' message: line + `\nCurrentTime: ${m.eventThrottleTimer.TotalSeconds()}`
|
||||||
fingerprint: [message]
|
' fingerprint: [message]
|
||||||
})
|
' })
|
||||||
end function
|
end function
|
||||||
|
|
||||||
' Returns true if the event should be throttled
|
' Returns true if the event should be throttled
|
||||||
|
|||||||
+1
-1
@@ -324,7 +324,7 @@ end function
|
|||||||
|
|
||||||
function CanFetchWithCors(instance as string, testNode as object, cancellation as object) as void
|
function CanFetchWithCors(instance as string, testNode as object, cancellation as object) as void
|
||||||
try
|
try
|
||||||
url = `${instance}/api/v1/trending`
|
url = `${instance}/api/v1/popular`
|
||||||
response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
|
response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
|
||||||
|
|
||||||
if not response.IsSuccess()
|
if not response.IsSuccess()
|
||||||
|
|||||||
@@ -289,8 +289,13 @@ class DashManifest
|
|||||||
"contentType": "audio"
|
"contentType": "audio"
|
||||||
}
|
}
|
||||||
|
|
||||||
if IsAssociativeArray(firstFormat.audioTrack) and IsString(firstFormat.audioTrack.languageCode)
|
if IsAssociativeArray(firstFormat.audioTrack)
|
||||||
adaptationSetAttributes["lang"] = firstFormat.audioTrack.languageCode
|
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
|
end if
|
||||||
|
|
||||||
' Hoist common attributes
|
' Hoist common attributes
|
||||||
|
|||||||
@@ -267,63 +267,6 @@ namespace InnertubeService
|
|||||||
return Innertube.Search(query, options)
|
return Innertube.Search(query, options)
|
||||||
end function
|
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
|
function GetHome(options = invalid as object) as object
|
||||||
return GetBrowseAuthenticatedPage("FEwhat_to_watch", options)
|
return GetBrowseAuthenticatedPage("FEwhat_to_watch", options)
|
||||||
end function
|
end function
|
||||||
@@ -419,6 +362,9 @@ namespace InnertubeService
|
|||||||
cancellation = OptionUtils.Get(options, "cancellation")
|
cancellation = OptionUtils.Get(options, "cancellation")
|
||||||
accessToken = OptionUtils.Get(options, "accessToken")
|
accessToken = OptionUtils.Get(options, "accessToken")
|
||||||
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
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.")
|
videostatsPlaybackUrl = videostatsPlaybackUrl.replace("https://s.", "https://www.")
|
||||||
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
|
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
|
||||||
@@ -426,9 +372,8 @@ namespace InnertubeService
|
|||||||
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
|
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
|
||||||
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
|
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
|
||||||
queryParams["ver"] = "2"
|
queryParams["ver"] = "2"
|
||||||
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
|
queryParams["cpn"] = cpn
|
||||||
queryParams["cmt"] = 0
|
queryParams["cmt"] = cmtStr
|
||||||
queryParams["final"] = "1"
|
|
||||||
videostatsPlaybackUrl = UrlUtils.SetQueryParams(videostatsPlaybackUrl, queryParams)
|
videostatsPlaybackUrl = UrlUtils.SetQueryParams(videostatsPlaybackUrl, queryParams)
|
||||||
|
|
||||||
request = HttpClient.Get(videostatsPlaybackUrl)
|
request = HttpClient.Get(videostatsPlaybackUrl)
|
||||||
@@ -450,12 +395,15 @@ namespace InnertubeService
|
|||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function AuthMarkVideoWatchTime(time as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
|
function AuthMarkVideoWatchTime(startTime as float, endTime as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
|
||||||
cancellation = OptionUtils.Get(options, "cancellation")
|
cancellation = OptionUtils.Get(options, "cancellation")
|
||||||
accessToken = OptionUtils.Get(options, "accessToken")
|
accessToken = OptionUtils.Get(options, "accessToken")
|
||||||
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
||||||
|
cpn = OptionUtils.Get(options, "cpn")
|
||||||
timeStr = time.ToStr("%.3f")
|
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.")
|
videostatsWatchtimeUrl = videostatsWatchtimeUrl.replace("https://s.", "https://www.")
|
||||||
queryParams = UrlUtils.ParseQueryComponents(videostatsWatchtimeUrl)
|
queryParams = UrlUtils.ParseQueryComponents(videostatsWatchtimeUrl)
|
||||||
@@ -463,11 +411,10 @@ namespace InnertubeService
|
|||||||
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
|
queryParams["cbrver"] = INNERTUBE_TV_CLIENT_VERSION
|
||||||
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
|
queryParams["cver"] = INNERTUBE_TV_CLIENT_VERSION
|
||||||
queryParams["ver"] = "2"
|
queryParams["ver"] = "2"
|
||||||
queryParams["cpn"] = InnertubeService.CreateClientPlaybackNonce()
|
queryParams["cpn"] = cpn
|
||||||
queryParams["cmt"] = 0
|
queryParams["cmt"] = cmtStr
|
||||||
queryParams["final"] = "1"
|
queryParams["st"] = stStr
|
||||||
queryParams["st"] = timeStr
|
queryParams["et"] = etStr
|
||||||
queryParams["et"] = timeStr
|
|
||||||
videostatsWatchtimeUrl = UrlUtils.SetQueryParams(videostatsWatchtimeUrl, queryParams)
|
videostatsWatchtimeUrl = UrlUtils.SetQueryParams(videostatsWatchtimeUrl, queryParams)
|
||||||
|
|
||||||
request = HttpClient.Get(videostatsWatchtimeUrl)
|
request = HttpClient.Get(videostatsWatchtimeUrl)
|
||||||
@@ -485,7 +432,7 @@ namespace InnertubeService
|
|||||||
return false
|
return false
|
||||||
end if
|
end if
|
||||||
|
|
||||||
LogDebug("Marked video watch time:", timeStr)
|
LogDebug("Marked video watch time:", stStr, "-", etStr)
|
||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace Innertube
|
|||||||
"richGridRenderer": ParseRichGridRenderer
|
"richGridRenderer": ParseRichGridRenderer
|
||||||
"richItemRenderer": ParseRichItemRenderer
|
"richItemRenderer": ParseRichItemRenderer
|
||||||
"feedFilterChipBarRenderer": ParseFeedFilterChipBarRenderer
|
"feedFilterChipBarRenderer": ParseFeedFilterChipBarRenderer
|
||||||
|
"chipBarViewModel": ParseChipBarViewModel
|
||||||
"continuationItemRenderer": ParseContinuationItemRenderer
|
"continuationItemRenderer": ParseContinuationItemRenderer
|
||||||
"appendContinuationItemsAction": ParseAppendContinuationItemsAction
|
"appendContinuationItemsAction": ParseAppendContinuationItemsAction
|
||||||
"reloadContinuationItemsCommand": ParseReloadContinuationItemsCommand
|
"reloadContinuationItemsCommand": ParseReloadContinuationItemsCommand
|
||||||
@@ -163,6 +164,7 @@ namespace Innertube
|
|||||||
"emergencyOneboxRenderer": ParseNotImplemented
|
"emergencyOneboxRenderer": ParseNotImplemented
|
||||||
' Suicide & crisis lifeline, within search
|
' Suicide & crisis lifeline, within search
|
||||||
"searchFrictionViewModel": ParseNotImplemented
|
"searchFrictionViewModel": ParseNotImplemented
|
||||||
|
"shoppingTimelyShelfViewModel": ParseNotImplemented
|
||||||
"backstagePostRenderer": ParseNotImplemented
|
"backstagePostRenderer": ParseNotImplemented
|
||||||
"backstagePostThreadRenderer": ParseNotImplemented
|
"backstagePostThreadRenderer": ParseNotImplemented
|
||||||
"counterfactualRenderer": ParseNotImplemented
|
"counterfactualRenderer": ParseNotImplemented
|
||||||
@@ -251,6 +253,15 @@ namespace Innertube
|
|||||||
context.currentFeed.sortOptions = sortOptions
|
context.currentFeed.sortOptions = sortOptions
|
||||||
end if
|
end if
|
||||||
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"]
|
return nodeData["contents"]
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -1710,13 +1721,64 @@ namespace Innertube
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function ParseRichGridRenderer(nodeData as object, context as object) as object
|
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
|
if feedFilterChipBarRenderer <> invalid
|
||||||
ParseFeedFilterChipBarRenderer(feedFilterChipBarRenderer, context)
|
ParseFeedFilterChipBarRenderer(feedFilterChipBarRenderer, context)
|
||||||
|
else if chipBarViewModel <> invalid
|
||||||
|
ParseChipBarViewModel(chipBarViewModel, context)
|
||||||
end if
|
end if
|
||||||
return nodeData["contents"]
|
return nodeData["contents"]
|
||||||
end function
|
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
|
function ParseRichItemRenderer(nodeData as object, _context as object) as object
|
||||||
return nodeData["content"]
|
return nodeData["content"]
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -162,6 +162,20 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
|
|||||||
isDirty = true
|
isDirty = true
|
||||||
end if
|
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)
|
' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded)
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
user prefs saved need to be migrated. If the version is less than the
|
user prefs saved need to be migrated. If the version is less than the
|
||||||
current version, a migration is needed.
|
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="prefsModel" type="array" />
|
||||||
<field id="preferenceFields" type="assocarray" />
|
<field id="preferenceFields" type="assocarray" />
|
||||||
<function name="GetUserPreferences" />
|
<function name="GetUserPreferences" />
|
||||||
|
|||||||
@@ -230,10 +230,11 @@ function RemoveSingleFailedRow(error as dynamic, feedSource as object, feedSourc
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
isError = error = Invidious.ERROR_NOT_AUTHENTICATED
|
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("Administrator has disabled this endpoint") <> -1
|
||||||
isError = isError or error.instr("API disabled") <> -1
|
isError = isError or error.instr("API disabled") <> -1
|
||||||
isError = isError or feedSource.id.instr("inv_trending") <> -1
|
' Playlet not supporting popular
|
||||||
isError = isError or feedSource.id.instr("inv_popular") <> -1
|
isError = isError or feedSource.id = "inv_popular"
|
||||||
if not isError
|
if not isError
|
||||||
return false
|
return false
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ function ExecuteJob() as void
|
|||||||
authToken = input.authToken
|
authToken = input.authToken
|
||||||
profileType = input.profileType
|
profileType = input.profileType
|
||||||
playbackTrackingUrls = input.playbackTrackingUrls
|
playbackTrackingUrls = input.playbackTrackingUrls
|
||||||
|
cpn = input.cpn
|
||||||
|
|
||||||
cancellation = JobGetCancellation()
|
cancellation = JobGetCancellation()
|
||||||
|
|
||||||
@@ -43,9 +44,14 @@ function ExecuteJob() as void
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if StringUtils.IsNullOrEmpty(cpn)
|
||||||
|
cpn = InnertubeService.CreateClientPlaybackNonce()
|
||||||
|
end if
|
||||||
|
|
||||||
markedAsWatched = InnertubeService.AuthMarkVideoWatched(playbackTrackingUrls.videostatsPlaybackUrl, {
|
markedAsWatched = InnertubeService.AuthMarkVideoWatched(playbackTrackingUrls.videostatsPlaybackUrl, {
|
||||||
accessToken: authToken.token
|
accessToken: authToken.token
|
||||||
onBehalfOfUser: authToken.activeIdentifyToken
|
onBehalfOfUser: authToken.activeIdentifyToken
|
||||||
|
cpn: cpn
|
||||||
cancellation: cancellation
|
cancellation: cancellation
|
||||||
})
|
})
|
||||||
if not markedAsWatched
|
if not markedAsWatched
|
||||||
@@ -68,6 +74,7 @@ function ExecuteJob() as void
|
|||||||
MessagePortUtils.ObserveFieldScopedExSafe(callbackNode, "watchTime", port)
|
MessagePortUtils.ObserveFieldScopedExSafe(callbackNode, "watchTime", port)
|
||||||
CancellationUtils.ObserveCancellationScoped(cancellation, port)
|
CancellationUtils.ObserveCancellationScoped(cancellation, port)
|
||||||
successiveFailures = 0
|
successiveFailures = 0
|
||||||
|
lastReportedTime = 0.0
|
||||||
while true
|
while true
|
||||||
message = wait(60000, port)
|
message = wait(60000, port)
|
||||||
if CancellationUtils.IsCancellationEvent(cancellation, message)
|
if CancellationUtils.IsCancellationEvent(cancellation, message)
|
||||||
@@ -90,16 +97,27 @@ function ExecuteJob() as void
|
|||||||
end while
|
end while
|
||||||
|
|
||||||
watchTime = message.getData()
|
watchTime = message.getData()
|
||||||
success = InnertubeService.AuthMarkVideoWatchTime(watchTime, playbackTrackingUrls.videostatsWatchtimeUrl, {
|
' 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, {
|
||||||
accessToken: authToken.token
|
accessToken: authToken.token
|
||||||
onBehalfOfUser: authToken.activeIdentifyToken
|
onBehalfOfUser: authToken.activeIdentifyToken
|
||||||
|
cpn: cpn
|
||||||
' TODO:P1 if we pass cancellation here, http client will remove scoped
|
' TODO:P1 if we pass cancellation here, http client will remove scoped
|
||||||
' observer, which is stored on the current node.
|
' observer, which is stored on the current node.
|
||||||
' This requires an extra observer node to be independent.
|
' This requires an extra observer node to be independent.
|
||||||
|
cmt: lastReportedTime
|
||||||
cancellation: invalid
|
cancellation: invalid
|
||||||
})
|
})
|
||||||
if success
|
if success
|
||||||
successiveFailures = 0
|
successiveFailures = 0
|
||||||
|
lastReportedTime = watchTime
|
||||||
else
|
else
|
||||||
successiveFailures += 1
|
successiveFailures += 1
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ function OnVideoContentJobDone(event as object) as void
|
|||||||
SeekToInitialPosition(content)
|
SeekToInitialPosition(content)
|
||||||
|
|
||||||
PlayAfterPreviousPlayerHasStopped()
|
PlayAfterPreviousPlayerHasStopped()
|
||||||
MarkVideoWatched(content.videoId, metadata.playbackTrackingUrls)
|
MarkVideoWatched(content.videoId, metadata.playbackTrackingUrls, metadata.cpn)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function SeekToInitialPosition(content as object) as void
|
function SeekToInitialPosition(content as object) as void
|
||||||
@@ -329,6 +329,9 @@ function OnVideoContentJobErrorDialogResponse(event as object)
|
|||||||
shouldPlayNext = false
|
shouldPlayNext = false
|
||||||
if event <> invalid
|
if event <> invalid
|
||||||
dialog = event.getRoSGNode()
|
dialog = event.getRoSGNode()
|
||||||
|
if m.errorDialog <> invalid and dialog.isSameNode(m.errorDialog)
|
||||||
|
m.errorDialog = invalid
|
||||||
|
end if
|
||||||
dialog.unobserveFieldScoped("wasClosed")
|
dialog.unobserveFieldScoped("wasClosed")
|
||||||
shouldPlayNext = dialog.actualButtonSelected = 0
|
shouldPlayNext = dialog.actualButtonSelected = 0
|
||||||
end if
|
end if
|
||||||
@@ -342,7 +345,7 @@ function OnVideoContentJobErrorDialogResponse(event as object)
|
|||||||
Lounge.SendOnStateChange()
|
Lounge.SendOnStateChange()
|
||||||
end function
|
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)
|
if StringUtils.IsNullOrEmpty(videoId)
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
@@ -365,6 +368,7 @@ function MarkVideoWatched(videoId as dynamic, playbackTrackingUrls as dynamic) a
|
|||||||
authToken: authToken
|
authToken: authToken
|
||||||
profileType: profileType
|
profileType: profileType
|
||||||
playbackTrackingUrls: playbackTrackingUrls
|
playbackTrackingUrls: playbackTrackingUrls
|
||||||
|
cpn: cpn
|
||||||
}
|
}
|
||||||
|
|
||||||
m.markVideoWatchedJob = JobSystem.CreateCallback()
|
m.markVideoWatchedJob = JobSystem.CreateCallback()
|
||||||
@@ -444,6 +448,14 @@ function OnVideoPlayerStateChange() as void
|
|||||||
' Reset isSeekingPosition when started to play the video
|
' Reset isSeekingPosition when started to play the video
|
||||||
if state = "playing"
|
if state = "playing"
|
||||||
m.isSeekingPosition = false
|
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
|
end if
|
||||||
|
|
||||||
' If we successfully played the video, then any error that comes later is not due to a 403 (FORBIDDEN).
|
' 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)
|
dialog = DialogUtils.ShowTimedDialogButtons(errorData.body, errorData.title, buttons, 0, 10, true)
|
||||||
if dialog <> invalid
|
if dialog <> invalid
|
||||||
|
m.errorDialog = dialog
|
||||||
dialog.observeFieldScoped("wasClosed", FuncName(OnVideoContentJobErrorDialogResponse))
|
dialog.observeFieldScoped("wasClosed", FuncName(OnVideoContentJobErrorDialogResponse))
|
||||||
else
|
else
|
||||||
OnVideoContentJobErrorDialogResponse(invalid)
|
OnVideoContentJobErrorDialogResponse(invalid)
|
||||||
|
|||||||
+5
-40
@@ -253,9 +253,8 @@ namespace Http
|
|||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/trending")
|
|
||||||
@get("/playlet-invidious-backend/api/v1/popular")
|
@get("/playlet-invidious-backend/api/v1/popular")
|
||||||
function GetTrending(context as object) as boolean
|
function GetPopular(context as object) as boolean
|
||||||
request = context.request
|
request = context.request
|
||||||
response = context.response
|
response = context.response
|
||||||
|
|
||||||
@@ -264,40 +263,10 @@ namespace Http
|
|||||||
return m.GetAuthRecommended(context)
|
return m.GetAuthRecommended(context)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
raw = request.query.raw <> invalid
|
response.Json({
|
||||||
|
"error": "Playlet built-in Invidious backend does not support popular videos."
|
||||||
options = {
|
})
|
||||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
response.http_code = 400
|
||||||
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
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -346,10 +315,6 @@ namespace Http
|
|||||||
|
|
||||||
response.Json(result.feeds[0])
|
response.Json(result.feeds[0])
|
||||||
|
|
||||||
if result.DoesExist("cache-control")
|
|
||||||
response.headers["cache-control"] = result["cache-control"]
|
|
||||||
end if
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -14,44 +14,6 @@
|
|||||||
apiType: Invidious
|
apiType: Invidious
|
||||||
endpoint: auth_recommended
|
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
|
- title: Popular
|
||||||
id: popular
|
id: popular
|
||||||
feedSources:
|
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:
|
popular:
|
||||||
title: Popular
|
title: Popular
|
||||||
url: /api/v1/popular
|
url: /api/v1/popular
|
||||||
|
|||||||
@@ -243,22 +243,6 @@
|
|||||||
id: "recommended",
|
id: "recommended",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: "trending",
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "trending_music",
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "trending_gaming",
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "trending_movies",
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "popular",
|
id: "popular",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|||||||
@@ -312,22 +312,6 @@
|
|||||||
<source>Watch history</source>
|
<source>Watch history</source>
|
||||||
<translation>Wiedergabeverlauf</translation>
|
<translation>Wiedergabeverlauf</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Popular</source>
|
<source>Popular</source>
|
||||||
<translation>Populär</translation>
|
<translation>Populär</translation>
|
||||||
|
|||||||
@@ -88,22 +88,6 @@
|
|||||||
<source>Watch history</source>
|
<source>Watch history</source>
|
||||||
<translation>Watch history</translation>
|
<translation>Watch history</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Popular</source>
|
<source>Popular</source>
|
||||||
<translation>Popular</translation>
|
<translation>Popular</translation>
|
||||||
|
|||||||
@@ -80,22 +80,6 @@
|
|||||||
<source>Watch history</source>
|
<source>Watch history</source>
|
||||||
<translation>Ver el historial</translation>
|
<translation>Ver el historial</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Popular</source>
|
<source>Popular</source>
|
||||||
<translation>Popular</translation>
|
<translation>Popular</translation>
|
||||||
|
|||||||
@@ -36,10 +36,6 @@
|
|||||||
<source>Filters</source>
|
<source>Filters</source>
|
||||||
<translation>Filtros</translation>
|
<translation>Filtros</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Trending - Music</source>
|
|
||||||
<translation>Tendencias - Música</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.</source>
|
<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>
|
<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>
|
<source>Watch history</source>
|
||||||
<translation>Historial de reproducción</translation>
|
<translation>Historial de reproducción</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Edit</source>
|
<source>Edit</source>
|
||||||
<translation>Editar</translation>
|
<translation>Editar</translation>
|
||||||
|
|||||||
@@ -76,22 +76,6 @@
|
|||||||
<source>Watch history</source>
|
<source>Watch history</source>
|
||||||
<translation>Historique</translation>
|
<translation>Historique</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Popular</source>
|
<source>Popular</source>
|
||||||
<translation>Populaire</translation>
|
<translation>Populaire</translation>
|
||||||
|
|||||||
@@ -140,22 +140,6 @@
|
|||||||
<source>Watch history</source>
|
<source>Watch history</source>
|
||||||
<translation>Histórico de assistidos</translation>
|
<translation>Histórico de assistidos</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>Popular</source>
|
<source>Popular</source>
|
||||||
<translation>Popular</translation>
|
<translation>Popular</translation>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title=PlayletLib
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=44
|
minor_version=44
|
||||||
build_version=00003
|
build_version=00007
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
@@ -41,10 +41,6 @@ namespace Locale
|
|||||||
Recommended = "Recommended"
|
Recommended = "Recommended"
|
||||||
Playlists = "Playlists"
|
Playlists = "Playlists"
|
||||||
WatchHistory = "Watch history"
|
WatchHistory = "Watch history"
|
||||||
Trending = "Trending"
|
|
||||||
TrendingMovies = "Trending - Movies"
|
|
||||||
TrendingMusic = "Trending - Music"
|
|
||||||
TrendingGaming = "Trending - Gaming"
|
|
||||||
Popular = "Popular"
|
Popular = "Popular"
|
||||||
Videos = "Videos"
|
Videos = "Videos"
|
||||||
Shorts = "Shorts"
|
Shorts = "Shorts"
|
||||||
|
|||||||
Generated
+1286
-1644
File diff suppressed because it is too large.
Load diff
+16
-17
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.44.3",
|
"version": "0.44.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -9,29 +9,28 @@
|
|||||||
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||||
"@tailwindcss/postcss": "^4.1.17",
|
"@tailwindcss/postcss": "^4.2.2",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@tsconfig/svelte": "^5.0.5",
|
"@tsconfig/svelte": "^5.0.8",
|
||||||
"@vitejs/plugin-legacy": "^7.2.1",
|
"@vitejs/plugin-legacy": "^8.0.0",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.27",
|
||||||
"bgutils-js": "^3.2.0",
|
"bgutils-js": "^3.2.0",
|
||||||
"daisyui": "^5.4.7",
|
"daisyui": "^5.5.19",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.3.1",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.8",
|
||||||
"rollup-plugin-visualizer": "^6.0.5",
|
"rollup-plugin-visualizer": "^7.0.1",
|
||||||
"svelte": "^5.43.4",
|
"svelte": "^5.54.0",
|
||||||
"svelte-check": "^4.3.3",
|
"svelte-check": "^4.4.5",
|
||||||
"svelte-preprocess": "^6.0.3",
|
"svelte-preprocess": "^6.0.3",
|
||||||
"tailwindcss": "^4.1.17",
|
"tailwindcss": "^4.2.2",
|
||||||
"terser": "^5.44.1",
|
"terser": "^5.46.1",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^7.2.2",
|
"vite": "^8.0.1",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-tsconfig-paths": "^5.1.4",
|
"youtubei.js": "^17.0.1"
|
||||||
"youtubei.js": "^16.0.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,20 +141,8 @@ export class YoutubeJs {
|
|||||||
|
|
||||||
static initJsEvaluator() {
|
static initJsEvaluator() {
|
||||||
Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => {
|
Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => {
|
||||||
const properties = [];
|
return new Function(data.output)();
|
||||||
|
};
|
||||||
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)();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async generateVisitorData() {
|
static async generateVisitorData() {
|
||||||
@@ -255,6 +243,10 @@ export class YoutubeJs {
|
|||||||
po_token: await YoutubeJs.generatePoToken(videoId),
|
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.
|
// We can't generate a proper dash from live videos.
|
||||||
// By returning null, we're telling Playlet to fetch video info itself.
|
// By returning null, we're telling Playlet to fetch video info itself.
|
||||||
if (info.basic_info.is_live) {
|
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}` : "",
|
init: format.init_range ? `${format.init_range.start}-${format.init_range.end}` : "",
|
||||||
index: format.index_range ? `${format.index_range.start}-${format.index_range.end}` : "",
|
index: format.index_range ? `${format.index_range.start}-${format.index_range.end}` : "",
|
||||||
bitrate: `${format.bitrate}`,
|
bitrate: `${format.bitrate}`,
|
||||||
url: await format.decipher(YoutubeJs.innerTube.session.player),
|
|
||||||
itag: `${format.itag}`,
|
itag: `${format.itag}`,
|
||||||
type: format.mime_type,
|
type: format.mime_type,
|
||||||
clen: `${format.approx_duration_ms}`,
|
clen: `${format.approx_duration_ms}`,
|
||||||
lmt: `${format.last_modified}`,
|
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) {
|
if (format.audio_quality) {
|
||||||
result.audioQuality = format.audio_quality;
|
result.audioQuality = format.audio_quality;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,28 +49,43 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function playOnTv() {
|
async function playOnTv() {
|
||||||
const videoInfo = getVideoInfo();
|
try {
|
||||||
await PlayletApi.playVideo(videoInfo);
|
const videoInfo = getVideoInfo();
|
||||||
|
await PlayletApi.playVideo(videoInfo);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
alert(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function playOnTvYtjs() {
|
async function playOnTvYtjs() {
|
||||||
const videoInfo = getVideoInfo() as any;
|
try {
|
||||||
|
const videoInfo = getVideoInfo() as any;
|
||||||
|
|
||||||
// measure length of time it takes to get video info
|
// measure length of time it takes to get video info
|
||||||
const start = performance.now();
|
const start = performance.now();
|
||||||
const metadata = await YoutubeJs.getVideoInfo(videoId);
|
const metadata = await YoutubeJs.getVideoInfo(videoId);
|
||||||
const end = performance.now();
|
const end = performance.now();
|
||||||
console.log(`Time to get video info: ${end - start}ms`);
|
console.log(`Time to get video info: ${end - start}ms`);
|
||||||
|
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
videoInfo.metadata = metadata;
|
videoInfo.metadata = metadata;
|
||||||
|
}
|
||||||
|
await PlayletApi.playVideo(videoInfo);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
alert(error);
|
||||||
}
|
}
|
||||||
await PlayletApi.playVideo(videoInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queueOnTv() {
|
async function queueOnTv() {
|
||||||
const videoInfo = getVideoInfo();
|
try {
|
||||||
await PlayletApi.queueVideo(videoInfo);
|
const videoInfo = getVideoInfo();
|
||||||
|
await PlayletApi.queueVideo(videoInfo);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
alert(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openInvidious() {
|
function openInvidious() {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { visualizer } from 'rollup-plugin-visualizer';
|
|||||||
import { defineConfig, UserConfig } from 'vite'
|
import { defineConfig, UserConfig } from 'vite'
|
||||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||||
import viteCompression from 'vite-plugin-compression';
|
import viteCompression from 'vite-plugin-compression';
|
||||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
||||||
import ip from 'ip';
|
import ip from 'ip';
|
||||||
import { existsSync, readFileSync } from 'fs'
|
import { existsSync, readFileSync } from 'fs'
|
||||||
import { join as joinPath } from 'path'
|
import { join as joinPath } from 'path'
|
||||||
@@ -13,7 +12,6 @@ const PORT = 5173
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [
|
plugins: [
|
||||||
tsconfigPaths(),
|
|
||||||
svelte(),
|
svelte(),
|
||||||
legacy({
|
legacy({
|
||||||
targets: ['defaults', 'not IE 11'],
|
targets: ['defaults', 'not IE 11'],
|
||||||
@@ -23,6 +21,9 @@ const config: UserConfig = {
|
|||||||
deleteOriginFile: true
|
deleteOriginFile: true
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
resolve: {
|
||||||
|
tsconfigPaths: true
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: "../playlet-lib/src/www",
|
outDir: "../playlet-lib/src/www",
|
||||||
emptyOutDir: true
|
emptyOutDir: true
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ INVIDIOUS_HMAC_KEY=PASSWORD_1
|
|||||||
INVIDIOUS_COMPANION_KEY=PASSWORD_2
|
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.
|
Invidious should now be running locally on port 3000.
|
||||||
@@ -32,7 +32,7 @@ services:
|
|||||||
# Use the key generated in the 2nd step
|
# Use the key generated in the 2nd step
|
||||||
hmac_key: $INVIDIOUS_HMAC_KEY
|
hmac_key: $INVIDIOUS_HMAC_KEY
|
||||||
healthcheck:
|
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
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 2
|
retries: 2
|
||||||
|
|||||||
Reference in new issue
Block a user