Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13cd469400 | ||
|
|
c66f1376a1 | ||
|
|
840474c20c | ||
|
|
6095901939 | ||
|
|
04ed2f82c0 | ||
|
|
932a629793 | ||
|
|
0fb3759c50 | ||
|
|
7b4306914d | ||
|
|
fb2ac53ab6 | ||
|
|
fd00c7bb11 | ||
|
|
a244cdee05 | ||
|
|
8e71ededd2 | ||
|
|
8051458df7 | ||
|
|
4dae928a03 | ||
|
|
d054dd64a5 | ||
|
|
68aeec3d6f | ||
|
|
fc2ffd8c23 | ||
|
|
4906b69f4a | ||
|
|
2c513afafd | ||
|
|
8e156b27f9 | ||
|
|
58e2b48409 | ||
|
|
06326d084e | ||
|
|
0b5bed45cf | ||
|
|
957ac66d70 | ||
|
|
03679b781c | ||
|
|
002307c45b | ||
|
|
fcfda78f2c | ||
|
|
384f41ba99 | ||
|
|
e070fc2df1 | ||
|
|
51d63d2019 | ||
|
|
1eeaced04b |
No files matched your search
@@ -24,10 +24,10 @@ jobs:
|
||||
git config --local user.email "githubaction@githubaction.com"
|
||||
git config --local user.name "github-action linter"
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 22.x
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -19,10 +19,10 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 22.x
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -17,10 +17,10 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 22.x
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -24,10 +24,10 @@ jobs:
|
||||
git config --local user.name "github-action wiki updater"
|
||||
working-directory: ./playlet.wiki
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 22.x
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -12,10 +12,10 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
- name: Use Node.js 22.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 22.x
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -5,6 +5,46 @@ 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.4] - 2025-06-17
|
||||
|
||||
### Fixed
|
||||
|
||||
- Few changes preparing for app store submission
|
||||
|
||||
## [0.40.3] - 2025-06-16
|
||||
|
||||
### Fixed
|
||||
|
||||
- Added a "hint" in the error message when playing a video and login is required.
|
||||
- Various performance improvements
|
||||
|
||||
## [0.40.2] - 2025-06-12
|
||||
|
||||
### Added
|
||||
|
||||
- Channel sort options in Playlet backend (sort videos by Newest, Oldest, Popular)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Perf] reverted a perf fix that wasn't helping
|
||||
- A bug where "Open channel" didn't show up in videos and playlists from logged user
|
||||
|
||||
## [0.40.1] - 2025-06-07
|
||||
|
||||
### Added
|
||||
|
||||
- A way to play longer videos using the web app (Play using ytjs)
|
||||
- German translations
|
||||
|
||||
### Fixed
|
||||
|
||||
- A bug where it says "(Failed to load)" when switching profiles
|
||||
- A bug where searching in web app using iOS causes page to reload
|
||||
|
||||
### Changed
|
||||
|
||||
- Session data duration: increased to 7 days, to avoid Innertube errors
|
||||
|
||||
## [0.40.0] - 2025-06-01
|
||||
|
||||
### Added
|
||||
|
||||
Generated
+104
-64
@@ -1,34 +1,34 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"hasInstallScript": true,
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.31",
|
||||
"@rokucommunity/bslint": "^0.8.32",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^22.15.29",
|
||||
"@types/node": "^24.0.1",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
"argparse": "^2.0.1",
|
||||
"brighterscript": "0.68.5",
|
||||
"brighterscript-formatter": "^1.7.14",
|
||||
"brighterscript-formatter": "^1.7.15",
|
||||
"cheerio": "1.0.0-rc.11",
|
||||
"convert-svg-to-png": "^0.6.4",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"fs-extra": "^11.3.0",
|
||||
"glob": "^11.0.2",
|
||||
"glob": "^11.0.3",
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.7.3",
|
||||
"protocol-buffers-schema": "^3.6.0",
|
||||
"roku-deploy": "^3.12.5",
|
||||
"roku-deploy": "^3.12.6",
|
||||
"roku-test-automation": "^2.0.13",
|
||||
"rooibos-roku": "5.15.7",
|
||||
"rounded-rect-9patch": "^1.1.2",
|
||||
@@ -40,10 +40,10 @@
|
||||
"yaml": "^2.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20"
|
||||
"node": "22"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.41.1"
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.43.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@@ -93,11 +93,35 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/balanced-match": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
|
||||
"integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/brace-expansion": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
|
||||
"integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@isaacs/balanced-match": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^5.1.2",
|
||||
"string-width-cjs": "npm:string-width@^4.2.0",
|
||||
@@ -438,9 +462,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@rokucommunity/bslint": {
|
||||
"version": "0.8.31",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.31.tgz",
|
||||
"integrity": "sha512-/VsycIH2OiEoNe7fCLqbQrDnX/JoKUV3Nufg0+auCM/DhCYzL4iM965VkSBebWzwUsnQXjILaKC4fRcMjpSBPQ==",
|
||||
"version": "0.8.32",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.32.tgz",
|
||||
"integrity": "sha512-wwoRpXYGEC9VMrWdrvL0wm67+R21VtwVVWtD9k6+O5f3p64uCwymr28n1C7BNIEj/+wHzkDhSGvzxZRC2QjWWg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -597,9 +621,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.41.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz",
|
||||
"integrity": "sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==",
|
||||
"version": "4.43.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.43.0.tgz",
|
||||
"integrity": "sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -760,13 +784,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.15.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz",
|
||||
"integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==",
|
||||
"version": "24.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.1.tgz",
|
||||
"integrity": "sha512-MX4Zioh39chHlDJbKmEgydJDS3tspMP/lnQC67G3SWsTnb9NeYVWOjkxpOSy4oMfPs4StcWHwBrvUb4ybfnuaw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
@@ -950,6 +974,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
|
||||
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -1360,13 +1385,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brighterscript-formatter": {
|
||||
"version": "1.7.14",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.14.tgz",
|
||||
"integrity": "sha512-rbK5lT2UZ/yD/JLryIsZC9Kng1vh4xFf9CO1tp8nMRaOTncscuD1mtMsmJXq0uQusxoRNBXB/tvSZQPKR9+SXQ==",
|
||||
"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==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"brighterscript": "^0.69.9",
|
||||
"brighterscript": "^0.69.10",
|
||||
"glob-all": "^3.3.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"source-map": "^0.7.3",
|
||||
@@ -1402,9 +1427,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brighterscript-formatter/node_modules/brighterscript": {
|
||||
"version": "0.69.9",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.9.tgz",
|
||||
"integrity": "sha512-IZ3q29gVZ/9Z8ZqBVDVmT5mqhf8/gyF2WxzxV2oHT3SoZyKPe9JpbOvjDqUwd51HoYI55eJWiY3TTG94CPAxXA==",
|
||||
"version": "0.69.10",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.69.10.tgz",
|
||||
"integrity": "sha512-E8QCzN5bueG+SYJUdQ+1vw/frIV3WrpvoLgbNkAhYLOC6bSwoqmETwmgaiXpnY66Qe2zeAapXCbBcWVVIA7AQA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1434,7 +1459,7 @@
|
||||
"parse-ms": "^2.1.0",
|
||||
"readline": "^1.3.0",
|
||||
"require-relative": "^0.8.7",
|
||||
"roku-deploy": "^3.12.5",
|
||||
"roku-deploy": "^3.12.6",
|
||||
"safe-json-stringify": "^1.2.0",
|
||||
"serialize-error": "^7.0.1",
|
||||
"source-map": "^0.7.4",
|
||||
@@ -2772,7 +2797,8 @@
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ecc-jsbn": {
|
||||
"version": "0.1.2",
|
||||
@@ -2804,7 +2830,8 @@
|
||||
"version": "9.2.2",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
|
||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
@@ -3329,12 +3356,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
|
||||
"integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
|
||||
"integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.0",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"signal-exit": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3537,15 +3565,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "11.0.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz",
|
||||
"integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==",
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
||||
"integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"foreground-child": "^3.1.0",
|
||||
"jackspeak": "^4.0.1",
|
||||
"minimatch": "^10.0.0",
|
||||
"foreground-child": "^3.3.1",
|
||||
"jackspeak": "^4.1.1",
|
||||
"minimatch": "^10.0.3",
|
||||
"minipass": "^7.1.2",
|
||||
"package-json-from-dist": "^1.0.0",
|
||||
"path-scurry": "^2.0.0"
|
||||
@@ -3606,22 +3634,14 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/glob/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob/node_modules/minimatch": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
|
||||
"integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz",
|
||||
"integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
"@isaacs/brace-expansion": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
@@ -4149,10 +4169,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jackspeak": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz",
|
||||
"integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz",
|
||||
"integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/cliui": "^8.0.2"
|
||||
},
|
||||
@@ -6220,9 +6241,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/roku-deploy": {
|
||||
"version": "3.12.5",
|
||||
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.5.tgz",
|
||||
"integrity": "sha512-ulPePpNtS29ePMc15Qk/XrEW8uFfhfKrFvKtV4jiifOuyESCqvBbGvt1EOuIMAaq2rA+5q/lWL7LkVKgyQz0QA==",
|
||||
"version": "3.12.6",
|
||||
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.6.tgz",
|
||||
"integrity": "sha512-3qne2rwD0Yt4VMGUpiV75UHiarQYSgrQh5DtwpHjUVu0ozAzUw6psa46wA/jMbJgSNIDgKi4JsvdXkiAcE6P+g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -6957,6 +6978,7 @@
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
@@ -7115,6 +7137,7 @@
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
||||
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"eastasianwidth": "^0.2.0",
|
||||
"emoji-regex": "^9.2.2",
|
||||
@@ -7133,6 +7156,7 @@
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
@@ -7147,6 +7171,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@@ -7155,13 +7180,15 @@
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/string-width-cjs/node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
@@ -7174,6 +7201,7 @@
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^6.0.1"
|
||||
},
|
||||
@@ -7190,6 +7218,7 @@
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
@@ -7202,6 +7231,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@@ -7521,9 +7551,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -7762,6 +7792,7 @@
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
||||
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.1.0",
|
||||
"string-width": "^5.0.1",
|
||||
@@ -7780,6 +7811,7 @@
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
@@ -7797,6 +7829,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@@ -7806,6 +7839,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
@@ -7821,6 +7855,7 @@
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
@@ -7832,19 +7867,22 @@
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
@@ -7859,6 +7897,7 @@
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
@@ -7871,6 +7910,7 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
|
||||
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
|
||||
+8
-8
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.31",
|
||||
"@rokucommunity/bslint": "^0.8.32",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^22.15.29",
|
||||
"@types/node": "^24.0.1",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
"argparse": "^2.0.1",
|
||||
"brighterscript": "0.68.5",
|
||||
"brighterscript-formatter": "^1.7.14",
|
||||
"brighterscript-formatter": "^1.7.15",
|
||||
"cheerio": "1.0.0-rc.11",
|
||||
"convert-svg-to-png": "^0.6.4",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"fs-extra": "^11.3.0",
|
||||
"glob": "^11.0.2",
|
||||
"glob": "^11.0.3",
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.7.3",
|
||||
"protocol-buffers-schema": "^3.6.0",
|
||||
"roku-deploy": "^3.12.5",
|
||||
"roku-deploy": "^3.12.6",
|
||||
"roku-test-automation": "^2.0.13",
|
||||
"rooibos-roku": "5.15.7",
|
||||
"rounded-rect-9patch": "^1.1.2",
|
||||
@@ -34,7 +34,7 @@
|
||||
"yaml": "^2.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20"
|
||||
"node": "22"
|
||||
},
|
||||
"scripts": {
|
||||
"dev:web": "cd playlet-web && npm run dev",
|
||||
@@ -74,6 +74,6 @@
|
||||
"shutdown": "node tools/shutdown.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.41.1"
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.43.0"
|
||||
}
|
||||
}
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.40.0"
|
||||
"version": "0.40.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-app",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<field id="inputArgs" type="assocarray" alwaysNotify="true" />
|
||||
<field id="playletLibLoadedUrl" type="assocarray" />
|
||||
<field id="systemLogEvent" type="assocarray" alwaysNotify="true" />
|
||||
<field id="enableSystemLogType" type="string" />
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/source/Dialog.bs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/Manifest.bs" />
|
||||
|
||||
@@ -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=00000
|
||||
build_version=00004
|
||||
|
||||
ui_resolutions=hd
|
||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||
|
||||
@@ -51,11 +51,7 @@ function Main(args as object) as void
|
||||
|
||||
systemLog = CreateObject("roSystemLog")
|
||||
systemLog.SetMessagePort(port)
|
||||
' Although all types are enabled, they are filtered in Playlet Lib to avoid spamming the logs
|
||||
systemLog.EnableType("http.connect")
|
||||
systemLog.EnableType("http.error")
|
||||
systemLog.EnableType("http.complete")
|
||||
systemLog.EnableType("bandwidth.minute")
|
||||
scene.ObserveField("enableSystemLogType", port)
|
||||
|
||||
#if DEBUG
|
||||
' The following comment is to enable the SceneGraph inspector
|
||||
@@ -83,6 +79,9 @@ function Main(args as object) as void
|
||||
if field = "exitChannel" and data = true
|
||||
return
|
||||
end if
|
||||
if field = "enableSystemLogType"
|
||||
systemLog.EnableType(data)
|
||||
end if
|
||||
else if msgType = "roInputEvent"
|
||||
scene.inputArgs = msg.getInfo()
|
||||
end if
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.40.0"
|
||||
"version": "0.40.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-lib",
|
||||
|
||||
@@ -349,14 +349,17 @@ function GetSortingContextMenuOptionsForItem(video as object) as object
|
||||
end if
|
||||
|
||||
feedSource = feedSources[0]
|
||||
endpoint = feedSource.endpoint
|
||||
if not m.sortOptions.DoesExist(endpoint)
|
||||
return []
|
||||
sortOptions = feedSource.state.sortOptions
|
||||
if not IsArray(sortOptions)
|
||||
endpoint = feedSource.endpoint
|
||||
if not m.sortOptions.DoesExist(endpoint)
|
||||
return []
|
||||
end if
|
||||
|
||||
sortOptions = m.sortOptions[endpoint]
|
||||
end if
|
||||
|
||||
title = Tr(Locale.Dialogs.SortFeedBy).replace("%1", `"${feedSource.title}"`)
|
||||
sortOptions = m.sortOptions[endpoint]
|
||||
|
||||
return [ContextMenuUtils.CreateOption(title + "...", m.top, "ShowSortDialog", [title, sortOptions, feedContentNode])]
|
||||
end function
|
||||
|
||||
@@ -401,7 +404,7 @@ function FetchSubscriptionStatus() as void
|
||||
})
|
||||
end function
|
||||
|
||||
function OnFetchSubscriptionStatusResult(result as object) as void
|
||||
function OnFetchSubscriptionStatusResult(_output as object) as void
|
||||
m.fetchSubscriptionStatusTask = invalid
|
||||
end function
|
||||
|
||||
|
||||
@@ -44,19 +44,11 @@ function Update()
|
||||
end if
|
||||
|
||||
if hours > 12
|
||||
hours = hours - 12
|
||||
hours -= 12
|
||||
end if
|
||||
|
||||
hoursStr = hours.ToStr()
|
||||
minutesStr = minutes.ToStr()
|
||||
|
||||
if hours < 10
|
||||
hoursStr = "0" + hoursStr
|
||||
end if
|
||||
|
||||
if minutes < 10
|
||||
minutesStr = "0" + minutesStr
|
||||
end if
|
||||
hoursStr = hours.ToStr("%02d")
|
||||
minutesStr = minutes.ToStr("%02d")
|
||||
|
||||
m.top.text = hoursStr + ":" + minutesStr + " " + ampm
|
||||
end function
|
||||
|
||||
@@ -51,6 +51,6 @@ function RefreshAccessToken() as void
|
||||
}, OnProfileRefreshTokenTaskResult)
|
||||
end function
|
||||
|
||||
function OnProfileRefreshTokenTaskResult(output as object) as void
|
||||
function OnProfileRefreshTokenTaskResult(_output as object) as void
|
||||
m.refreshTokenTask = invalid
|
||||
end function
|
||||
@@ -12,6 +12,14 @@ function Init()
|
||||
|
||||
scene = m.top.getScene()
|
||||
MessagePortUtils.ObserveFieldScopedExSafe(scene, "systemLogEvent", port)
|
||||
if scene.hasField("enableSystemLogType")
|
||||
scene.enableSystemLogType = "http.error"
|
||||
#if DEBUG
|
||||
scene.enableSystemLogType = "http.connect"
|
||||
scene.enableSystemLogType = "http.complete"
|
||||
scene.enableSystemLogType = "bandwidth.minute"
|
||||
#end if
|
||||
end if
|
||||
|
||||
m.port = port
|
||||
|
||||
@@ -143,27 +151,10 @@ function FormatTime(dateTime as object) as string
|
||||
dateTime.Mark()
|
||||
dateTime.ToLocalTime()
|
||||
|
||||
hours = dateTime.GetHours().ToStr()
|
||||
if hours.Len() = 1
|
||||
hours = "0" + hours
|
||||
end if
|
||||
|
||||
minutes = dateTime.GetMinutes().ToStr()
|
||||
if minutes.Len() = 1
|
||||
minutes = "0" + minutes
|
||||
end if
|
||||
|
||||
seconds = dateTime.GetSeconds().ToStr()
|
||||
if seconds.Len() = 1
|
||||
seconds = "0" + seconds
|
||||
end if
|
||||
|
||||
milliseconds = dateTime.GetMilliseconds().ToStr()
|
||||
if milliseconds.Len() = 1
|
||||
milliseconds = "00" + milliseconds
|
||||
else if milliseconds.Len() = 2
|
||||
milliseconds = "0" + milliseconds
|
||||
end if
|
||||
hours = dateTime.GetHours().ToStr("%02d")
|
||||
minutes = dateTime.GetMinutes().ToStr("%02d")
|
||||
seconds = dateTime.GetSeconds().ToStr("%02d")
|
||||
milliseconds = dateTime.GetMilliseconds().ToStr("%03d")
|
||||
|
||||
return "[" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + "]"
|
||||
end function
|
||||
@@ -33,14 +33,21 @@ function SetScenePalette(scene as object) as void
|
||||
scene.palette = palette
|
||||
end function
|
||||
|
||||
const HAS_ANNOUNCEMENT = false
|
||||
|
||||
function MainSceneContainerChanged()
|
||||
AutoBindSceneGraph()
|
||||
StartWebServer()
|
||||
HideLoadingScreen()
|
||||
InitEcpArgs()
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
if HAS_ANNOUNCEMENT
|
||||
if not ShowAnnouncement()
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end if
|
||||
else
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end if
|
||||
CopyLoadingMessagesToCache()
|
||||
ShowAnnouncement()
|
||||
end function
|
||||
|
||||
function StartWebServer()
|
||||
@@ -54,7 +61,7 @@ function StartWebServer()
|
||||
m.dialServer@.StartServer()
|
||||
end function
|
||||
|
||||
function ShowAnnouncement() as void
|
||||
function ShowAnnouncement() as boolean
|
||||
dialog = DialogUtils.ShowDialogOnce({
|
||||
messageId: "1747362859"
|
||||
title: "Announcement - YouTube account support"
|
||||
@@ -70,13 +77,15 @@ function ShowAnnouncement() as void
|
||||
})
|
||||
|
||||
if dialog = invalid
|
||||
return
|
||||
return false
|
||||
end if
|
||||
|
||||
m.scene.signalBeacon("AppDialogInitiate")
|
||||
m.top.observeField("wasClosed", FuncName(OnAnnouncementDialogClosed))
|
||||
dialog.observeField("wasClosed", FuncName(OnAnnouncementDialogClosed))
|
||||
return true
|
||||
end function
|
||||
|
||||
function OnAnnouncementDialogClosed()
|
||||
m.scene.signalBeacon("AppDialogComplete")
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end function
|
||||
@@ -32,14 +32,20 @@ function SetScenePalette(scene as object) as void
|
||||
scene.palette = palette
|
||||
end function
|
||||
|
||||
|
||||
function MainSceneContainerChanged()
|
||||
AutoBindSceneGraph()
|
||||
StartWebServer()
|
||||
HideLoadingScreen()
|
||||
InitEcpArgs()
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
if false
|
||||
if not ShowAnnouncement()
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end if
|
||||
else
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end if
|
||||
CopyLoadingMessagesToCache()
|
||||
ShowAnnouncement()
|
||||
end function
|
||||
|
||||
function StartWebServer()
|
||||
@@ -51,7 +57,7 @@ function StartWebServer()
|
||||
m.dialServer.callfunc("StartServer", invalid)
|
||||
end function
|
||||
|
||||
function ShowAnnouncement() as void
|
||||
function ShowAnnouncement() as boolean
|
||||
dialog = DialogUtils_ShowDialogOnce({
|
||||
messageId: "1747362859"
|
||||
title: "Announcement - YouTube account support"
|
||||
@@ -66,13 +72,15 @@ function ShowAnnouncement() as void
|
||||
marginWidth: 180
|
||||
})
|
||||
if dialog = invalid
|
||||
return
|
||||
return false
|
||||
end if
|
||||
m.scene.signalBeacon("AppDialogInitiate")
|
||||
m.top.observeField("wasClosed", FuncName(OnAnnouncementDialogClosed))
|
||||
dialog.observeField("wasClosed", FuncName(OnAnnouncementDialogClosed))
|
||||
return true
|
||||
end function
|
||||
|
||||
function OnAnnouncementDialogClosed()
|
||||
m.scene.signalBeacon("AppDialogComplete")
|
||||
m.scene.signalBeacon("AppLaunchComplete")
|
||||
end function
|
||||
'//# sourceMappingURL=./MainScene.brs.map
|
||||
+1
-1
@@ -70,7 +70,7 @@ function OnAccountsChanged() as void
|
||||
m.accountList.content = content
|
||||
end function
|
||||
|
||||
function OnAccountSelected(event as object) as void
|
||||
function OnAccountSelected() as void
|
||||
itemSelected = m.accountList.itemSelected
|
||||
itemNode = m.accountList.content.GetChild(itemSelected)
|
||||
if itemNode = invalid
|
||||
|
||||
+2
-2
@@ -77,8 +77,8 @@ function ShowTestDetails() as void
|
||||
|
||||
state = itemContent.state
|
||||
displayStates = {
|
||||
"passed": Locale.InvidiousTesting.Passed
|
||||
"failed": Locale.InvidiousTesting.Failed
|
||||
"passed": Tr(Locale.InvidiousTesting.Passed)
|
||||
"failed": Tr(Locale.InvidiousTesting.Failed)
|
||||
}
|
||||
|
||||
message = Tr(Locale.InvidiousTesting.Status) + ": " + Tr(ValidString(displayStates[state])) + `\n`
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
const VIDEO_PLAYER_USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
|
||||
|
||||
const INNERTUBE_IOS_CLIENT_NAME = "5"
|
||||
const INNERTUBE_IOS_CLIENT_VERSION = "20.20.5"
|
||||
const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2"
|
||||
@@ -10,12 +12,12 @@ const INNERTUBE_WEB_CLIENT_NAME = "1"
|
||||
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250520.05.00"
|
||||
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0"
|
||||
|
||||
const INNERTUBE_TV_BROWSER_NAME = "LG Browser"
|
||||
const INNERTUBE_TV_BROWSER_VERSION = "7.00.00"
|
||||
const INNERTUBE_TV_BROWSER_NAME = "SamsungBrowser"
|
||||
const INNERTUBE_TV_BROWSER_VERSION = "9.2"
|
||||
const INNERTUBE_TV_CLIENT_NAME = "2"
|
||||
const INNERTUBE_TV_CLIENT_VERSION = "7.20250519.12.01"
|
||||
const INNERTUBE_TV_DEVICE_MAKE = "LGE"
|
||||
const INNERTUBE_TV_DEVICE_MODEL = "24LF4820-BU"
|
||||
const INNERTUBE_TV_OS_NAME = "webOS"
|
||||
const INNERTUBE_TV_OS_VERSION = "2015"
|
||||
const INNERTUBE_TV_USER_AGENT = "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen Safari/538.2 LG Browser/7.00.00(LGE; 24LF4820-BU; 03.20.14; 1; DTV_W15L); webOS.TV-2015; LG NetCast.TV-2013 Compatible (LGE, 24LF4820-BU, wireless)"
|
||||
const INNERTUBE_TV_DEVICE_MAKE = "Samsung"
|
||||
const INNERTUBE_TV_DEVICE_MODEL = "SmartTV"
|
||||
const INNERTUBE_TV_OS_NAME = "Tizen"
|
||||
const INNERTUBE_TV_OS_VERSION = "4.0.0.2"
|
||||
const INNERTUBE_TV_USER_AGENT = "Mozilla/5.0(SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15"
|
||||
@@ -1,5 +1,7 @@
|
||||
<component name="Innertube" extends="Node">
|
||||
<interface>
|
||||
<field id="timestamp" type="int" />
|
||||
<field id="visitorData" type="string" />
|
||||
<field id="poToken" type="string" />
|
||||
</interface>
|
||||
</component>
|
||||
@@ -9,7 +9,17 @@ function InnertubeInitTask(input as object) as object
|
||||
return invalid
|
||||
end if
|
||||
|
||||
innertubeNode.visitorData = sessionData.visitorData
|
||||
if IsInt(sessionData.timestamp)
|
||||
innertubeNode.timestamp = sessionData.timestamp
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(sessionData.visitorData)
|
||||
innertubeNode.visitorData = sessionData.visitorData
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(sessionData.poToken)
|
||||
innertubeNode.poToken = sessionData.poToken
|
||||
end if
|
||||
|
||||
return invalid
|
||||
end function
|
||||
@@ -25,7 +25,6 @@ namespace InnertubeService
|
||||
playerRequest.Cancellation(cancellation)
|
||||
if raw
|
||||
playerRequest.LogCurlCommand()
|
||||
playerRequest.NoCache()
|
||||
end if
|
||||
playerRequest.Send()
|
||||
|
||||
@@ -36,7 +35,6 @@ namespace InnertubeService
|
||||
nextRequest.Cancellation(cancellation)
|
||||
if raw
|
||||
nextRequest.LogCurlCommand()
|
||||
nextRequest.NoCache()
|
||||
end if
|
||||
nextRequest.Send()
|
||||
end if
|
||||
|
||||
@@ -81,8 +81,10 @@ namespace Innertube
|
||||
"gridRenderer": ParseGridRenderer
|
||||
"richGridRenderer": ParseRichGridRenderer
|
||||
"richItemRenderer": ParseRichItemRenderer
|
||||
"feedFilterChipBarRenderer": ParseFeedFilterChipBarRenderer
|
||||
"continuationItemRenderer": ParseContinuationItemRenderer
|
||||
"appendContinuationItemsAction": ParseAppendContinuationItemsAction
|
||||
"reloadContinuationItemsCommand": ParseReloadContinuationItemsCommand
|
||||
"gridContinuation": ParseGridContinuation
|
||||
"tvSurfaceContentContinuation": ParseTvSurfaceContentContinuation
|
||||
' Ignored nodes:
|
||||
@@ -144,7 +146,26 @@ namespace Innertube
|
||||
return nodeData["content"]
|
||||
end function
|
||||
|
||||
function ParseSectionListRenderer(nodeData as object, _context as object) as object
|
||||
function ParseSectionListRenderer(nodeData as object, context as object) as object
|
||||
sortSubMenuItems = ObjectUtils.Dig(nodeData, ["subMenu", "channelSubMenuRenderer", "sortSetting", "sortFilterSubMenuRenderer", "subMenuItems"])
|
||||
if IsArray(sortSubMenuItems)
|
||||
sortOptions = []
|
||||
for each item in sortSubMenuItems
|
||||
params = ValidString(ObjectUtils.Dig(item, ["navigationEndpoint", "browseEndpoint", "params"]))
|
||||
title = ParseText(item["title"])
|
||||
isSelected = ValidBool(item["selected"])
|
||||
if params <> "" and title <> ""
|
||||
sortOptions.Push({
|
||||
"title": title
|
||||
"params": params
|
||||
"isSelected": isSelected
|
||||
})
|
||||
end if
|
||||
end for
|
||||
if sortOptions.Count() > 0
|
||||
context.currentFeed.sortOptions = sortOptions
|
||||
end if
|
||||
end if
|
||||
return nodeData["contents"]
|
||||
end function
|
||||
|
||||
@@ -956,7 +977,7 @@ namespace Innertube
|
||||
return nodeData["tabs"]
|
||||
end function
|
||||
|
||||
function ParseTwoColumnRenderer(nodeData as object, context as object) as object
|
||||
function ParseTwoColumnRenderer(nodeData as object, _context as object) as object
|
||||
' twoColumnRenderer is used for Playlists on TV.
|
||||
' The right column has the videos (and continuation)
|
||||
' The left column has the playlist info (title, description, etc) which was already parsed
|
||||
@@ -1064,6 +1085,11 @@ namespace Innertube
|
||||
"percentDurationWatched": percentDurationWatched
|
||||
}
|
||||
|
||||
authorId = ParseTileRendererAuthorId(nodeData)
|
||||
if authorId <> invalid
|
||||
video["authorId"] = authorId
|
||||
end if
|
||||
|
||||
PushFeedItem(video, context)
|
||||
return invalid
|
||||
end function
|
||||
@@ -1107,6 +1133,11 @@ namespace Innertube
|
||||
"videoThumbnails": videoThumbnails
|
||||
}
|
||||
|
||||
authorId = ParseTileRendererAuthorId(nodeData)
|
||||
if authorId <> invalid
|
||||
video["authorId"] = authorId
|
||||
end if
|
||||
|
||||
PushFeedItem(video, context)
|
||||
return invalid
|
||||
end function
|
||||
@@ -1149,10 +1180,37 @@ namespace Innertube
|
||||
"lines": renderedLines
|
||||
}
|
||||
|
||||
authorId = ParseTileRendererAuthorId(nodeData)
|
||||
if authorId <> invalid
|
||||
playlist["authorId"] = authorId
|
||||
end if
|
||||
|
||||
PushFeedItem(playlist, context)
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function ParseTileRendererAuthorId(nodeData as object) as dynamic
|
||||
' We're checking in the long press menu if there's a browseId that starts with "UC".
|
||||
' This is usually the the id of the channel.
|
||||
menuItems = ObjectUtils.Dig(nodeData, ["onLongPressCommand", "showMenuCommand", "menu", "menuRenderer", "items"])
|
||||
if not IsArray(menuItems)
|
||||
return invalid
|
||||
end if
|
||||
|
||||
for each item in menuItems
|
||||
if not IsAssociativeArray(item) or not item.DoesExist("menuNavigationItemRenderer")
|
||||
continue for
|
||||
end if
|
||||
menuNavigationItemRenderer = item["menuNavigationItemRenderer"]
|
||||
browseId = ObjectUtils.Dig(menuNavigationItemRenderer, ["navigationEndpoint", "browseEndpoint", "browseId"])
|
||||
if not IsString(browseId) or not browseId.StartsWith("UC")
|
||||
continue for
|
||||
end if
|
||||
return browseId
|
||||
end for
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function ParseGridRenderer(nodeData as object, context as object) as object
|
||||
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
|
||||
if IsString(continuation)
|
||||
@@ -1161,7 +1219,11 @@ namespace Innertube
|
||||
return nodeData["items"]
|
||||
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"])
|
||||
if feedFilterChipBarRenderer <> invalid
|
||||
ParseFeedFilterChipBarRenderer(feedFilterChipBarRenderer, context)
|
||||
end if
|
||||
return nodeData["contents"]
|
||||
end function
|
||||
|
||||
@@ -1169,6 +1231,47 @@ namespace Innertube
|
||||
return nodeData["content"]
|
||||
end function
|
||||
|
||||
function ParseFeedFilterChipBarRenderer(nodeData as object, context as object) as object
|
||||
contents = ObjectUtils.Dig(nodeData, ["contents"])
|
||||
if not IsArray(contents)
|
||||
return invalid
|
||||
end if
|
||||
|
||||
sortOptions = []
|
||||
for each item in contents
|
||||
if not IsAssociativeArray(item) or not item.DoesExist("chipCloudChipRenderer")
|
||||
continue for
|
||||
end if
|
||||
chipCloudChipRenderer = item["chipCloudChipRenderer"]
|
||||
if not IsAssociativeArray(chipCloudChipRenderer)
|
||||
continue for
|
||||
end if
|
||||
continuationCommand = ObjectUtils.Dig(chipCloudChipRenderer, ["navigationEndpoint", "continuationCommand"])
|
||||
if not IsAssociativeArray(continuationCommand) or ValidString(continuationCommand["request"]) <> "CONTINUATION_REQUEST_TYPE_BROWSE"
|
||||
continue for
|
||||
end if
|
||||
|
||||
title = ParseText(chipCloudChipRenderer["text"])
|
||||
token = ValidString(continuationCommand["token"])
|
||||
isSelected = ValidBool(chipCloudChipRenderer["isSelected"])
|
||||
if title = "" or 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 ParseContinuationItemRenderer(nodeData as object, context as object) as object
|
||||
continuation = ObjectUtils.Dig(nodeData, ["continuationEndpoint", "continuationCommand", "token"])
|
||||
if IsString(continuation)
|
||||
@@ -1185,6 +1288,10 @@ namespace Innertube
|
||||
return nodeData["continuationItems"]
|
||||
end function
|
||||
|
||||
function ParseReloadContinuationItemsCommand(nodeData as object, _context as object) as object
|
||||
return nodeData["continuationItems"]
|
||||
end function
|
||||
|
||||
function ParseGridContinuation(nodeData as object, context as object) as object
|
||||
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
|
||||
if IsString(continuation)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Innertube
|
||||
function GetClientIdentity(cancellation = invalid as dynamic) as object
|
||||
request = HttpClient.Get("https://www.youtube.com/tv")
|
||||
request.Headers({
|
||||
"User-Agent": "Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version"
|
||||
"User-Agent": INNERTUBE_TV_USER_AGENT
|
||||
"Referer": "https://www.youtube.com/tv"
|
||||
"Accept-Language": "en-US"
|
||||
})
|
||||
|
||||
@@ -141,12 +141,16 @@ namespace Innertube
|
||||
|
||||
items = []
|
||||
continuation = invalid
|
||||
sortOptions = invalid
|
||||
feeds = ParseResponseDataForFeeds(responseData, { "currentAuthor": author, "currentAuthorId": authorId })
|
||||
if feeds.Count() > 0
|
||||
items = ValidArray(feeds[0].items)
|
||||
if feeds[0].DoesExist("continuation")
|
||||
continuation = feeds[0].continuation
|
||||
end if
|
||||
if feeds[0].DoesExist("sortOptions")
|
||||
sortOptions = feeds[0].sortOptions
|
||||
end if
|
||||
end if
|
||||
|
||||
channel = {
|
||||
@@ -161,9 +165,13 @@ namespace Innertube
|
||||
"items": items
|
||||
}
|
||||
|
||||
' continuation and sort options are specific to certain tabs of the channel
|
||||
if continuation <> invalid
|
||||
channel["continuation"] = continuation
|
||||
end if
|
||||
if sortOptions <> invalid
|
||||
channel["sortOptions"] = sortOptions
|
||||
end if
|
||||
|
||||
return channel
|
||||
end function
|
||||
|
||||
@@ -99,26 +99,35 @@ namespace Innertube
|
||||
return "Invalid playability status"
|
||||
end if
|
||||
|
||||
if playabilityStatus["status"] = "OK"
|
||||
status = ValidString(playabilityStatus["status"])
|
||||
if status = "OK"
|
||||
return ""
|
||||
end if
|
||||
|
||||
errorMessage = ""
|
||||
if IsString(playabilityStatus["reason"])
|
||||
errorMessage = playabilityStatus["reason"]
|
||||
errorLines = []
|
||||
if not StringUtils.IsNullOrEmpty(playabilityStatus["reason"])
|
||||
errorLines.Push(playabilityStatus["reason"])
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(playabilityStatus["reasonTitle"])
|
||||
errorLines.Push(playabilityStatus["reasonTitle"])
|
||||
end if
|
||||
|
||||
subreason = ParseText(ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorMessageRenderer", "subreason"]))
|
||||
|
||||
if subreason <> ""
|
||||
errorMessage += `\n` + subreason
|
||||
errorLines.Push(subreason)
|
||||
end if
|
||||
|
||||
if errorMessage = ""
|
||||
errorMessage = "Video not available"
|
||||
if errorLines.Count() = 0
|
||||
errorLines.Push("Video not available (Unknown)")
|
||||
end if
|
||||
|
||||
return errorMessage
|
||||
if status = "LOGIN_REQUIRED"
|
||||
' TODO:P2 localize
|
||||
errorLines.Push("Hint: Log in to the YouTube app on your phone, then cast the video to Playlet.")
|
||||
end if
|
||||
|
||||
return errorLines.Join(`\n`)
|
||||
end function
|
||||
|
||||
function ParseStoryboards(payload as object, lengthSeconds as integer) as object
|
||||
|
||||
@@ -9,7 +9,7 @@ import "pkg:/source/utils/TimeUtils.bs"
|
||||
namespace Innertube
|
||||
|
||||
const SESSION_DATA_VERSION = 1
|
||||
const INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS = 60 * 60 * 24
|
||||
const INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS = 60 * 60 * 24 * 7 ' 7 days
|
||||
|
||||
function GetSessionData() as object
|
||||
sessionData = ReadSessionDataFromRegistry()
|
||||
@@ -18,11 +18,7 @@ namespace Innertube
|
||||
end if
|
||||
|
||||
sessionData = RequestSessionData()
|
||||
if sessionData = invalid
|
||||
return invalid
|
||||
end if
|
||||
|
||||
RegistryUtils.Write(RegistryUtils.INNERTUBE_SESSION_DATA, FormatJson(sessionData))
|
||||
SaveSessionDataToRegistry(sessionData)
|
||||
return sessionData
|
||||
end function
|
||||
|
||||
@@ -61,12 +57,21 @@ namespace Innertube
|
||||
end if
|
||||
|
||||
return {
|
||||
"__version": SESSION_DATA_VERSION
|
||||
"timestamp": TimeUtils.Now().AsSeconds()
|
||||
"visitorData": visitorData
|
||||
}
|
||||
end function
|
||||
|
||||
function SaveSessionDataToRegistry(sessionData as object) as void
|
||||
if sessionData = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
sessionData.__version = SESSION_DATA_VERSION
|
||||
|
||||
RegistryUtils.Write(RegistryUtils.INNERTUBE_SESSION_DATA, FormatJson(sessionData))
|
||||
end function
|
||||
|
||||
function ReadSessionDataFromRegistry() as object
|
||||
sessionData = RegistryUtils.Read(RegistryUtils.INNERTUBE_SESSION_DATA)
|
||||
if StringUtils.IsNullOrEmpty(sessionData)
|
||||
|
||||
@@ -487,6 +487,7 @@ namespace Invidious
|
||||
return {
|
||||
items: json.videos
|
||||
continuation: json.continuation
|
||||
sortOptions: json.sortOptions
|
||||
}
|
||||
end if
|
||||
return invalid
|
||||
@@ -510,6 +511,7 @@ namespace Invidious
|
||||
return {
|
||||
items: json.playlists
|
||||
continuation: json.continuation
|
||||
sortOptions: json.sortOptions
|
||||
}
|
||||
end if
|
||||
return invalid
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ namespace SponsorBlock
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function ShowNotifcation(notifications as object, segment as object, action as dynamic) as void
|
||||
function ShowNotifcation(notifications as object, segment as object) as void
|
||||
' TODO:P2 avoid finding the node over and over
|
||||
' The video player can probably own a single notification, and destroy it when the video is closed
|
||||
notification = GetCurrentNotification(notifications)
|
||||
|
||||
@@ -105,8 +105,12 @@ function ShouldShowNotification(segment as object, categories as object) as bool
|
||||
return option = SponsorBlock.SegmentAction.AutoSkip or option = SponsorBlock.SegmentAction.ManualSkip
|
||||
end function
|
||||
|
||||
function PadHightlightSegment(segments as object, lengthSeconds as integer) as object
|
||||
for each segment in segments
|
||||
function PadHightlightSegment(skipSegments as object, lengthSeconds as integer) as object
|
||||
if skipSegments = invalid
|
||||
return invalid
|
||||
end if
|
||||
|
||||
for each segment in skipSegments
|
||||
if not segment.category = "poi_highlight"
|
||||
continue for
|
||||
end if
|
||||
@@ -131,5 +135,5 @@ function PadHightlightSegment(segments as object, lengthSeconds as integer) as o
|
||||
segment.end = segment.end + padding
|
||||
end for
|
||||
|
||||
return segments
|
||||
return skipSegments
|
||||
end function
|
||||
@@ -92,11 +92,13 @@ function VideoRowListRowContentTask(input as object) as object
|
||||
feedSources[feedSourcesIndex] = feedSource
|
||||
feedContentNode.feedSources = feedSources
|
||||
|
||||
if feedContentNode.title.instr(" (Failed to load)") = -1
|
||||
feedContentNode.title += " (Failed to load)"
|
||||
isCancelled = response.cancelled = true
|
||||
if not isCancelled
|
||||
if feedContentNode.title.instr(" (Failed to load)") = -1
|
||||
feedContentNode.title += " (Failed to load)"
|
||||
end if
|
||||
end if
|
||||
|
||||
isCancelled = response.cancelled = true
|
||||
HandleFeedLoadErrorDialog(response.error, isCancelled, rowList)
|
||||
continue while
|
||||
end if
|
||||
@@ -127,6 +129,10 @@ function VideoRowListRowContentTask(input as object) as object
|
||||
hasContinuation = not StringUtils.IsNullOrEmpty(response.result.continuation)
|
||||
feedSource.state.continuation = ValidString(response.result.continuation)
|
||||
|
||||
if response.result.sortOptions <> invalid
|
||||
feedSource.state.sortOptions = response.result.sortOptions
|
||||
end if
|
||||
|
||||
if addedItemCount > 0
|
||||
pageType = feedSource.state.paginationType
|
||||
if response.result.isLastPage = true or (hadContinuation and not hasContinuation)
|
||||
|
||||
@@ -127,9 +127,9 @@ namespace SponsorBlock
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function OnPositionChangeSkipSponsorBlockSections() as void
|
||||
function OnPositionChangeSkipSponsorBlockSections(event as object) as void
|
||||
segments = m.skipSegments
|
||||
position = m.top.position
|
||||
position = event.getData()
|
||||
|
||||
segment = FindSegmentByTime(segments, position)
|
||||
if segment = invalid
|
||||
@@ -142,7 +142,7 @@ namespace SponsorBlock
|
||||
' a notification, since it is possible this is where we skipped to.
|
||||
' Seeking is not super accurate.
|
||||
if segment.showNotification and Abs(segment.end - position) >= 1
|
||||
SponsorBlock.ShowNotifcation(m.notifications, segment, action)
|
||||
SponsorBlock.ShowNotifcation(m.notifications, segment)
|
||||
|
||||
if action = SegmentAction.ManualSkip
|
||||
' We'll save the segment here, and handle it in case the user
|
||||
|
||||
@@ -19,16 +19,19 @@ function VideoContentTask(input as object) as object
|
||||
end if
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
|
||||
backend = preferencesNode["backend.selected"]
|
||||
if backend = "playlet"
|
||||
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
||||
"cancellation": m.top.cancellation
|
||||
"credentialTransferToken": loungeServiceNode.credentialTransferToken
|
||||
"visitorData": innertubeNode.visitorData
|
||||
})
|
||||
else
|
||||
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||
|
||||
metadata = contentNode.metadata
|
||||
if not IsAssociativeArray(metadata)
|
||||
if backend = "playlet"
|
||||
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
||||
"cancellation": m.top.cancellation
|
||||
"credentialTransferToken": loungeServiceNode.credentialTransferToken
|
||||
"visitorData": innertubeNode.visitorData
|
||||
})
|
||||
else
|
||||
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||
end if
|
||||
end if
|
||||
|
||||
if metadata = invalid
|
||||
@@ -140,7 +143,11 @@ end function
|
||||
function AddDashUrls(streamUrls as object, metadata as object, preferredQuality as string, backend as string, proxyVideos as string, playletServerPort as integer) as void
|
||||
' Redirect to Playet's local web server, where will will be
|
||||
' dynamically generating the DASH manifest, and filter quality
|
||||
dashUrl = UrlUtils.AppendQueryParams(`http://127.0.0.1:${playletServerPort}/api/dash`, { v: metadata.videoId })
|
||||
dashUrl = UrlUtils.AppendQueryParams(`http://127.0.0.1:${playletServerPort}/api/dash`, {
|
||||
v: metadata.videoId
|
||||
ytjs: ValidBool(metadata.ytjs)
|
||||
})
|
||||
|
||||
dashUrlLocal = invalid
|
||||
dashUrlFiltered = invalid
|
||||
dashUrlFilteredLocal = invalid
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#const DEBUG_LOG_VIDEO_QUALITY = false
|
||||
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||
import "pkg:/components/VideoPlayer/Lounge.bs"
|
||||
import "pkg:/components/VideoPlayer/SponsorBlock.bs"
|
||||
@@ -52,7 +53,7 @@ function Init()
|
||||
end if
|
||||
|
||||
httpAgent = m.top.getHttpAgent()
|
||||
httpAgent.AddHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0")
|
||||
httpAgent.AddHeader("User-Agent", VIDEO_PLAYER_USER_AGENT)
|
||||
|
||||
#if DEBUG_LOG_VIDEO_QUALITY
|
||||
m.top.addFields({
|
||||
@@ -137,6 +138,10 @@ function PlayWithContent(contentNode as object)
|
||||
if not StringUtils.IsNullOrEmpty(contentNode._author)
|
||||
videoContentNode.secondaryTitle = contentNode._author
|
||||
end if
|
||||
metadata = contentNode.metadata
|
||||
if IsAssociativeArray(metadata)
|
||||
videoContentNode.AddFields({ metadata: metadata })
|
||||
end if
|
||||
|
||||
StartVideoContentTask(videoContentNode)
|
||||
Lounge.SendNowPlayingLoading(contentNode.videoId)
|
||||
@@ -194,28 +199,70 @@ function OnVideoContentTaskResults(output as object) as void
|
||||
content = m.top.content
|
||||
SponsorBlock.FetchSponsorBlock(content.metadata)
|
||||
|
||||
timestamp = content.timestamp
|
||||
percentDurationWatched = content.percentDurationWatched
|
||||
hasTimestamp = IsInt(timestamp)
|
||||
hasPercentDurationWatched = IsFloat(percentDurationWatched)
|
||||
|
||||
if IsLiveVideo() and not hasTimestamp and not hasPercentDurationWatched
|
||||
' If live, seek to end of stream
|
||||
m.seekToPercent = 100.0
|
||||
SeekToPercentOfDuration()
|
||||
else
|
||||
if hasTimestamp and timestamp > 0
|
||||
m.top.seek = content.timestamp
|
||||
else if hasPercentDurationWatched
|
||||
m.seekToPercent = percentDurationWatched
|
||||
SeekToPercentOfDuration()
|
||||
end if
|
||||
end if
|
||||
SeekToInitialPosition(content)
|
||||
|
||||
PlayAfterPreviousPlayerHasStopped()
|
||||
MarkVideoWatched(content.videoId)
|
||||
end function
|
||||
|
||||
function SeekToInitialPosition(content as object) as void
|
||||
if content = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
' For trickplay of live streams, apps should seek to a position of
|
||||
' 999,999 seconds (for both DASH and HLS streams). The Roku media
|
||||
' player clips that position to the current availability window and
|
||||
' provides a robust buffer.
|
||||
' https://developer.roku.com/en-ca/docs/specs/media/streaming-specifications.md
|
||||
if content.Live = true
|
||||
LogInfo("Seeking to enge of live stream")
|
||||
m.top.seek = 999999
|
||||
return
|
||||
end if
|
||||
|
||||
timestamp = ValidInt(content.timestamp)
|
||||
if timestamp > 0
|
||||
LogInfo("Seeking to timestamp:", timestamp)
|
||||
m.top.seek = content.timestamp
|
||||
return
|
||||
end if
|
||||
|
||||
percentDurationWatched = ValidFloat(content.percentDurationWatched)
|
||||
if percentDurationWatched > 0
|
||||
m.seekToPercent = percentDurationWatched
|
||||
SeekToPercentOfDuration()
|
||||
end if
|
||||
end function
|
||||
|
||||
function SeekToPercentOfDuration() as void
|
||||
m.top.UnobserveField("duration")
|
||||
|
||||
seekToPercent = m.seekToPercent
|
||||
if seekToPercent = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
duration = m.top.duration
|
||||
if duration = 0
|
||||
' If the duration is not available, wait for it to be set
|
||||
m.top.ObserveField("duration", FuncName(SeekToPercentOfDuration))
|
||||
return
|
||||
end if
|
||||
|
||||
' If the stream is less than 30 seconds, it's not worth seeking
|
||||
if duration < 30
|
||||
return
|
||||
end if
|
||||
|
||||
m.seekToPercent = invalid
|
||||
seek = (MathUtils.Clamp(seekToPercent, 0, 100) / 100.0) * duration
|
||||
if seek > 0
|
||||
LogInfo("Seeking to percent duration watched", seek)
|
||||
m.top.seek = seek
|
||||
end if
|
||||
end function
|
||||
|
||||
function PlayAfterPreviousPlayerHasStopped() as void
|
||||
previousPlayer = m.top.previousPlayer
|
||||
m.top.previousPlayer = invalid
|
||||
@@ -306,12 +353,12 @@ function MarkVideoWatched(videoId as dynamic) as void
|
||||
m.top.ObserveFieldScoped("position", FuncName(OnPositionChangeMarkWatchTime))
|
||||
end function
|
||||
|
||||
function OnPositionChangeMarkWatchTime() as void
|
||||
function OnPositionChangeMarkWatchTime(event as object) as void
|
||||
if m.markVideoWatchedTask = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
currentPosition = m.top.position
|
||||
currentPosition = event.getData()
|
||||
currentWatchTimeMarker = m.watchTimeMarker
|
||||
m.watchTimeMarker = (currentPosition \ 20) * 20
|
||||
if currentWatchTimeMarker = currentPosition
|
||||
@@ -393,10 +440,10 @@ function OnVideoPlayerStateChange() as void
|
||||
nextUrl = playletStreamUrls[playletStreamUrlIndex]
|
||||
LogError(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`)
|
||||
|
||||
' TODO:P2 handle SeekToEndOfStream for live videos on error
|
||||
m.top.UnobserveField("duration")
|
||||
|
||||
content.url = nextUrl
|
||||
|
||||
SeekToInitialPosition(content)
|
||||
|
||||
' This video errored, and is about to finish, so don't close the video yet
|
||||
' That's why we should ignore the next "finished" event
|
||||
m.ignoreNextFinishedState = true
|
||||
@@ -452,46 +499,6 @@ function OnVideoPlayerStateChange() as void
|
||||
end if
|
||||
end function
|
||||
|
||||
function SeekToEndOfStream() as void
|
||||
m.top.UnobserveField("duration")
|
||||
duration = m.top.duration
|
||||
' If the stream is less than 30 seconds, it's not worth seeking
|
||||
if duration < 30
|
||||
return
|
||||
end if
|
||||
|
||||
LogInfo("Seeking to end of live stream", duration)
|
||||
m.top.seek = duration
|
||||
end function
|
||||
|
||||
function SeekToPercentOfDuration() as void
|
||||
m.top.UnobserveField("duration")
|
||||
|
||||
seekToPercent = m.seekToPercent
|
||||
if seekToPercent = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
duration = m.top.duration
|
||||
if duration = 0
|
||||
' If the duration is not available, wait for it to be set
|
||||
m.top.ObserveField("duration", FuncName(SeekToPercentOfDuration))
|
||||
return
|
||||
end if
|
||||
|
||||
' If the stream is less than 30 seconds, it's not worth seeking
|
||||
if duration < 30
|
||||
return
|
||||
end if
|
||||
|
||||
m.seekToPercent = invalid
|
||||
seek = (MathUtils.Clamp(seekToPercent, 0, 100) / 100.0) * duration
|
||||
if seek > 0
|
||||
LogInfo("Seeking to percent duration watched", seek)
|
||||
m.top.seek = seek
|
||||
end if
|
||||
end function
|
||||
|
||||
function OnVideoFinished() as void
|
||||
if not VideoQueueUtils.PlayNext(m.videoQueue, m.invidious, m.preferences)
|
||||
m.videoQueue.closePlayer = true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||
import "pkg:/components/VideoPlayerDev/PictureInPicture.bs"
|
||||
import "pkg:/components/VideoPlayerDev/PlayerUi.bs"
|
||||
import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
|
||||
@@ -15,9 +16,8 @@ import "pkg:/source/utils/Types.bs"
|
||||
function Init()
|
||||
InitializePlayerUi()
|
||||
|
||||
|
||||
httpAgent = m.top.getHttpAgent()
|
||||
httpAgent.AddHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0")
|
||||
httpAgent.AddHeader("User-Agent", VIDEO_PLAYER_USER_AGENT)
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace Http
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.invidiousNode = server.task.invidious
|
||||
task = server.task
|
||||
m.videoQueueNode = task.videoQueue
|
||||
m.invidiousNode = task.invidious
|
||||
m.invidiousService = new Invidious.InvidiousService(m.invidiousNode)
|
||||
' No need to pass the invidious instance here, we will refresh it for
|
||||
' each request to make sure we are using the latest one
|
||||
@@ -25,16 +27,39 @@ namespace Http
|
||||
v = request.query.v
|
||||
local = request.query.local
|
||||
quality = request.query.quality
|
||||
ytjs = request.query.ytjs
|
||||
|
||||
if StringUtils.IsNullOrEmpty(v)
|
||||
response.Default(400, "Missing video id")
|
||||
return true
|
||||
end if
|
||||
|
||||
metadata = m.invidiousService.GetVideoMetadata(v)
|
||||
if metadata.error <> invalid
|
||||
response.Default(500, metadata.error)
|
||||
return true
|
||||
if ValidString(ytjs) = "true"
|
||||
player = m.videoQueueNode.player
|
||||
if player = invalid
|
||||
response.Default(500, "videoQueue.player is invalid")
|
||||
return true
|
||||
end if
|
||||
content = player.content
|
||||
if content = invalid
|
||||
response.Default(500, "videoQueue.player.content is invalid")
|
||||
return true
|
||||
end if
|
||||
metadata = content.metadata
|
||||
if not IsAssociativeArray(metadata)
|
||||
response.Default(500, "videoQueue.player.content.metadata is invalid")
|
||||
return true
|
||||
end if
|
||||
if metadata.videoId <> v
|
||||
response.Default(400, "videoQueue.playVideo.metadata.videoId does not match the requested video id")
|
||||
return true
|
||||
end if
|
||||
else
|
||||
metadata = m.invidiousService.GetVideoMetadata(v)
|
||||
if metadata.error <> invalid
|
||||
response.Default(500, metadata.error)
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
m.dashManifest.invidiousInstance = m.invidiousService.GetInstance()
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import "pkg:/components/Services/Innertube/SessionData.bs"
|
||||
import "pkg:/source/services/HttpClient.bs"
|
||||
|
||||
namespace Http
|
||||
|
||||
class InnertubeRouter extends HttpRouter
|
||||
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.innertube = server.task.innertube
|
||||
end function
|
||||
|
||||
@get("/api/innertube/session")
|
||||
function GetSessionData(context as object) as object
|
||||
response = context.response
|
||||
|
||||
sessionData = {
|
||||
"timestamp": m.innertube.timestamp
|
||||
"visitorData": m.innertube.visitorData
|
||||
"poToken": m.innertube.poToken
|
||||
}
|
||||
|
||||
response.Json(sessionData)
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/api/innertube/session")
|
||||
function SetSessionData(context as object) as object
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid or not IsAssociativeArray(payload)
|
||||
response.Default(400, "Invalid payload")
|
||||
return true
|
||||
end if
|
||||
|
||||
if not IsInt(payload.timestamp)
|
||||
response.Default(400, "Invalid timestamp")
|
||||
return true
|
||||
end if
|
||||
if StringUtils.IsNullOrEmpty(payload.visitorData)
|
||||
response.Default(400, "Invalid visitorData")
|
||||
return true
|
||||
end if
|
||||
if StringUtils.IsNullOrEmpty(payload.poToken)
|
||||
response.Default(400, "Invalid poToken")
|
||||
return true
|
||||
end if
|
||||
|
||||
Innertube.SaveSessionDataToRegistry({
|
||||
"timestamp": payload.timestamp
|
||||
"visitorData": payload.visitorData
|
||||
"poToken": payload.poToken
|
||||
})
|
||||
|
||||
m.innertube.timestamp = payload.timestamp
|
||||
m.innertube.visitorData = payload.visitorData
|
||||
m.innertube.poToken = payload.poToken
|
||||
response.Default(204, "Session data updated successfully")
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/api/innertube/proxy")
|
||||
function ProxyRequest(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
requestArgs = request.Json()
|
||||
if requestArgs = invalid
|
||||
response.Default(400, "Invalid request body")
|
||||
return true
|
||||
end if
|
||||
|
||||
httpReq = HttpClient.FromObject(requestArgs)
|
||||
httpRes = httpReq.Await()
|
||||
|
||||
result = {
|
||||
"status": httpRes.StatusCode()
|
||||
"headers": httpRes.Headers()
|
||||
"body": httpRes.Text()
|
||||
}
|
||||
|
||||
response.Json(result)
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
end namespace
|
||||
+61
-19
@@ -735,6 +735,24 @@ namespace Http
|
||||
options.params = params
|
||||
end if
|
||||
|
||||
' sort by is a special sorting argument handled by Playlet backend.
|
||||
' It's a JSON object that could have the "params" key or "continuation"
|
||||
' key. In this case, we will override these options with the values
|
||||
' from the "sort_by" query parameter. If we do get an Invidious "sort_by"
|
||||
' (such as "newest", "oldest", etc.), we'll ignore it, as it is not supported.
|
||||
sortBy = request.query.sort_by
|
||||
if not StringUtils.IsNullOrEmpty(sortBy) and sortBy.StartsWith("{")
|
||||
sortBy = ParseJson(sortBy)
|
||||
if IsAssociativeArray(sortBy)
|
||||
if sortBy.DoesExist("params")
|
||||
options.params = sortBy.params
|
||||
end if
|
||||
if sortBy.DoesExist("continuation")
|
||||
options.continuation = sortBy.continuation
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
channel = InnertubeService.GetChannel(channelId, options)
|
||||
if raw
|
||||
response.Json(channel)
|
||||
@@ -747,28 +765,52 @@ namespace Http
|
||||
return true
|
||||
end if
|
||||
|
||||
result = {}
|
||||
if _tab = "playlists" or _tab = "podcasts" or _tab = "releases" or _tab = "courses"
|
||||
result = {
|
||||
"playlists": channel.items
|
||||
}
|
||||
if channel.DoesExist("continuation")
|
||||
result.continuation = channel.continuation
|
||||
end if
|
||||
response.Json(result)
|
||||
if channel.DoesExist("cache-control")
|
||||
response.headers["cache-control"] = channel["cache-control"]
|
||||
end if
|
||||
result ["playlists"] = channel.items
|
||||
else
|
||||
result = {
|
||||
"videos": channel.items
|
||||
}
|
||||
if channel.DoesExist("continuation")
|
||||
result.continuation = channel.continuation
|
||||
end if
|
||||
response.Json(result)
|
||||
if channel.DoesExist("cache-control")
|
||||
response.headers["cache-control"] = channel["cache-control"]
|
||||
result ["videos"] = channel.items
|
||||
end if
|
||||
if channel.DoesExist("continuation")
|
||||
result.continuation = channel.continuation
|
||||
end if
|
||||
if channel.DoesExist("sortOptions")
|
||||
' Transform sort options from:
|
||||
' [{
|
||||
' "title": "string",
|
||||
' "isSelected": "boolean"
|
||||
' "params?": "string",
|
||||
' "continuation?": "string"
|
||||
' }]
|
||||
' to:
|
||||
' [{
|
||||
' "title": "string",
|
||||
' "isSelected": "boolean"
|
||||
' "params?": "string",
|
||||
' "continuation?": "string"
|
||||
' "id": "{ \"params\": \"string\", \"continuation\": \"string\" }"
|
||||
' }]
|
||||
' This so sorting doesn't interfere with actual params or continuation.
|
||||
' Sort options are later parsed by Playlet backend.
|
||||
sortOptions = channel.sortOptions
|
||||
if IsArray(sortOptions) and sortOptions.Count() > 0
|
||||
for i = 0 to sortOptions.Count() - 1
|
||||
sortOption = sortOptions[i]
|
||||
sortOptionId = {}
|
||||
if sortOption.DoesExist("params")
|
||||
sortOptionId["params"] = sortOption.params
|
||||
end if
|
||||
if sortOption.DoesExist("continuation")
|
||||
sortOptionId["continuation"] = sortOption.continuation
|
||||
end if
|
||||
sortOption.id = FormatJson(sortOptionId)
|
||||
end for
|
||||
end if
|
||||
result["sortOptions"] = sortOptions
|
||||
end if
|
||||
response.Json(result)
|
||||
if channel.DoesExist("cache-control")
|
||||
response.headers["cache-control"] = channel["cache-control"]
|
||||
end if
|
||||
|
||||
return true
|
||||
|
||||
@@ -92,6 +92,10 @@ namespace Http
|
||||
instance = m.invidiousService.GetInstance()
|
||||
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||
if IsAssociativeArray(payload.metadata)
|
||||
contentNode.addFields({ metadata: payload.metadata })
|
||||
end if
|
||||
|
||||
nodeType = contentNode.type
|
||||
|
||||
if nodeType = "playlist"
|
||||
|
||||
@@ -6,6 +6,7 @@ import "pkg:/components/Web/PlayletWebServer/Middleware/DialRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/HlsRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/HomeRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/InnertubeRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs"
|
||||
@@ -39,6 +40,8 @@ function SetupRoutes(server as object)
|
||||
#if DEBUG
|
||||
'CORS is mostly for developing the web app
|
||||
server.UseRouter(new Http.CorsMiddleware())
|
||||
#else
|
||||
server.UseRouter(new Http.CorsMiddleware(""))
|
||||
#end if
|
||||
if server.settings.WebSocketsEnabled
|
||||
server.UseRouter(new Http.WebSocketMiddleware())
|
||||
@@ -60,6 +63,7 @@ function SetupRoutes(server as object)
|
||||
server.UseRouter(new Http.CacheRouter())
|
||||
server.UseRouter(new Http.RegistryRouter(server))
|
||||
server.UseRouter(new Http.PlayletInvidiousBackendRouter(server))
|
||||
server.UseRouter(new Http.InnertubeRouter(server))
|
||||
|
||||
etags = new Http.EtagUtils()
|
||||
server.UseRouter(new Http.HttpStaticFilesRouter("/", "libpkg:/www", etags, { staticFiles: true, staticCompressed: true }))
|
||||
|
||||
@@ -46,10 +46,11 @@ namespace Http
|
||||
function Add(incoming as string, maybeUnicode as boolean)
|
||||
if IsString(m.buffer)
|
||||
m.buffer = m.buffer + incoming
|
||||
m.maybe_unicode = m.maybe_unicode or maybeUnicode
|
||||
else
|
||||
m.buffer = incoming
|
||||
m.maybe_unicode = maybeUnicode
|
||||
end if
|
||||
m.maybe_unicode = maybeUnicode
|
||||
end function
|
||||
|
||||
function ProcessNext(connection as HttpConnection) as boolean
|
||||
|
||||
@@ -20,9 +20,17 @@ namespace Http
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
response.headers["Access-Control-Allow-Origin"] = m.origin
|
||||
response.headers["Access-Control-Allow-Headers"] = m.headers
|
||||
response.headers["Access-Control-Allow-Methods"] = m.methods
|
||||
if not StringUtils.IsNullOrEmpty(m.origin)
|
||||
response.headers["Access-Control-Allow-Origin"] = m.origin
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(m.headers)
|
||||
response.headers["Access-Control-Allow-Headers"] = m.headers
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(m.methods)
|
||||
response.headers["Access-Control-Allow-Methods"] = m.methods
|
||||
end if
|
||||
|
||||
if request.method = "OPTIONS"
|
||||
response.header_only = true
|
||||
|
||||
@@ -1328,5 +1328,65 @@
|
||||
<source>Login to YouTube</source>
|
||||
<translation>Bei YouTube anmelden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a service to login</source>
|
||||
<translation>Einen Dienst zum Anmelden auswählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open the link %1 and enter the following code:</source>
|
||||
<translation>Den Link %1 öffnen und diesen Code eingeben:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use responsibly, especially if your YouTube account is tied to business or monetization.</source>
|
||||
<translation>Handeln Sie verantwortungsbewusst, besonders wenn Ihr YouTube-Benutzerkonto mit einem Gewerbe oder Monetarisierung zusammenhängt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Who's watching?</source>
|
||||
<translation>Wer guckt gerade?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No valid accounts found for YouTube login.</source>
|
||||
<translation>Keine gültigen Benutzerkonten zum Anmelden auf YouTube gefunden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure which segments to skip</source>
|
||||
<translation>Das Überspringen von Abschnitten konfigurieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Press OK to skip</source>
|
||||
<translation>OK drücken, um zu überspringen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auto Skip</source>
|
||||
<translation>Auto-Überspringen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Manual Skip</source>
|
||||
<translation>Manuelles Überspringen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show in Seekbar</source>
|
||||
<translation>In der Suchleiste anzeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Categories</source>
|
||||
<translation>Kategorien</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Playlet is a third-party app and is not affiliated with, endorsed by, or sponsored by YouTube or Google. All trademarks and registered trademarks mentioned are the property of their respective owners and are used only for identification purposes.</source>
|
||||
<translation type="unfinished">Playlet ist eine Drittanbieter-App, wird weder von YouTube noch von Google unterstützt oder gesponsert und steht in keiner Verbindung zu diesen. Alle hier erwähnten (eingetragenen) Marken sind geistiges Eigentum ihrer jeweiligen Besitzer und werden nur zu Identifikationszwecken genutzt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>By using Playlet and signing in with your YouTube account, you acknowledge that you do so at your own risk. The developers of Playlet are not liable for any harm, including but not limited to data loss, account suspension or ban, hacking, or loss of content.</source>
|
||||
<translation type="unfinished">Die Benutzung von Playlet und das Anmelden mit einem YouTube-Benutzerkonto erfolgt auf Ihr eigenes Risiko hin. Die Entwickler von Playlet sind für jedwegen Schaden, inklusive, aber nicht ausschließlich dem Verlust von Daten, der Sperrung/ Inaktivierung von Benutzerkonten und Hacking, nicht haftbar oder verantwortlich.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select option for %1</source>
|
||||
<translation>Option für %1 auswählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable</source>
|
||||
<translation>Deaktivieren</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -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=00000
|
||||
build_version=00004
|
||||
|
||||
ui_resolutions=hd
|
||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||
|
||||
@@ -14,10 +14,9 @@ namespace AsyncTask
|
||||
task.id = id
|
||||
task.input = input
|
||||
|
||||
if callback <> invalid
|
||||
m[`asynctask_${id}_callback`] = callback
|
||||
task.ObserveFieldScoped("state", FuncName(internal_OnTaskState))
|
||||
end if
|
||||
m[`asynctask_${id}`] = task
|
||||
m[`asynctask_${id}_callback`] = callback
|
||||
task.ObserveFieldScoped("state", FuncName(internal_OnTaskState))
|
||||
|
||||
return task
|
||||
end function
|
||||
@@ -40,6 +39,9 @@ namespace AsyncTask
|
||||
end if
|
||||
end if
|
||||
|
||||
task.input = invalid
|
||||
task.output = invalid
|
||||
m.delete(`asynctask_${id}`)
|
||||
m.delete(`asynctask_${id}_callback`)
|
||||
end function
|
||||
|
||||
|
||||
@@ -719,10 +719,10 @@ namespace HttpClient
|
||||
else
|
||||
if m.request._sent <> true
|
||||
m._errorMessage = Tr(Locale.HttpClient.RequestNotSent)
|
||||
else if m.IsTimedOut()
|
||||
m._errorMessage = Tr(Locale.HttpClient.RequestTimedOut)
|
||||
else if m.IsCancelled()
|
||||
m._errorMessage = Tr(Locale.HttpClient.RequestCancelled)
|
||||
else if m.IsTimedOut()
|
||||
m._errorMessage = Tr(Locale.HttpClient.RequestTimedOut)
|
||||
else if type(m.event) = "roUrlEvent"
|
||||
m._errorMessage = `${Tr(Locale.HttpClient.Reason)}:${m.event.GetFailureReason() }\nStatusCode: ${m.StatusCode()}\nRequestId: ${m.event.GetSourceIdentity()}`
|
||||
if includeBody
|
||||
|
||||
@@ -13,14 +13,10 @@ namespace TimeUtils
|
||||
minutes = (length \ 60) mod 60
|
||||
seconds = length mod 60
|
||||
|
||||
if seconds < 10
|
||||
seconds = "0" + seconds.ToStr()
|
||||
else
|
||||
seconds = seconds.ToStr()
|
||||
end if
|
||||
seconds = seconds.ToStr("%02d")
|
||||
|
||||
if minutes < 10 and hours > 0
|
||||
minutes = "0" + minutes.ToStr()
|
||||
if hours > 0
|
||||
minutes = minutes.ToStr("%02d")
|
||||
else
|
||||
minutes = minutes.ToStr()
|
||||
end if
|
||||
|
||||
Generated
+106
-32
@@ -1,32 +1,34 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-web",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@tsconfig/svelte": "^5.0.4",
|
||||
"@vitejs/plugin-legacy": "^6.1.1",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"bgutils-js": "^3.2.0",
|
||||
"daisyui": "^4.12.23",
|
||||
"dotenv": "^16.5.0",
|
||||
"ip": "^2.0.1",
|
||||
"postcss": "^8.5.4",
|
||||
"svelte": "^5.33.10",
|
||||
"postcss": "^8.5.5",
|
||||
"svelte": "^5.34.1",
|
||||
"svelte-check": "^4.2.1",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"terser": "^5.40.0",
|
||||
"terser": "^5.42.0",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"youtubei.js": "^14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@alloc/quick-lru": {
|
||||
@@ -1546,6 +1548,13 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@bufbuild/protobuf": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.5.1.tgz",
|
||||
"integrity": "sha512-lut4UTvKL8tqtend0UDu7R79/n9jA7Jtxf77RNPbxtmWqfWI4qQ9bTjf7KCS4vfqLmpQbuHr1ciqJumAgJODdw==",
|
||||
"dev": true,
|
||||
"license": "(Apache-2.0 AND BSD-3-Clause)"
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.0",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
|
||||
@@ -1971,6 +1980,16 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@fastify/busboy": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
|
||||
"integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||
@@ -2382,17 +2401,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-5.0.3.tgz",
|
||||
"integrity": "sha512-MCFS6CrQDu1yGwspm4qtli0e63vaPCehf6V7pIMP15AsWgMKrqDGCPFF/0kn4SP0ii4aySu4Pa62+fIRGFMjgw==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-5.1.0.tgz",
|
||||
"integrity": "sha512-wojIS/7GYnJDYIg1higWj2ROA6sSRWvcR1PO/bqEyFr/5UZah26c8Cz4u0NaqjPeVltzsVpt2Tm8d2io0V+4Tw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sveltejs/vite-plugin-svelte-inspector": "^4.0.1",
|
||||
"debug": "^4.4.0",
|
||||
"debug": "^4.4.1",
|
||||
"deepmerge": "^4.3.1",
|
||||
"kleur": "^4.1.5",
|
||||
"magic-string": "^0.30.15",
|
||||
"vitefu": "^1.0.4"
|
||||
"magic-string": "^0.30.17",
|
||||
"vitefu": "^1.0.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.0.0 || ^20.0.0 || >=22"
|
||||
@@ -2654,6 +2674,16 @@
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bgutils-js": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/bgutils-js/-/bgutils-js-3.2.0.tgz",
|
||||
"integrity": "sha512-CacO15JvxbclbLeCAAm9DETGlLuisRGWpPigoRvNsccSCPEC4pwYwA2g2x/pv7Om/sk79d4ib35V5HHmxPBpDg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/LuanRT"
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
||||
@@ -2937,10 +2967,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
@@ -3062,9 +3093,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/esrap": {
|
||||
"version": "1.4.6",
|
||||
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.6.tgz",
|
||||
"integrity": "sha512-F/D2mADJ9SHY3IwksD4DAXjTt7qt7GWUf3/8RhCNWmC/67tyb55dpimHmy7EplakFaflV0R/PC+fdSPqrRHAQw==",
|
||||
"version": "1.4.9",
|
||||
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.9.tgz",
|
||||
"integrity": "sha512-3OMlcd0a03UGuZpPeUC1HxR3nA23l+HEyCiZw3b3FumJIN9KphoGzDJKMXI1S72jVS1dsenDyQC0kJlO1U9E1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3402,6 +3433,19 @@
|
||||
"@pkgjs/parseargs": "^0.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jintr": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/jintr/-/jintr-3.3.1.tgz",
|
||||
"integrity": "sha512-nnOzyhf0SLpbWuZ270Omwbj5LcXUkTcZkVnK8/veJXtSZOiATM5gMZMdmzN75FmTyj+NVgrGaPdH12zIJ24oIA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/LuanRT"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "1.21.7",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",
|
||||
@@ -3767,9 +3811,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.4",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz",
|
||||
"integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==",
|
||||
"version": "8.5.5",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.5.tgz",
|
||||
"integrity": "sha512-d/jtm+rdNT8tpXuHY5MMtcbJFBkhXE6593XVR9UoGCH8jSFGci7jGvMGH5RYd5PBJW+00NZQt6gf7CbagJCrhg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -4372,9 +4416,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte": {
|
||||
"version": "5.33.10",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.33.10.tgz",
|
||||
"integrity": "sha512-/yArPQIBoQS2p86LKnvJywOXkVHeEXnFgrDPSxkEfIAEkykopYuy2bF6UUqHG4IbZlJD6OurLxJT8Kn7kTk9WA==",
|
||||
"version": "5.34.1",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.34.1.tgz",
|
||||
"integrity": "sha512-jWNnN2hZFNtnzKPptCcJHBWrD9CtbHPDwIRIODufOYaWkR0kLmAIlM384lMt4ucwuIRX4hCJwD2D8ZtEcGJQ0Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4387,7 +4431,7 @@
|
||||
"axobject-query": "^4.1.0",
|
||||
"clsx": "^2.1.1",
|
||||
"esm-env": "^1.2.1",
|
||||
"esrap": "^1.4.6",
|
||||
"esrap": "^1.4.8",
|
||||
"is-reference": "^3.0.3",
|
||||
"locate-character": "^3.0.0",
|
||||
"magic-string": "^0.30.11",
|
||||
@@ -4593,9 +4637,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.40.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.40.0.tgz",
|
||||
"integrity": "sha512-cfeKl/jjwSR5ar7d0FGmave9hFGJT8obyo0z+CrQOylLDbk7X81nPU6vq9VORa5jU30SkDnT2FXjLbR8HLP+xA==",
|
||||
"version": "5.42.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.42.0.tgz",
|
||||
"integrity": "sha512-UYCvU9YQW2f/Vwl+P0GfhxJxbUGLwd+5QrrGgLajzWAtC/23AX0vcise32kkP7Eu0Wu9VlzzHAXkLObgjQfFlQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
@@ -4713,6 +4757,19 @@
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "5.29.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
|
||||
"integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fastify/busboy": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/unicode-canonical-property-names-ecmascript": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz",
|
||||
@@ -4911,10 +4968,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitefu": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.5.tgz",
|
||||
"integrity": "sha512-h4Vflt9gxODPFNGPwp4zAMZRpZR7eslzwH2c5hn5kNZ5rhnKyRJ50U+yGCdc2IRaBs8O4haIgLNGrV5CrpMsCA==",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.6.tgz",
|
||||
"integrity": "sha512-+Rex1GlappUyNN6UfwbVZne/9cYC4+R2XDk9xkNXBKMw6HQagdX9PgZ8V2v1WUSK1wfBLp7qbI1+XSNIlB1xmA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"tests/deps/*",
|
||||
"tests/projects/*"
|
||||
@@ -5050,6 +5108,22 @@
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/youtubei.js": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-14.0.0.tgz",
|
||||
"integrity": "sha512-KAFttOw+9fwwBUvBc1T7KzMNBLczDOuN/dfote8BA9CABxgx8MPgV+vZWlowdDB6DnHjSUYppv+xvJ4VNBLK9A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/LuanRT"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^2.0.0",
|
||||
"jintr": "^3.3.1",
|
||||
"tslib": "^2.5.0",
|
||||
"undici": "^5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/zimmerframe": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.40.0",
|
||||
"version": "0.40.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -9,24 +9,26 @@
|
||||
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@tsconfig/svelte": "^5.0.4",
|
||||
"@vitejs/plugin-legacy": "^6.1.1",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"bgutils-js": "^3.2.0",
|
||||
"daisyui": "^4.12.23",
|
||||
"dotenv": "^16.5.0",
|
||||
"ip": "^2.0.1",
|
||||
"postcss": "^8.5.4",
|
||||
"svelte": "^5.33.10",
|
||||
"postcss": "^8.5.5",
|
||||
"svelte": "^5.34.1",
|
||||
"svelte-check": "^4.2.1",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"terser": "^5.40.0",
|
||||
"terser": "^5.42.0",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"youtubei.js": "^14.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,440 @@
|
||||
import { Innertube, UniversalCache } from 'youtubei.js/web';
|
||||
import { getHost } from "lib/Api/Host";
|
||||
import { BG } from "bgutils-js";
|
||||
import { type BgConfig } from "bgutils-js";
|
||||
import type { VideoInfo } from 'node_modules/youtubei.js/dist/src/parser/youtube';
|
||||
import type { StoryboardData } from 'node_modules/youtubei.js/dist/src/parser/classes/PlayerStoryboardSpec';
|
||||
import type { PlayerLiveStoryboardSpec, PlayerStoryboardSpec } from 'node_modules/youtubei.js/dist/src/parser/nodes';
|
||||
|
||||
// https://github.com/iv-org/invidious/blob/a021b93063f3956fc9bb3cce0fb56ea252422738/src/invidious/videos/formats.cr#L7
|
||||
const FORMATS = {
|
||||
"5": { ext: "flv", width: 400, height: 240, acodec: "mp3", abr: 64, vcodec: "h263" },
|
||||
"6": { ext: "flv", width: 450, height: 270, acodec: "mp3", abr: 64, vcodec: "h263" },
|
||||
"13": { ext: "3gp", acodec: "aac", vcodec: "mp4v" },
|
||||
"17": { ext: "3gp", width: 176, height: 144, acodec: "aac", abr: 24, vcodec: "mp4v" },
|
||||
"18": { ext: "mp4", width: 640, height: 360, acodec: "aac", abr: 96, vcodec: "h264" },
|
||||
"22": { ext: "mp4", width: 1280, height: 720, acodec: "aac", abr: 192, vcodec: "h264" },
|
||||
"34": { ext: "flv", width: 640, height: 360, acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"35": { ext: "flv", width: 854, height: 480, acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"36": { ext: "3gp", width: 320, acodec: "aac", vcodec: "mp4v" },
|
||||
"37": { ext: "mp4", width: 1920, height: 1080, acodec: "aac", abr: 192, vcodec: "h264" },
|
||||
"38": { ext: "mp4", width: 4096, height: 3072, acodec: "aac", abr: 192, vcodec: "h264" },
|
||||
"43": { ext: "webm", width: 640, height: 360, acodec: "vorbis", abr: 128, vcodec: "vp8" },
|
||||
"44": { ext: "webm", width: 854, height: 480, acodec: "vorbis", abr: 128, vcodec: "vp8" },
|
||||
"45": { ext: "webm", width: 1280, height: 720, acodec: "vorbis", abr: 192, vcodec: "vp8" },
|
||||
"46": { ext: "webm", width: 1920, height: 1080, acodec: "vorbis", abr: 192, vcodec: "vp8" },
|
||||
"59": { ext: "mp4", width: 854, height: 480, acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"78": { ext: "mp4", width: 854, height: 480, acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"82": { ext: "mp4", height: 360, format: "3D", acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"83": { ext: "mp4", height: 480, format: "3D", acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"84": { ext: "mp4", height: 720, format: "3D", acodec: "aac", abr: 192, vcodec: "h264" },
|
||||
"85": { ext: "mp4", height: 1080, format: "3D", acodec: "aac", abr: 192, vcodec: "h264" },
|
||||
"100": { ext: "webm", height: 360, format: "3D", acodec: "vorbis", abr: 128, vcodec: "vp8" },
|
||||
"101": { ext: "webm", height: 480, format: "3D", acodec: "vorbis", abr: 192, vcodec: "vp8" },
|
||||
"102": { ext: "webm", height: 720, format: "3D", acodec: "vorbis", abr: 192, vcodec: "vp8" },
|
||||
"91": { ext: "mp4", height: 144, format: "HLS", acodec: "aac", abr: 48, vcodec: "h264" },
|
||||
"92": { ext: "mp4", height: 240, format: "HLS", acodec: "aac", abr: 48, vcodec: "h264" },
|
||||
"93": { ext: "mp4", height: 360, format: "HLS", acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"94": { ext: "mp4", height: 480, format: "HLS", acodec: "aac", abr: 128, vcodec: "h264" },
|
||||
"95": { ext: "mp4", height: 720, format: "HLS", acodec: "aac", abr: 256, vcodec: "h264" },
|
||||
"96": { ext: "mp4", height: 1080, format: "HLS", acodec: "aac", abr: 256, vcodec: "h264" },
|
||||
"132": { ext: "mp4", height: 240, format: "HLS", acodec: "aac", abr: 48, vcodec: "h264" },
|
||||
"151": { ext: "mp4", height: 72, format: "HLS", acodec: "aac", abr: 24, vcodec: "h264" },
|
||||
"133": { ext: "mp4", height: 240, format: "DASH video", vcodec: "h264" },
|
||||
"134": { ext: "mp4", height: 360, format: "DASH video", vcodec: "h264" },
|
||||
"135": { ext: "mp4", height: 480, format: "DASH video", vcodec: "h264" },
|
||||
"136": { ext: "mp4", height: 720, format: "DASH video", vcodec: "h264" },
|
||||
"137": { ext: "mp4", height: 1080, format: "DASH video", vcodec: "h264" },
|
||||
"138": { ext: "mp4", format: "DASH video", vcodec: "h264" },
|
||||
"160": { ext: "mp4", height: 144, format: "DASH video", vcodec: "h264" },
|
||||
"212": { ext: "mp4", height: 480, format: "DASH video", vcodec: "h264" },
|
||||
"264": { ext: "mp4", height: 1440, format: "DASH video", vcodec: "h264" },
|
||||
"298": { ext: "mp4", height: 720, format: "DASH video", vcodec: "h264", fps: 60 },
|
||||
"299": { ext: "mp4", height: 1080, format: "DASH video", vcodec: "h264", fps: 60 },
|
||||
"266": { ext: "mp4", height: 2160, format: "DASH video", vcodec: "h264" },
|
||||
"139": { ext: "m4a", format: "DASH audio", acodec: "aac", abr: 48, container: "m4a_dash" },
|
||||
"140": { ext: "m4a", format: "DASH audio", acodec: "aac", abr: 128, container: "m4a_dash" },
|
||||
"141": { ext: "m4a", format: "DASH audio", acodec: "aac", abr: 256, container: "m4a_dash" },
|
||||
"256": { ext: "m4a", format: "DASH audio", acodec: "aac", container: "m4a_dash" },
|
||||
"258": { ext: "m4a", format: "DASH audio", acodec: "aac", container: "m4a_dash" },
|
||||
"325": { ext: "m4a", format: "DASH audio", acodec: "dtse", container: "m4a_dash" },
|
||||
"328": { ext: "m4a", format: "DASH audio", acodec: "ec-3", container: "m4a_dash" },
|
||||
"167": { ext: "webm", height: 360, width: 640, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"168": { ext: "webm", height: 480, width: 854, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"169": { ext: "webm", height: 720, width: 1280, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"170": { ext: "webm", height: 1080, width: 1920, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"218": { ext: "webm", height: 480, width: 854, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"219": { ext: "webm", height: 480, width: 854, format: "DASH video", container: "webm", vcodec: "vp8" },
|
||||
"278": { ext: "webm", height: 144, format: "DASH video", container: "webm", vcodec: "vp9" },
|
||||
"242": { ext: "webm", height: 240, format: "DASH video", vcodec: "vp9" },
|
||||
"243": { ext: "webm", height: 360, format: "DASH video", vcodec: "vp9" },
|
||||
"244": { ext: "webm", height: 480, format: "DASH video", vcodec: "vp9" },
|
||||
"245": { ext: "webm", height: 480, format: "DASH video", vcodec: "vp9" },
|
||||
"246": { ext: "webm", height: 480, format: "DASH video", vcodec: "vp9" },
|
||||
"247": { ext: "webm", height: 720, format: "DASH video", vcodec: "vp9" },
|
||||
"248": { ext: "webm", height: 1080, format: "DASH video", vcodec: "vp9" },
|
||||
"271": { ext: "webm", height: 1440, format: "DASH video", vcodec: "vp9" },
|
||||
"272": { ext: "webm", height: 2160, format: "DASH video", vcodec: "vp9" },
|
||||
"302": { ext: "webm", height: 720, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"303": { ext: "webm", height: 1080, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"308": { ext: "webm", height: 1440, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"313": { ext: "webm", height: 2160, format: "DASH video", vcodec: "vp9" },
|
||||
"315": { ext: "webm", height: 2160, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"330": { ext: "webm", height: 144, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"331": { ext: "webm", height: 240, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"332": { ext: "webm", height: 360, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"333": { ext: "webm", height: 480, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"334": { ext: "webm", height: 720, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"335": { ext: "webm", height: 1080, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"336": { ext: "webm", height: 1440, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"337": { ext: "webm", height: 2160, format: "DASH video", vcodec: "vp9", fps: 60 },
|
||||
"171": { ext: "webm", acodec: "vorbis", format: "DASH audio", abr: 128 },
|
||||
"172": { ext: "webm", acodec: "vorbis", format: "DASH audio", abr: 256 },
|
||||
"249": { ext: "webm", format: "DASH audio", acodec: "opus", abr: 50 },
|
||||
"250": { ext: "webm", format: "DASH audio", acodec: "opus", abr: 70 },
|
||||
"251": { ext: "webm", format: "DASH audio", acodec: "opus", abr: 160 },
|
||||
"394": { ext: "mp4", height: 144, vcodec: "av01.0.05M.08" },
|
||||
"395": { ext: "mp4", height: 240, vcodec: "av01.0.05M.08" },
|
||||
"396": { ext: "mp4", height: 360, vcodec: "av01.0.05M.08" },
|
||||
"397": { ext: "mp4", height: 480, vcodec: "av01.0.05M.08" }
|
||||
}
|
||||
|
||||
export class YoutubeJs {
|
||||
static host = () => `http://${getHost()}`
|
||||
|
||||
static innerTube: Innertube;
|
||||
static innerTubePromise: Promise<void>;
|
||||
|
||||
static poToken?: string = undefined;
|
||||
static visitorData?: string = undefined;
|
||||
|
||||
static async fetch(input: RequestInfo | URL, init?: RequestInit) {
|
||||
const method = init?.method
|
||||
? init.method
|
||||
: input instanceof Request
|
||||
? input.method
|
||||
: 'GET';
|
||||
|
||||
const url = typeof input === 'string'
|
||||
? new URL(input)
|
||||
: input instanceof URL
|
||||
? input
|
||||
: new URL(input.url);
|
||||
|
||||
const headers = init?.headers
|
||||
? new Headers(init.headers)
|
||||
: input instanceof Request
|
||||
? input.headers
|
||||
: new Headers();
|
||||
|
||||
const headersObject = {};
|
||||
headers.forEach((value, key) => {
|
||||
headersObject[key] = value;
|
||||
});
|
||||
|
||||
let body = init?.body
|
||||
|
||||
const args = {
|
||||
Method: method,
|
||||
Url: url,
|
||||
Headers: headersObject,
|
||||
Body: body,
|
||||
CacheSeconds: -1,
|
||||
};
|
||||
|
||||
const response = await fetch(`http://${getHost()}/api/innertube/proxy`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
method: "POST",
|
||||
body: JSON.stringify(args)
|
||||
})
|
||||
|
||||
const responseData = await response.json();
|
||||
|
||||
return new Response(responseData.body, {
|
||||
status: responseData.status,
|
||||
statusText: `${responseData.status}`,
|
||||
headers: responseData.headers,
|
||||
});
|
||||
}
|
||||
|
||||
static async initSessionData() {
|
||||
if (YoutubeJs.visitorData && YoutubeJs.poToken) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const sessionData = await YoutubeJs.getSessionData();
|
||||
if (sessionData.visitorData) {
|
||||
YoutubeJs.visitorData = sessionData.visitorData;
|
||||
if (sessionData.poToken) {
|
||||
YoutubeJs.poToken = sessionData.poToken;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!YoutubeJs.visitorData) {
|
||||
YoutubeJs.visitorData = await YoutubeJs.generateVisitorData();
|
||||
}
|
||||
|
||||
YoutubeJs.poToken = await YoutubeJs.generatePoToken(YoutubeJs.visitorData);
|
||||
|
||||
await YoutubeJs.setSessionData({
|
||||
visitorData: YoutubeJs.visitorData,
|
||||
poToken: YoutubeJs.poToken,
|
||||
timestamp: Math.floor(Date.now() / 1000)
|
||||
});
|
||||
}
|
||||
|
||||
static async getSessionData() {
|
||||
const response = await fetch(`http://${getHost()}/api/innertube/session`)
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
static async setSessionData(sessionData: any) {
|
||||
await fetch(`http://${getHost()}/api/innertube/session`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(sessionData)
|
||||
});
|
||||
}
|
||||
|
||||
static async getInnertube() {
|
||||
await YoutubeJs.initInnertube();
|
||||
return YoutubeJs.innerTube;
|
||||
}
|
||||
|
||||
static async initInnertube() {
|
||||
if (YoutubeJs.innerTube) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (YoutubeJs.innerTubePromise) {
|
||||
return YoutubeJs.innerTubePromise;
|
||||
}
|
||||
|
||||
YoutubeJs.innerTubePromise = new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
await YoutubeJs.initSessionData()
|
||||
YoutubeJs.innerTube = await Innertube.create({
|
||||
fetch: YoutubeJs.fetch,
|
||||
cache: new UniversalCache(true),
|
||||
po_token: YoutubeJs.poToken,
|
||||
visitor_data: YoutubeJs.visitorData,
|
||||
});
|
||||
YoutubeJs.innerTubePromise = null;
|
||||
resolve();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
YoutubeJs.innerTube = null;
|
||||
reject(error);
|
||||
}
|
||||
})
|
||||
|
||||
return YoutubeJs.innerTubePromise;
|
||||
}
|
||||
|
||||
static async generateVisitorData() {
|
||||
const innertube = await Innertube.create({ retrieve_player: false });
|
||||
const visitorData = innertube.session.context.client.visitorData;
|
||||
if (!visitorData) {
|
||||
throw new Error('Could not get visitor data');
|
||||
}
|
||||
return visitorData;
|
||||
}
|
||||
|
||||
static async generatePoToken(visitorData: string) {
|
||||
const requestKey = 'O43z0dpjhgX20SCx4KAo';
|
||||
|
||||
const bgConfig: BgConfig = {
|
||||
fetch: (input: string | URL | globalThis.Request, init?: RequestInit) => YoutubeJs.fetch(input, init),
|
||||
globalObj: globalThis,
|
||||
identifier: visitorData,
|
||||
requestKey
|
||||
};
|
||||
|
||||
const bgChallenge = await BG.Challenge.create(bgConfig);
|
||||
if (!bgChallenge) {
|
||||
throw new Error('Could not get challenge');
|
||||
}
|
||||
|
||||
const interpreterJavascript = bgChallenge.interpreterJavascript.privateDoNotAccessOrElseSafeScriptWrappedValue;
|
||||
if (interpreterJavascript) {
|
||||
new Function(interpreterJavascript)();
|
||||
} else {
|
||||
throw new Error('Could not load VM');
|
||||
}
|
||||
|
||||
const poTokenResult = await BG.PoToken.generate({
|
||||
program: bgChallenge.program,
|
||||
globalName: bgChallenge.globalName,
|
||||
bgConfig
|
||||
});
|
||||
|
||||
if (!poTokenResult || !poTokenResult.poToken) {
|
||||
throw new Error('Could not generate poToken');
|
||||
}
|
||||
|
||||
return poTokenResult.poToken;
|
||||
}
|
||||
|
||||
static async getVideoInfo(videoId: string) {
|
||||
await YoutubeJs.initInnertube();
|
||||
|
||||
const info = await YoutubeJs.innerTube.getBasicInfo(videoId, 'TV');
|
||||
|
||||
// We can't generate a proper dash from live videos.
|
||||
// By returning null, we're telling Playlet to fetch video info itself.
|
||||
if (info.basic_info.is_live) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Populate a video object that is similar to Invidious format.
|
||||
// Mostly populate only fields we care about, enough to make it work.
|
||||
return {
|
||||
type: "video",
|
||||
ytjs: true,
|
||||
title: info.basic_info.title,
|
||||
videoId: info.basic_info.id,
|
||||
videoThumbnails: [],
|
||||
storyboards: YoutubeJs.getStoryboards(info),
|
||||
description: "",
|
||||
published: 0,
|
||||
publishedText: "",
|
||||
keywords: [],
|
||||
viewCount: 0,
|
||||
likeCount: 0,
|
||||
dislikeCount: 0,
|
||||
paid: false,
|
||||
premium: false,
|
||||
isFamilyFriendly: true,
|
||||
allowedRegions: [],
|
||||
genre: "",
|
||||
genreUrl: null,
|
||||
author: info.basic_info.author,
|
||||
authorId: info.basic_info.channel_id,
|
||||
authorUrl: "",
|
||||
authorVerified: false,
|
||||
authorThumbnails: [],
|
||||
subCountText: "",
|
||||
lengthSeconds: info.basic_info.duration,
|
||||
allowRatings: true,
|
||||
rating: 0,
|
||||
isListed: true,
|
||||
liveNow: info.basic_info.is_live,
|
||||
isPostLiveDvr: info.basic_info.is_post_live_dvr,
|
||||
isUpcoming: info.basic_info.is_upcoming,
|
||||
dashUrl: info.streaming_data.dash_manifest_url || "",
|
||||
hlsUrl: info.streaming_data.hls_manifest_url,
|
||||
adaptiveFormats: YoutubeJs.getAdaptiveFormats(info),
|
||||
formatStreams: [],
|
||||
captions: YoutubeJs.getCaptions(info),
|
||||
recommendedVideos: [],
|
||||
}
|
||||
}
|
||||
|
||||
static getAdaptiveFormats(videoInfo: VideoInfo) {
|
||||
if (!videoInfo.streaming_data.adaptive_formats) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return videoInfo.streaming_data.adaptive_formats.map(format => {
|
||||
const formatInfo = FORMATS[format.itag];
|
||||
const result: any = {
|
||||
init: format.init_range ? `${format.init_range.start}-${format.init_range.end}` : "",
|
||||
index: format.index_range ? `${format.index_range.start}-${format.index_range.end}` : "",
|
||||
bitrate: `${format.bitrate}`,
|
||||
url: format.decipher(YoutubeJs.innerTube.session.player),
|
||||
itag: `${format.itag}`,
|
||||
type: format.mime_type,
|
||||
clen: `${format.approx_duration_ms}`,
|
||||
lmt: `${format.last_modified}`,
|
||||
container: formatInfo?.ext,
|
||||
encoding: formatInfo?.acodec ?? formatInfo?.vcodec,
|
||||
};
|
||||
if (format.audio_quality) {
|
||||
result.audioQuality = format.audio_quality;
|
||||
}
|
||||
if (format.audio_sample_rate) {
|
||||
result.audioSampleRate = format.audio_sample_rate;
|
||||
}
|
||||
if (format.audio_channels) {
|
||||
result.audioChannels = format.audio_channels;
|
||||
}
|
||||
|
||||
if (format.quality_label) {
|
||||
result.qualityLabel = format.quality_label;
|
||||
}
|
||||
if (format.fps) {
|
||||
result.fps = format.fps;
|
||||
}
|
||||
if (format.height && format.width) {
|
||||
result.size = `${format.width}x${format.height}`;
|
||||
result.resolution = `${format.height}p`;
|
||||
} else if (formatInfo?.height && formatInfo?.width) {
|
||||
result.size = `${formatInfo.width}x${formatInfo.height}`;
|
||||
result.resolution = `${formatInfo.height}p`;
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
static getStoryboards(videoInfo: VideoInfo) {
|
||||
if (!videoInfo.storyboards) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (videoInfo.storyboards.type === 'PlayerLiveStoryboardSpec') {
|
||||
const board = (videoInfo.storyboards as PlayerLiveStoryboardSpec).board
|
||||
return [{
|
||||
templateUrl: board.template_url,
|
||||
width: board.thumbnail_width,
|
||||
height: board.thumbnail_height,
|
||||
count: -1,
|
||||
interval: 5000,
|
||||
storyboardWidth: board.columns,
|
||||
storyboardHeight: board.rows,
|
||||
}];
|
||||
}
|
||||
|
||||
const storyboards = (videoInfo.storyboards as PlayerStoryboardSpec).boards;
|
||||
return storyboards.map((board: StoryboardData) => {
|
||||
return {
|
||||
templateUrl: board.template_url,
|
||||
width: board.thumbnail_width,
|
||||
height: board.thumbnail_height,
|
||||
count: board.thumbnail_count,
|
||||
interval: board.interval,
|
||||
storyboardWidth: board.columns,
|
||||
storyboardHeight: board.rows,
|
||||
storyboardCount: board.storyboard_count
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
static getCaptions(videoInfo: VideoInfo) {
|
||||
if (!videoInfo.captions?.caption_tracks) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return videoInfo.captions.caption_tracks.map(track => {
|
||||
const baseUrl = track.base_url;
|
||||
if (!baseUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const queryComponents = new URLSearchParams(baseUrl.split('?')[1]);
|
||||
queryComponents.set('fmt', 'vtt');
|
||||
const modifiedBaseUrl = `${baseUrl.split('?')[0]}?${queryComponents.toString()}`;
|
||||
|
||||
return {
|
||||
label: track.name.toString(),
|
||||
language_code: track.language_code || '',
|
||||
url: modifiedBaseUrl
|
||||
};
|
||||
}).filter(caption => !!caption);
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,8 @@
|
||||
|
||||
try {
|
||||
isLoading = true;
|
||||
// blur to hide the keyboard on mobile
|
||||
searchBox.blur();
|
||||
const response = await invidiousApi.search(
|
||||
searchBoxText,
|
||||
searchFilters,
|
||||
@@ -120,73 +122,76 @@
|
||||
|
||||
<div class={visibility ? "" : "hidden"}>
|
||||
<div class="m-4">
|
||||
<!-- TODO:P2 use search HTML element -->
|
||||
<form
|
||||
on:submit={async (e) => {
|
||||
e.preventDefault();
|
||||
page = 1;
|
||||
videos = [];
|
||||
await searchVideos("");
|
||||
}}
|
||||
>
|
||||
<div class="join w-full border border-neutral rounded-full">
|
||||
<input
|
||||
type="search"
|
||||
dir="auto"
|
||||
placeholder="{$translate('Search')}..."
|
||||
class="join-item input w-full border border-neutral rounded-full"
|
||||
bind:this={searchBox}
|
||||
bind:value={searchBoxText}
|
||||
on:input={searchSuggestions}
|
||||
on:focus={searchSuggestions}
|
||||
on:blur={() => {
|
||||
// A delay before clearing the suggestions allows the user to click on a suggestion
|
||||
// Clicking the suggestion will trigger the blur event immediately, and the search won't happen
|
||||
setTimeout(() => {
|
||||
suggestions = { suggestions: [] };
|
||||
}, 200);
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
class="join-item btn w-16"
|
||||
on:click={async () => {
|
||||
page = 1;
|
||||
videos = [];
|
||||
await searchVideos("");
|
||||
}}
|
||||
>
|
||||
<div class="h-6">
|
||||
<SearchThinIcon />
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="btn border border-neutral rounded-full mt-1"
|
||||
on:click={searchFiltersComponent.show()}
|
||||
<search>
|
||||
<form
|
||||
on:submit={async (e) => {
|
||||
e.preventDefault();
|
||||
page = 1;
|
||||
videos = [];
|
||||
await searchVideos("");
|
||||
}}
|
||||
>
|
||||
<div class="h-6 w-8">
|
||||
<FiltersIcon />
|
||||
<div class="join w-full border border-neutral rounded-full">
|
||||
<input
|
||||
type="search"
|
||||
dir="auto"
|
||||
placeholder="{$translate('Search')}..."
|
||||
class="join-item input w-full border border-neutral rounded-full"
|
||||
bind:this={searchBox}
|
||||
bind:value={searchBoxText}
|
||||
on:input={searchSuggestions}
|
||||
on:focus={searchSuggestions}
|
||||
on:blur={() => {
|
||||
// A delay before clearing the suggestions allows the user to click on a suggestion
|
||||
// Clicking the suggestion will trigger the blur event immediately, and the search won't happen
|
||||
setTimeout(() => {
|
||||
suggestions = { suggestions: [] };
|
||||
}, 200);
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="join-item btn w-16"
|
||||
on:click={async () => {
|
||||
page = 1;
|
||||
videos = [];
|
||||
await searchVideos("");
|
||||
}}
|
||||
>
|
||||
<div class="h-6">
|
||||
<SearchThinIcon />
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
{searchFiltersLabel}
|
||||
</button>
|
||||
|
||||
{#if suggestions.suggestions.length > 0}
|
||||
<ul
|
||||
class="dropdown-content menu z-10 p-2 shadow-xl bg-base-200 rounded-box"
|
||||
<button
|
||||
type="button"
|
||||
class="btn border border-neutral rounded-full mt-1"
|
||||
on:click={searchFiltersComponent.show()}
|
||||
>
|
||||
{#each suggestions.suggestions as suggestion}
|
||||
<li class="p-1">
|
||||
<button
|
||||
type="button"
|
||||
on:click={async (e) => {
|
||||
await suggestionClicked(e.currentTarget.innerText);
|
||||
}}>{@html suggestion}</button
|
||||
>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
</form>
|
||||
<div class="h-6 w-8">
|
||||
<FiltersIcon />
|
||||
</div>
|
||||
{searchFiltersLabel}
|
||||
</button>
|
||||
|
||||
{#if suggestions.suggestions.length > 0}
|
||||
<ul
|
||||
class="dropdown-content menu z-10 p-2 shadow-xl bg-base-200 rounded-box"
|
||||
>
|
||||
{#each suggestions.suggestions as suggestion}
|
||||
<li class="p-1">
|
||||
<button
|
||||
type="button"
|
||||
on:click={async (e) => {
|
||||
await suggestionClicked(e.currentTarget.innerText);
|
||||
}}>{@html suggestion}</button
|
||||
>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
</form>
|
||||
</search>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -207,6 +212,7 @@
|
||||
{#if !isLoading && videos.length > 0 && searchBoxText}
|
||||
<div class="flex justify-center items-center">
|
||||
<button
|
||||
type="button"
|
||||
class="btn w-1/2"
|
||||
on:click={async () => {
|
||||
page++;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { playletStateStore, translate } from "lib/Stores";
|
||||
import VideoStartAt from "./VideoStartAt.svelte";
|
||||
import VideoThumbnail from "./VideoThumbnail.svelte";
|
||||
import { YoutubeJs } from "lib/Api/YoutubeJs";
|
||||
|
||||
export let videoId: string | undefined = undefined;
|
||||
export let title: string | undefined = undefined;
|
||||
@@ -42,11 +43,28 @@
|
||||
});
|
||||
|
||||
async function playOnTv() {
|
||||
await PlayletApi.playVideo(getVideoInfo());
|
||||
const videoInfo = getVideoInfo();
|
||||
await PlayletApi.playVideo(videoInfo);
|
||||
}
|
||||
|
||||
async function playOnTvYtjs() {
|
||||
const videoInfo = getVideoInfo() as any;
|
||||
|
||||
// measure length of time it takes to get video info
|
||||
const start = performance.now();
|
||||
const metadata = await YoutubeJs.getVideoInfo(videoId);
|
||||
const end = performance.now();
|
||||
console.log(`Time to get video info: ${end - start}ms`);
|
||||
|
||||
if (metadata) {
|
||||
videoInfo.metadata = metadata;
|
||||
}
|
||||
await PlayletApi.playVideo(videoInfo);
|
||||
}
|
||||
|
||||
async function queueOnTv() {
|
||||
await PlayletApi.queueVideo(getVideoInfo());
|
||||
const videoInfo = getVideoInfo();
|
||||
await PlayletApi.queueVideo(videoInfo);
|
||||
}
|
||||
|
||||
function openInvidious() {
|
||||
@@ -121,6 +139,9 @@
|
||||
<button class="btn join-item hover:btn-accent" on:click={playOnTv}>
|
||||
{$translate("Play on %1").replace("%1", tvName)}
|
||||
</button>
|
||||
<button class="btn join-item hover:btn-accent" on:click={playOnTvYtjs}>
|
||||
{$translate("Play on %1").replace("%1", tvName)} (ytjs)
|
||||
</button>
|
||||
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
|
||||
{$translate("Queue on %1").replace("%1", tvName)}
|
||||
</button>
|
||||
|
||||
@@ -30,6 +30,11 @@ const { execSync } = require('child_process');
|
||||
// Create a temporary directory
|
||||
const tempDir = fs.mkdtempSync('squash-fs-');
|
||||
|
||||
// delete existing out file
|
||||
if (fs.existsSync(outFile)) {
|
||||
fs.unlinkSync(outFile);
|
||||
}
|
||||
|
||||
// Unzip the file
|
||||
execSync(`unzip ${inFile} -d ${tempDir}`);
|
||||
|
||||
|
||||
Reference in new issue
Block a user