Compare commits

..
10 Commits
Author SHA1 Message Date
Brahim Hadriche 7f8cdeb351 Release v0.40.9 (#672) 2025-07-06 12:19:03 -04:00
Brahim Hadriche 674ec708e7 logs 2025-07-06 12:13:37 -04:00
Brahim Hadriche b368b40721 update deps 2025-07-06 12:03:11 -04:00
Brahim Hadriche 10f9d1bf05 [skip ci] small fixes 2025-07-05 10:20:07 -04:00
Brahim Hadriche 51b2f7793a small tweak 2025-06-29 15:04:06 -04:00
Brahim Hadriche 3d6678fb72 Parse LOCKUP_CONTENT_TYPE_VIDEO 2025-06-29 15:03:03 -04:00
Brahim Hadriche 75e6848df8 [perf] reduce number of rendezvous when reading invidious instance name 2025-06-29 13:54:20 -04:00
Brahim Hadriche c70d00e156 [skip ci] Fix for https://github.com/iBicha/playlet/issues/671 2025-06-28 17:35:28 -04:00
Brahim Hadriche 19f304bd3e Gracefully handle missing playlists in Playlet backend (#670)
* Gracefully handle missing playlists in Playlet backend

* Changelog
2025-06-26 22:02:51 -04:00
Brahim Hadriche 45a85f92b3 [skip ci] small refactor 2025-06-22 19:27:54 -04:00
22 changed files with 289 additions and 198 deletions

No files matched your search

+8
View File
@@ -5,6 +5,14 @@ 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.40.9] - 2025-07-06
### Fixed
- A bug preventing the removal of bookmarked private playlists
- [perf] Reduce number of rendezvous when reading invidious instance name
- Also fixes an edge case error when device loses connectivity
## [0.40.8] - 2025-06-22
### Fixed
+67 -60
View File
@@ -1,33 +1,33 @@
{
"name": "playlet",
"version": "0.40.8",
"version": "0.40.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.40.8",
"version": "0.40.9",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.32",
"@rokucommunity/bslint": "^0.8.33",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^24.0.3",
"@types/node": "^24.0.10",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.68.5",
"brighterscript-formatter": "^1.7.15",
"brighterscript-formatter": "^1.7.16",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^16.5.0",
"dotenv": "^17.0.1",
"fs-extra": "^11.3.0",
"glob": "^11.0.3",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.7.3",
"mailparser": "^3.7.4",
"protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.10.2",
"puppeteer": "^24.11.2",
"roku-deploy": "^3.12.6",
"roku-test-automation": "^2.0.13",
"rooibos-roku": "5.15.7",
@@ -43,7 +43,7 @@
"node": "22"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.44.0"
"@rollup/rollup-linux-x64-gnu": "^4.44.2"
}
},
"node_modules/@babel/code-frame": {
@@ -414,9 +414,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint": {
"version": "0.8.32",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.32.tgz",
"integrity": "sha512-wwoRpXYGEC9VMrWdrvL0wm67+R21VtwVVWtD9k6+O5f3p64uCwymr28n1C7BNIEj/+wHzkDhSGvzxZRC2QjWWg==",
"version": "0.8.33",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.33.tgz",
"integrity": "sha512-FlEfpR3jLa99uz69+JEPJNbnAejI+sL62fyWKoKeuhki/a6vVBavTV0alGPavmGkw3EOTQdM6pSntsN349srkg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -573,9 +573,9 @@
}
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.0.tgz",
"integrity": "sha512-iUVJc3c0o8l9Sa/qlDL2Z9UP92UZZW1+EmQ4xfjTc1akr0iUFZNfxrXJ/R1T90h/ILm9iXEY6+iPrmYB3pXKjw==",
"version": "4.44.2",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.2.tgz",
"integrity": "sha512-/bXb0bEsWMyEkIsUL2Yt5nFB5naLAwyOWMEviQfQY1x3l5WsLKgvZf66TM7UTfED6erckUVUJQ/jJ1FSpm3pRQ==",
"cpu": [
"x64"
],
@@ -736,9 +736,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "24.0.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.3.tgz",
"integrity": "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg==",
"version": "24.0.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.10.tgz",
"integrity": "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1323,13 +1323,13 @@
}
},
"node_modules/brighterscript-formatter": {
"version": "1.7.15",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.15.tgz",
"integrity": "sha512-cEmAbHWWwxuk8M+z35Y8hzy8IPrKzrlhdgBOyF1EK/c1rvcaBC+Z+Rb+tRCjMFjryrrFFwFauUwPmM+E+QcK6g==",
"version": "1.7.16",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.16.tgz",
"integrity": "sha512-wDQicXbPos1M0v1J5YukQJTZNog/+/sOqJe9MP7CQoiS7MacnzvliFeiegSqxMdAzx7SA+UFD64plCaPrd7Qyg==",
"dev": true,
"license": "MIT",
"dependencies": {
"brighterscript": "^0.69.10",
"brighterscript": "^0.69.11",
"glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0",
"source-map": "^0.7.3",
@@ -1365,9 +1365,9 @@
}
},
"node_modules/brighterscript-formatter/node_modules/brighterscript": {
"version": "0.69.10",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.10.tgz",
"integrity": "sha512-E8QCzN5bueG+SYJUdQ+1vw/frIV3WrpvoLgbNkAhYLOC6bSwoqmETwmgaiXpnY66Qe2zeAapXCbBcWVVIA7AQA==",
"version": "0.69.11",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.11.tgz",
"integrity": "sha512-Iq8lcCERkk6QwSn5Y+tAFZSEQbCZX6rDGpQkVPzNHzR/BtHTYsP/wSmbSIvghGQly+PihoBftR9i1txd6DD3lA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2830,9 +2830,9 @@
}
},
"node_modules/dotenv": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==",
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.0.1.tgz",
"integrity": "sha512-GLjkduuAL7IMJg/ZnOPm9AnWKJ82mSE2tzXLaJ/6hD6DhwGfZaXG77oB8qbReyiczNxnbxQKyh0OE5mXq0bAHA==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
@@ -4365,9 +4365,9 @@
"license": "MIT"
},
"node_modules/libmime": {
"version": "5.3.6",
"resolved": "https://registry.npmjs.org/libmime/-/libmime-5.3.6.tgz",
"integrity": "sha512-j9mBC7eiqi6fgBPAGvKCXJKJSIASanYF4EeA4iBzSG0HxQxmXnR3KbyWqTn4CwsKSebqCv2f5XZfAO6sKzgvwA==",
"version": "5.3.7",
"resolved": "https://registry.npmjs.org/libmime/-/libmime-5.3.7.tgz",
"integrity": "sha512-FlDb3Wtha8P01kTL3P9M+ZDNDWPKPmKHWaU/cG/lg5pfuAwdflVpZE+wm9m7pKmC5ww6s+zTxBKS1p6yl3KpSw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4462,9 +4462,9 @@
}
},
"node_modules/mailparser": {
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.7.3.tgz",
"integrity": "sha512-0RM14cZF0gO1y2Q/82hhWranispZOUSYHwvQ21h12x90NwD6+D5q59S5nOLqCtCdYitHN58LJXWEHa4RWm7BYA==",
"version": "3.7.4",
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.7.4.tgz",
"integrity": "sha512-Beh4yyR4jLq3CZZ32asajByrXnW8dLyKCAQD3WvtTiBnMtFWhxO+wa93F6sJNjDmfjxXs4NRNjw3XAGLqZR3Vg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4472,23 +4472,23 @@
"he": "1.2.0",
"html-to-text": "9.0.5",
"iconv-lite": "0.6.3",
"libmime": "5.3.6",
"libmime": "5.3.7",
"linkify-it": "5.0.0",
"mailsplit": "5.4.3",
"nodemailer": "7.0.3",
"mailsplit": "5.4.5",
"nodemailer": "7.0.4",
"punycode.js": "2.3.1",
"tlds": "1.259.0"
}
},
"node_modules/mailsplit": {
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.4.3.tgz",
"integrity": "sha512-PFV0BBh4Tv7Omui5FtXXVtN4ExAxIi8Yvmb9JgBz+J6Hnnrv/YYXLlKKudLhXwd3/qWEATOslRsnzVCWDeCnmQ==",
"version": "5.4.5",
"resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.4.5.tgz",
"integrity": "sha512-oMfhmvclR689IIaQmIcR5nODnZRRVwAKtqFT407TIvmhX2OLUBnshUTcxzQBt3+96sZVDud9NfSe1NxAkUNXEQ==",
"dev": true,
"license": "(MIT OR EUPL-1.1+)",
"dependencies": {
"libbase64": "1.3.0",
"libmime": "5.3.6",
"libmime": "5.3.7",
"libqp": "2.1.1"
}
},
@@ -4792,9 +4792,9 @@
}
},
"node_modules/nodemailer": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.3.tgz",
"integrity": "sha512-Ajq6Sz1x7cIK3pN6KesGTah+1gnwMnx5gKl3piQlQQE/PwyJ4Mbc8is2psWYxK3RJTVeqsDaCv8ZzXLCDHMTZw==",
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.4.tgz",
"integrity": "sha512-9O00Vh89/Ld2EcVCqJ/etd7u20UhME0f/NToPfArwPEe1Don1zy4mAIz6ariRr7mJ2RDxtaDzN0WJVdVXPtZaw==",
"dev": true,
"license": "MIT-0",
"engines": {
@@ -5441,9 +5441,9 @@
}
},
"node_modules/puppeteer": {
"version": "24.10.2",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.10.2.tgz",
"integrity": "sha512-+k26rCz6akFZntx0hqUoFjCojgOLIxZs6p2k53LmEicwsT8F/FMBKfRfiBw1sitjiCvlR/15K7lBqfjXa251FA==",
"version": "24.11.2",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.11.2.tgz",
"integrity": "sha512-HopdRZWHa5zk0HSwd8hU+GlahQ3fmesTAqMIDHVY9HasCvppcYuHYXyjml0nlm+nbwVCqAQWV+dSmiNCrZGTGQ==",
"dev": true,
"hasInstallScript": true,
"license": "Apache-2.0",
@@ -5451,8 +5451,8 @@
"@puppeteer/browsers": "2.10.5",
"chromium-bidi": "5.1.0",
"cosmiconfig": "^9.0.0",
"devtools-protocol": "0.0.1452169",
"puppeteer-core": "24.10.2",
"devtools-protocol": "0.0.1464554",
"puppeteer-core": "24.11.2",
"typed-query-selector": "^2.12.0"
},
"bin": {
@@ -5582,6 +5582,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/puppeteer/node_modules/devtools-protocol": {
"version": "0.0.1464554",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1464554.tgz",
"integrity": "sha512-CAoP3lYfwAGQTaAXYvA6JZR0fjGUb7qec1qf4mToyoH2TZgUFeIqYcjh6f9jNuhHfuZiEdH+PONHYrLhRQX6aw==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/puppeteer/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -5590,18 +5597,18 @@
"license": "MIT"
},
"node_modules/puppeteer/node_modules/puppeteer-core": {
"version": "24.10.2",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.10.2.tgz",
"integrity": "sha512-CnzhOgrZj8DvkDqI+Yx+9or33i3Y9uUYbKyYpP4C13jWwXx/keQ38RMTMmxuLCWQlxjZrOH0Foq7P2fGP7adDQ==",
"version": "24.11.2",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.11.2.tgz",
"integrity": "sha512-c49WifNb8hix+gQH17TldmD6TC/Md2HBaTJLHexIUq4sZvo2pyHY/Pp25qFQjibksBu/SJRYUY7JsoaepNbiRA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "2.10.5",
"chromium-bidi": "5.1.0",
"debug": "^4.4.1",
"devtools-protocol": "0.0.1452169",
"devtools-protocol": "0.0.1464554",
"typed-query-selector": "^2.12.0",
"ws": "^8.18.2"
"ws": "^8.18.3"
},
"engines": {
"node": ">=18"
@@ -5693,9 +5700,9 @@
}
},
"node_modules/puppeteer/node_modules/zod": {
"version": "3.25.67",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.67.tgz",
"integrity": "sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==",
"version": "3.25.74",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.74.tgz",
"integrity": "sha512-J8poo92VuhKjNknViHRAIuuN6li/EwFbAC8OedzI8uxpEPGiXHGQu9wemIAioIpqgfB4SySaJhdk0mH5Y4ICBg==",
"dev": true,
"license": "MIT",
"funding": {
@@ -8004,9 +8011,9 @@
"dev": true
},
"node_modules/ws": {
"version": "8.18.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
"integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==",
"version": "8.18.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
"dev": true,
"license": "MIT",
"engines": {
+8 -8
View File
@@ -1,27 +1,27 @@
{
"name": "playlet",
"version": "0.40.8",
"version": "0.40.9",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.32",
"@rokucommunity/bslint": "^0.8.33",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^24.0.3",
"@types/node": "^24.0.10",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.68.5",
"brighterscript-formatter": "^1.7.15",
"brighterscript-formatter": "^1.7.16",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^16.5.0",
"dotenv": "^17.0.1",
"fs-extra": "^11.3.0",
"glob": "^11.0.3",
"imap": "^0.8.19",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.7.3",
"mailparser": "^3.7.4",
"protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.10.2",
"puppeteer": "^24.11.2",
"roku-deploy": "^3.12.6",
"roku-test-automation": "^2.0.13",
"rooibos-roku": "5.15.7",
@@ -74,6 +74,6 @@
"shutdown": "node tools/shutdown.js"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.44.0"
"@rollup/rollup-linux-x64-gnu": "^4.44.2"
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.40.8",
"version": "0.40.9",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.40.8"
"version": "0.40.9"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.40.8",
"version": "0.40.9",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../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=40
build_version=00008
build_version=00009
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.40.8",
"version": "0.40.9",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.40.8"
"version": "0.40.9"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.40.8",
"version": "0.40.9",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-lib",
@@ -43,11 +43,13 @@ function OnRequest(event as object) as void
m.pendingRequestEvents = []
end if
m.pendingRequestEvents.push(event)
LogWarn("JobQueue: Job queue task is not ready, request will be queued")
return
end if
request = event.getData()
if not IsAssociativeArray(request)
LogError("JobQueue: Invalid request data", request)
return
end if
@@ -1,6 +1,6 @@
' Throw an error if an unknown node is encountered.
' Only used in debug mode.
#const THROW_ON_UNKNOWN_NODES = true
#const DEBUG_THROW_ON_UNKNOWN_NODES = true
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/ObjectUtils.bs"
@@ -26,7 +26,7 @@ namespace Innertube
directive = directives[key]
if directive = invalid
LogWarn("Unknown node", key, `\n`, FormatJson(nodeData[key]))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG_THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown node: " + key
#end if
@@ -959,7 +959,9 @@ namespace Innertube
function ParseLockupViewModel(nodeData as object, context as object) as object
contentType = ValidString(nodeData["contentType"])
if contentType = "LOCKUP_CONTENT_TYPE_PLAYLIST"
if contentType = "LOCKUP_CONTENT_TYPE_VIDEO"
return LockupViewModelTypeVideo(nodeData, context)
else if contentType = "LOCKUP_CONTENT_TYPE_PLAYLIST"
return LockupViewModelTypePlaylist(nodeData, context)
else if contentType = "LOCKUP_CONTENT_TYPE_PODCAST"
return LockupViewModelTypePodcast(nodeData, context)
@@ -968,7 +970,7 @@ namespace Innertube
end if
LogWarn("Unknown content type:", contentType, `\n`, FormatJson(nodeData))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG_THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown content type: " + contentType
#end if
@@ -976,6 +978,65 @@ namespace Innertube
return invalid
end function
function LockupViewModelTypeVideo(nodeData as object, context as object) as object
videoId = nodeData["contentId"]
if not IsString(videoId)
LogWarn("Invalid video ID", `\n`, FormatJson(nodeData))
return invalid
end if
metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"])
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "thumbnailViewModel"])
if context.generateVideoThumbnails = true
videoThumbnails = GenerateVideoThumbnails(videoId)
else
videoThumbnails = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources"])
if videoThumbnails = invalid
videoThumbnails = GenerateVideoThumbnails(videoId)
end if
end if
lengthText = ValidString(ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"]))
authorId = ObjectUtils.Dig(metadata, ["image", "decoratedAvatarViewModel", "rendererContext", "commandContext", "onTap", "innertubeCommand", "browseEndpoint", "browseId"])
lines = invalid
contentMetadataViewModel = ObjectUtils.Dig(metadata, ["metadata", "contentMetadataViewModel"])
metadataRows = ObjectUtils.Dig(contentMetadataViewModel, ["metadataRows"])
if IsArray(metadataRows) and metadataRows.Count() > 0
delimiter = ValidString(contentMetadataViewModel["delimiter"])
lines = []
for each metadataRow in metadataRows
metadataParts = ObjectUtils.Dig(metadataRow, ["metadataParts"])
if IsArray(metadataParts) and metadataParts.Count() > 0
parts = []
for each metadataPart in metadataParts
parts.Push(ValidString(ObjectUtils.Dig(metadataPart, ["text", "content"])))
end for
if parts.Count() > 0
lines.Push(parts.Join(delimiter))
end if
end if
end for
end if
video = {
"type": "video"
"videoId": videoId
"title": title
"authorId": authorId
"lines": lines
"videoThumbnails": videoThumbnails
"videoCountText": lengthText
}
PushFeedItem(video, context)
return invalid
end function
function LockupViewModelTypePlaylist(nodeData as object, context as object) as object
playlistId = nodeData["contentId"]
if not IsString(playlistId)
@@ -993,7 +1054,7 @@ namespace Innertube
author = invalid
authorId = invalid
maybeAuthorNode = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel", "metadata", "contentMetadataViewModel", "metadataRows", 0, "metadataParts", 0, "text"])
maybeAuthorNode = ObjectUtils.Dig(metadata, ["metadata", "contentMetadataViewModel", "metadataRows", 0, "metadataParts", 0, "text"])
maybeAuthorId = ObjectUtils.Dig(maybeAuthorNode, ["commandRuns", 0, "onTap", "innertubeCommand", "browseEndpoint", "browseId"])
if IsString(maybeAuthorId) and maybeAuthorId.StartsWith("UC")
authorId = maybeAuthorId
@@ -1179,7 +1240,7 @@ namespace Innertube
end if
LogWarn("Unknown content type:", contentType, `\n`, FormatJson(nodeData))
#if THROW_ON_UNKNOWN_NODES
#if DEBUG_THROW_ON_UNKNOWN_NODES
#if DEBUG
throw "Unknown content type: " + contentType
#end if
@@ -75,7 +75,6 @@ namespace Innertube
"videoId": videoDetails["videoId"]
"videoThumbnails": videoDetails["thumbnail"]["thumbnails"]
"storyboards": ParseStoryboards(payload, lengthSeconds)
"viewCount": videoDetails["viewCount"].ToInt()
"author": videoDetails["author"]
"authorId": videoDetails["channelId"]
"lengthSeconds": lengthSeconds
@@ -87,6 +86,10 @@ namespace Innertube
"recommendedVideos": []
}
if videoDetails.DoesExist("viewCount")
videoInfo["viewCount"] = videoDetails["viewCount"].ToInt()
end if
return videoInfo
end function
@@ -78,7 +78,7 @@ namespace Invidious
end if
end if
return m.GetPlayletBuiltinInstance()
return PLAYLET_BUILT_IN_INSTANCE
end function
function GetInvidiousInstance() as string
@@ -89,13 +89,6 @@ namespace Invidious
return m.preferences["invidious.instance"]
end function
function GetPlayletBuiltinInstance() as string
instance = PLAYLET_BUILT_IN_INSTANCE
address = m.invidiousNode.webServer@.GetServerAddress()
instance = instance.Replace("http://127.0.0.1:8888", address)
return instance
end function
function MarkVideoWatched(videoId as dynamic, cancellation = invalid as object) as void
if StringUtils.IsNullOrEmpty(videoId)
return
@@ -417,23 +410,27 @@ namespace Invidious
function DefaultHandler(context as object) as object
response = context.response
if response.StatusCode() = 200
json = response.Json()
if IsArray(json)
json = {
items: json
}
end if
return json
if not response.IsSuccess()
return invalid
end if
return invalid
json = response.Json()
if json = invalid
return invalid
end if
if IsArray(json)
json = {
items: json
}
end if
return json
end function
function PlaylistHandler(context as object) as object
response = context.response
statusCode = response.StatusCode()
if statusCode = 404
if not response.IsSuccess()
' Similar to VideoInfoHandler, we can return a valid response
' in case of a deleted playlist.
response.OverrideStatusCode(200)
@@ -447,24 +444,24 @@ namespace Invidious
}
end if
if statusCode = 200
json = response.Json()
result = {
items: json.videos
}
if json.continuation <> invalid
result.continuation = json.continuation
end if
return result
json = response.Json()
if json = invalid
return invalid
end if
return invalid
result = {
items: json.videos
}
if json.continuation <> invalid
result.continuation = json.continuation
end if
return result
end function
function ChannelVideosHandler(context as object) as object
response = context.response
statusCode = response.StatusCode()
if statusCode = 404 or statusCode = 500
if not response.IsSuccess()
' Similar to VideoInfoHandler, we can return a valid response
' in case of a deleted channel.
response.OverrideStatusCode(200)
@@ -478,46 +475,43 @@ namespace Invidious
}
end if
if response.StatusCode() = 200
json = response.Json()
return {
items: json.videos
continuation: json.continuation
sortOptions: json.sortOptions
}
json = response.Json()
if json = invalid
return invalid
end if
return invalid
return {
items: json.videos
continuation: json.continuation
sortOptions: json.sortOptions
}
end function
function ChannelPlaylistsHandler(context as object) as object
response = context.response
if response.StatusCode() = 200
json = response.Json()
' Courses are not yet implemented in Invidious.
' In this case, Invidious returns 200, but the response is empty.
' https://github.com/iv-org/invidious/issues/5088
' https://github.com/iv-org/invidious/issues/5144
if json = invalid
json = {
playlists: []
}
end if
if not response.IsSuccess()
return invalid
end if
return {
items: json.playlists
continuation: json.continuation
sortOptions: json.sortOptions
json = response.Json()
if json = invalid
json = {
playlists: []
}
end if
return invalid
return {
items: json.playlists
continuation: json.continuation
sortOptions: json.sortOptions
}
end function
function VideoInfoHandler(context as object) as object
response = context.response
statusCode = response.StatusCode()
if statusCode >= 500 or statusCode = 404
if not response.IsSuccess()
' In some cases, such as a video became private, or a live stream ended,
' Invidious returns a 500 error. We can in this case return a valid response
' with just a video id, which will allow us to show a valid thumbnail if possible.
@@ -533,22 +527,21 @@ namespace Invidious
}
end if
if statusCode = 200
json = response.Json()
json.type = "video"
return {
items: [json]
}
json = response.Json()
if json = invalid
return invalid
end if
return invalid
json.type = "video"
return {
items: [json]
}
end function
function PlaylistInfoHandler(context as object) as object
response = context.response
statusCode = response.StatusCode()
if statusCode = 404
if not response.IsSuccess()
' Similar to VideoInfoHandler, we can return a valid response
' in case of a deleted playlist.
response.OverrideStatusCode(200)
@@ -561,21 +554,21 @@ namespace Invidious
}
end if
if statusCode = 200
json = response.Json()
json.type = "playlist"
return {
items: [json]
}
json = response.Json()
if json = invalid
return invalid
end if
return invalid
json.type = "playlist"
return {
items: [json]
}
end function
function ChannelInfoHandler(context as object) as object
response = context.response
statusCode = response.StatusCode()
if statusCode = 404 or statusCode = 500
if not response.IsSuccess()
' Similar to VideoInfoHandler, we can return a valid response
' in case of a deleted channel.
response.OverrideStatusCode(200)
@@ -588,14 +581,15 @@ namespace Invidious
}
end if
if statusCode = 200
json = response.Json()
json.type = "channel"
return {
items: [json]
}
json = response.Json()
if json = invalid
return invalid
end if
return invalid
json.type = "channel"
return {
items: [json]
}
end function
function AuthFeedHandler(context as object) as object
@@ -604,7 +598,7 @@ namespace Invidious
m.DeleteExpiredToken(response, authToken)
if response.StatusCode() <> 200
if not response.IsSuccess()
return invalid
end if
@@ -640,7 +634,7 @@ namespace Invidious
m.DeleteExpiredToken(response, authToken)
if response.StatusCode() <> 200
if not response.IsSuccess()
return invalid
end if
@@ -739,7 +733,7 @@ namespace Invidious
function GetAuthorizeTokenLink() as dynamic
instance = m.GetInvidiousInstance()
if StringUtils.IsNullOrEmpty(instance)
instance = m.GetPlayletBuiltinInstance()
return invalid
end if
' Make sure the host is not on https, because https cannot redirect to http, which is our local server
@@ -213,8 +213,8 @@ function AddUrls(streamUrls as object, url as string, urlLocal as dynamic, urlFi
end if
end function
function AddInstanceToUrlIfNeeded(url as object, instance as string) as string
if url.StartsWith("/")
function AddInstanceToUrlIfNeeded(url as dynamic, instance as string) as dynamic
if IsString(url) and url.StartsWith("/")
return instance + url
end if
return url
+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=40
build_version=00008
build_version=00009
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+14 -14
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-web",
"version": "0.40.8",
"version": "0.40.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.40.8",
"version": "0.40.9",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"@tailwindcss/typography": "^0.5.16",
@@ -15,10 +15,10 @@
"autoprefixer": "^10.4.21",
"bgutils-js": "^3.2.0",
"daisyui": "^4.12.23",
"dotenv": "^16.5.0",
"dotenv": "^17.0.1",
"ip": "^2.0.1",
"postcss": "^8.5.6",
"svelte": "^5.34.7",
"svelte": "^5.35.2",
"svelte-check": "^4.2.2",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^3.4.17",
@@ -3006,9 +3006,9 @@
"dev": true
},
"node_modules/dotenv": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz",
"integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==",
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.0.1.tgz",
"integrity": "sha512-GLjkduuAL7IMJg/ZnOPm9AnWKJ82mSE2tzXLaJ/6hD6DhwGfZaXG77oB8qbReyiczNxnbxQKyh0OE5mXq0bAHA==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
@@ -3093,9 +3093,9 @@
"dev": true
},
"node_modules/esrap": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.9.tgz",
"integrity": "sha512-3OMlcd0a03UGuZpPeUC1HxR3nA23l+HEyCiZw3b3FumJIN9KphoGzDJKMXI1S72jVS1dsenDyQC0kJlO1U9E1g==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-2.1.0.tgz",
"integrity": "sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4416,9 +4416,9 @@
}
},
"node_modules/svelte": {
"version": "5.34.7",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.34.7.tgz",
"integrity": "sha512-5PEg+QQKce4t1qiOtVUhUS3AQRTtxJyGBTpxLcNWnr0Ve8q4r06bMo0Gv8uhtCPWlztZHoi3Ye7elLhu+PCTMg==",
"version": "5.35.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.35.2.tgz",
"integrity": "sha512-uW/rRXYrhZ7Dh4UQNZ0t+oVGL1dEM+95GavCO8afAk1IY2cPq9BcZv9C3um5aLIya2y8lIeLPxLII9ASGg9Dzw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4431,7 +4431,7 @@
"axobject-query": "^4.1.0",
"clsx": "^2.1.1",
"esm-env": "^1.2.1",
"esrap": "^1.4.8",
"esrap": "^2.1.0",
"is-reference": "^3.0.3",
"locate-character": "^3.0.0",
"magic-string": "^0.30.11",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.40.8",
"version": "0.40.9",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,10 +16,10 @@
"autoprefixer": "^10.4.21",
"bgutils-js": "^3.2.0",
"daisyui": "^4.12.23",
"dotenv": "^16.5.0",
"dotenv": "^17.0.1",
"ip": "^2.0.1",
"postcss": "^8.5.6",
"svelte": "^5.34.7",
"svelte": "^5.35.2",
"svelte-check": "^4.2.2",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^3.4.17",
+16 -1
View File
@@ -1,12 +1,15 @@
import { PlayletApi } from "lib/Api/PlayletApi";
import { getHost } from "./Host";
const DISABLE_CACHE = true;
export class InvidiousApi {
public instance: string;
static host = () => `http://${getHost()}`
public endpoints: any;
public isLoggedIn: boolean = false;
public userCountryCode: string = 'US';
private instance: string;
responseHandlers: any;
@@ -23,6 +26,18 @@ export class InvidiousApi {
}
}
public setInstance(instance: string) {
if (!instance) {
return;
}
if (instance.startsWith("http://127.0.0.1:8888")) {
instance = instance.replace("http://127.0.0.1:8888", InvidiousApi.host());
}
this.instance = instance;
}
public async searchSuggestions(query: string) {
const url = `${this.instance}/api/v1/search/suggestions?q=${encodeURIComponent(query)}&region=${this.userCountryCode}`;
const response = await fetch(url);
+1 -1
View File
@@ -24,7 +24,7 @@
let invidiousApi = new InvidiousApi();
playletStateStore.subscribe((value) => {
invidiousApi.instance = value?.invidious?.instance;
invidiousApi.setInstance(value?.invidious?.instance);
});
onMount(() => {
+8 -6
View File
@@ -2,9 +2,6 @@
import { playletStateStore, translate } from "lib/Stores";
import { PlayletApi } from "./Api/PlayletApi";
import { get } from "svelte/store";
import { getHost } from "./Api/Host";
const host = () => `http://${getHost()}`;
export function show() {
modal.showModal();
@@ -32,9 +29,8 @@
playletStateStore.subscribe((value) => {
authUrl = value?.invidious?.auth_url;
currentInstance =
value?.invidious?.invidious_instance || value?.invidious?.instance || "";
if (currentInstance === `${host()}/playlet-invidious-backend`) {
currentInstance = value?.invidious?.invidious_instance || "";
if (!currentInstance) {
const trFn = get(translate);
currentInstanceName = trFn("Playlet built-in backend");
} else {
@@ -69,10 +65,16 @@
}
function loginToInvidious() {
if (!currentInstance) {
alert("No Invidious instance configured. Please set one in settings.");
return;
}
if (!authUrl) {
alert("Error with login, please refresh the page.");
return;
}
window.location = authUrl;
}
@@ -153,7 +153,6 @@ ${JSON.stringify(profilesInfo, null, 2)}
}
const url = `https://github.com/iBicha/playlet/issues/new?title=${feedbackTitle}&body=${bodyEncoded}`;
console.log("Github URL length:", url.length);
return url;
}
@@ -31,7 +31,7 @@
let searchFiltersLabel;
playletStateStore.subscribe((value) => {
invidiousApi.instance = value?.invidious?.instance;
invidiousApi.setInstance(value?.invidious?.instance);
let userCountryCode = value?.device?.user_country_code;
if (!userCountryCode || userCountryCode === "OT") {
userCountryCode = "US";
@@ -86,7 +86,7 @@
let invidiousApi = new InvidiousApi();
playletStateStore.subscribe((value) => {
invidiousApi.instance = value?.invidious?.instance;
invidiousApi.setInstance(value?.invidious?.instance);
let userCountryCode = value?.device?.user_country_code;
if (!userCountryCode || userCountryCode === "OT") {
userCountryCode = "US";