Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c513afafd | ||
|
|
8e156b27f9 | ||
|
|
58e2b48409 | ||
|
|
06326d084e | ||
|
|
0b5bed45cf | ||
|
|
957ac66d70 | ||
|
|
03679b781c | ||
|
|
002307c45b | ||
|
|
fcfda78f2c | ||
|
|
384f41ba99 | ||
|
|
e070fc2df1 | ||
|
|
51d63d2019 | ||
|
|
1eeaced04b | ||
|
|
891a5f8405 | ||
|
|
7ab98024c1 | ||
|
|
c2b6b75f94 | ||
|
|
2e09239123 | ||
|
|
fcae05a0da | ||
|
|
0bc5ab6117 | ||
|
|
cfd6bc8ec8 | ||
|
|
47896ae9dc | ||
|
|
9e3da6b67d | ||
|
|
4c94db2c03 | ||
|
|
8ff4847977 | ||
|
|
65a4a855a1 | ||
|
|
40e7014e55 | ||
|
|
d5f74d41c0 | ||
|
|
91081e09d5 | ||
|
|
e7fbe5c189 | ||
|
|
0151f4c81c | ||
|
|
e28c92c3d4 |
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
|
||||
|
||||
+31
-1
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.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
|
||||
|
||||
- German translations
|
||||
- Support for multi-accounts, such as brand accounts
|
||||
- Support for manual skip in SponsorBlock
|
||||
- Customize SponsorBlock categories from the settings
|
||||
|
||||
### Fixed
|
||||
|
||||
- Show videos watch progress in playlist view
|
||||
- Missing localization in certain views
|
||||
|
||||
## [0.39.1] - 2025-05-23
|
||||
|
||||
### Fixed
|
||||
@@ -754,7 +784,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Removed
|
||||
|
||||
- Xmas theme logo - can't publish it before end of year... ([link](https://blog.roku.com/developer/channel-store-blackouts-2023))
|
||||
- Xmas theme logo - can't publish it before end of year... ([channel-store-blackouts-2023](https://blog.roku.com/developer/channel-store-blackouts-2023))
|
||||
|
||||
## [0.17.3] - 2023-12-13
|
||||
|
||||
|
||||
Generated
+55
-46
@@ -1,22 +1,22 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"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.18",
|
||||
"@types/node": "^22.15.30",
|
||||
"@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",
|
||||
@@ -26,9 +26,9 @@
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.7.2",
|
||||
"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.40.2"
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.42.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@@ -438,9 +438,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 +597,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.40.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.2.tgz",
|
||||
"integrity": "sha512-lG7Xa+BmBNwpjmVUbmyKxdQJ3Q6whHjMjzQplOs5Z+Gj7mxPtWakGHqzMqNER68G67kmCX9qX57aRsW5V0VOng==",
|
||||
"version": "4.42.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.42.0.tgz",
|
||||
"integrity": "sha512-Gfm6cV6mj3hCUY8TqWa63DB8Mx3NADoFwiJrMpoZ1uESbK8FQV3LXkhfry+8bOniq9pqY1OdsjFWNsSbfjPugw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -760,9 +760,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.15.18",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.18.tgz",
|
||||
"integrity": "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg==",
|
||||
"version": "22.15.30",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz",
|
||||
"integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1360,13 +1360,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 +1402,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 +1434,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",
|
||||
@@ -2821,6 +2821,7 @@
|
||||
"resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-2.2.0.tgz",
|
||||
"integrity": "sha512-EuJWwlHPZ1LbADuKTClvHtwbaFn4rOD+dRAbWysqEOXRc2Uui0hJInNJrsdH0c+OhJA4nrCBdSkW4DD5YxAo6A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
@@ -3918,6 +3919,7 @@
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
@@ -4315,13 +4317,15 @@
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/libbase64/-/libbase64-1.3.0.tgz",
|
||||
"integrity": "sha512-GgOXd0Eo6phYgh0DJtjQ2tO8dc0IVINtZJeARPeiIJqge+HdsWSuaDTe8ztQ7j/cONByDZ3zeB325AHiv5O0dg==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/libmime": {
|
||||
"version": "5.3.6",
|
||||
"resolved": "https://registry.npmjs.org/libmime/-/libmime-5.3.6.tgz",
|
||||
"integrity": "sha512-j9mBC7eiqi6fgBPAGvKCXJKJSIASanYF4EeA4iBzSG0HxQxmXnR3KbyWqTn4CwsKSebqCv2f5XZfAO6sKzgvwA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encoding-japanese": "2.2.0",
|
||||
"iconv-lite": "0.6.3",
|
||||
@@ -4333,7 +4337,8 @@
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/libqp/-/libqp-2.1.1.tgz",
|
||||
"integrity": "sha512-0Wd+GPz1O134cP62YU2GTOPNA7Qgl09XwCqM5zpBv87ERCXdfDtyKXvV7c9U22yWJh44QZqBocFnXN11K96qow==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lie": {
|
||||
"version": "3.3.0",
|
||||
@@ -4425,10 +4430,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mailparser": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.7.2.tgz",
|
||||
"integrity": "sha512-iI0p2TCcIodR1qGiRoDBBwboSSff50vQAWytM5JRggLfABa4hHYCf3YVujtuzV454xrOP352VsAPIzviqMTo4Q==",
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.7.3.tgz",
|
||||
"integrity": "sha512-0RM14cZF0gO1y2Q/82hhWranispZOUSYHwvQ21h12x90NwD6+D5q59S5nOLqCtCdYitHN58LJXWEHa4RWm7BYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encoding-japanese": "2.2.0",
|
||||
"he": "1.2.0",
|
||||
@@ -4436,17 +4442,18 @@
|
||||
"iconv-lite": "0.6.3",
|
||||
"libmime": "5.3.6",
|
||||
"linkify-it": "5.0.0",
|
||||
"mailsplit": "5.4.2",
|
||||
"nodemailer": "6.9.16",
|
||||
"mailsplit": "5.4.3",
|
||||
"nodemailer": "7.0.3",
|
||||
"punycode.js": "2.3.1",
|
||||
"tlds": "1.255.0"
|
||||
"tlds": "1.259.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mailsplit": {
|
||||
"version": "5.4.2",
|
||||
"resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.4.2.tgz",
|
||||
"integrity": "sha512-4cczG/3Iu3pyl8JgQ76dKkisurZTmxMrA4dj/e8d2jKYcFTZ7MxOzg1gTioTDMPuFXwTrVuN/gxhkrO7wLg7qA==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.4.3.tgz",
|
||||
"integrity": "sha512-PFV0BBh4Tv7Omui5FtXXVtN4ExAxIi8Yvmb9JgBz+J6Hnnrv/YYXLlKKudLhXwd3/qWEATOslRsnzVCWDeCnmQ==",
|
||||
"dev": true,
|
||||
"license": "(MIT OR EUPL-1.1+)",
|
||||
"dependencies": {
|
||||
"libbase64": "1.3.0",
|
||||
"libmime": "5.3.6",
|
||||
@@ -4778,10 +4785,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nodemailer": {
|
||||
"version": "6.9.16",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz",
|
||||
"integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ==",
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.3.tgz",
|
||||
"integrity": "sha512-Ajq6Sz1x7cIK3pN6KesGTah+1gnwMnx5gKl3piQlQQE/PwyJ4Mbc8is2psWYxK3RJTVeqsDaCv8ZzXLCDHMTZw==",
|
||||
"dev": true,
|
||||
"license": "MIT-0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@@ -6212,9 +6220,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": {
|
||||
@@ -7324,10 +7332,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tlds": {
|
||||
"version": "1.255.0",
|
||||
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.255.0.tgz",
|
||||
"integrity": "sha512-tcwMRIioTcF/FcxLev8MJWxCp+GUALRhFEqbDoZrnowmKSGqPrl5pqS+Sut2m8BgJ6S4FExCSSpGffZ0Tks6Aw==",
|
||||
"version": "1.259.0",
|
||||
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.259.0.tgz",
|
||||
"integrity": "sha512-AldGGlDP0PNgwppe2quAvuBl18UcjuNtOnDuUkqhd6ipPqrYYBt3aTxK1QTsBVknk97lS2JcafWMghjGWFtunw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"tlds": "bin.js"
|
||||
}
|
||||
|
||||
+10
-11
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"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.18",
|
||||
"@types/node": "^22.15.30",
|
||||
"@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",
|
||||
@@ -20,9 +20,9 @@
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.7.2",
|
||||
"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",
|
||||
@@ -47,8 +47,8 @@
|
||||
"build:lib:dev": "cd playlet-lib && npm run build:dev",
|
||||
"build:lib:prod": "cd playlet-lib && npm run build:prod",
|
||||
"build:web": "cd playlet-web && npm run build",
|
||||
"lint": "cd playlet-lib && npm run lint && cd ../playlet-app && npm run lint",
|
||||
"lint:fix": "cd playlet-lib && npm run lint:fix && cd ../playlet-app && npm run lint:fix",
|
||||
"lint": "cd playlet-lib && npm run lint && cd ../playlet-app && npm run lint && cd ../playlet-web && npm run lint",
|
||||
"lint:fix": "cd playlet-lib && npm run lint:fix && cd ../playlet-app && npm run lint:fix && cd ../playlet-web && npm run lint",
|
||||
"format": "cd playlet-lib && npm run format && cd ../playlet-app && npm run format",
|
||||
"format:fix": "cd playlet-lib && npm run format:fix && cd ../playlet-app && npm run format:fix",
|
||||
"test": "npm run test:lib && npm run test:app",
|
||||
@@ -62,7 +62,6 @@
|
||||
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
|
||||
"sign-released-package": "node tools/sign-released-package.js",
|
||||
"screenshot": "node tools/screenshot.js",
|
||||
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
||||
"convert-images": "node tools/convert-images.js",
|
||||
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
||||
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
||||
@@ -75,6 +74,6 @@
|
||||
"shutdown": "node tools/shutdown.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.40.2"
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.42.0"
|
||||
}
|
||||
}
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.39.1"
|
||||
"version": "0.40.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-app",
|
||||
|
||||
@@ -2,7 +2,7 @@ title=Playlet
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=39
|
||||
minor_version=40
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.39.1"
|
||||
"version": "0.40.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf ../build/playlet-lib",
|
||||
|
||||
@@ -17,6 +17,7 @@ function FetchSubscriptionStatusTask(input as object) as object
|
||||
subscriptionStatus = InnertubeService.GetSubscriptionStatusForChannel(ucid, {
|
||||
cancellation: m.top.cancellation
|
||||
accessToken: authToken.token
|
||||
onBehalfOfUser: authToken.activeIdentifyToken
|
||||
})
|
||||
|
||||
if subscriptionStatus.error <> invalid
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<field id="accessToken" type="string" />
|
||||
|
||||
<!-- Innertube fields -->
|
||||
<field id="activeIdentifyToken" type="string" />
|
||||
<field id="thumbnail" type="uri" />
|
||||
<field id="refreshToken" type="string" />
|
||||
<field id="scope" type="string" />
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
showDivider="false">
|
||||
<Label
|
||||
id="scanLabel"
|
||||
text="Scan the QR Code"
|
||||
text="Scan the QR code"
|
||||
horizAlign="center"
|
||||
wrap="true" width="400">
|
||||
<Font role="font" uri="font:SystemFontFile" size="24" />
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
namespace YouTubeLoginAccountItemUtils
|
||||
|
||||
function CreateProfileContentNode(accountItem as object, accessToken as object) as object
|
||||
profile = CreateObject("roSGNode", "ProfileContentNode")
|
||||
profile.type = "youtube"
|
||||
profile.serverUrl = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
username = accountItem.channelHandle
|
||||
if StringUtils.IsNullOrEmpty(username)
|
||||
username = accountItem.accountByline
|
||||
end if
|
||||
profile.username = username
|
||||
profile.activeIdentifyToken = accountItem.activeIdentifyToken
|
||||
profile.thumbnail = accountItem.accountPhoto
|
||||
profile.accessToken = accessToken.accessToken
|
||||
profile.refreshToken = accessToken.refreshToken
|
||||
profile.scope = accessToken.scope
|
||||
profile.tokenType = accessToken.tokenType
|
||||
profile.expiresIn = accessToken.expiresIn
|
||||
profile.expiresTimestamp = accessToken.expiresTimestamp
|
||||
profile.clientId = accessToken.clientId
|
||||
profile.clientSecret = accessToken.clientSecret
|
||||
|
||||
return profile
|
||||
end function
|
||||
end namespace
|
||||
@@ -1,6 +1,10 @@
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/Screens/ProfileScreen/YouTubeAccountSelectionView/YouTubeAccountSelectionViewUtils.bs"
|
||||
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/source/utils/Locale.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
@@ -19,15 +23,56 @@ function Init()
|
||||
m.top.observeFieldScoped("buttonSelected", FuncName(Close))
|
||||
m.top.observeFieldScoped("wasClosed", FuncName(OnWasClosed))
|
||||
scanLabel = m.top.findNode("scanLabel")
|
||||
' TODO:P2 localize all dialog items
|
||||
scanLabel.text = Tr(Locale.Dialogs.ScanTheQrCode)
|
||||
linkInstructionLabel = m.top.findNode("linkInstructionLabel")
|
||||
linkInstructionLabel.text = Tr(Locale.Dialogs.OpenLinkAndEnterFollowingCode).replace("%1", `'https://yt.be/activate'`)
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
m.task = AsyncTask.Start(Tasks.YouTubeLoginTask, {
|
||||
dialog: m.top
|
||||
profilesService: m.top.profilesService
|
||||
})
|
||||
}, OnYouTubeLoginTaskResult)
|
||||
end function
|
||||
|
||||
function OnYouTubeLoginTaskResult(output as object) as void
|
||||
m.task = invalid
|
||||
|
||||
if output.cancelled
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
if not output.success or not output.result.success
|
||||
' output.error for unhandled exception
|
||||
error = output.error
|
||||
if error = invalid
|
||||
' output.result.error for network errors
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
LogError(error)
|
||||
DialogUtils.ShowDialogEx({
|
||||
message: error
|
||||
title: Tr(Locale.Generic.Error)
|
||||
large: true
|
||||
})
|
||||
return
|
||||
end if
|
||||
|
||||
accounts = output.result.accounts
|
||||
accessToken = output.result.accessToken
|
||||
' if accounts is invalid, we're going to assume a profile is already created.
|
||||
if accounts = invalid or accessToken = invalid
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
' The accountSelectionView will take over the creation of the profile.
|
||||
accountSelectionView = YouTubeAccountSelectionViewUtils.Open(m.top.appController)
|
||||
accountSelectionView.accessToken = accessToken
|
||||
accountSelectionView.accounts = accounts
|
||||
Close()
|
||||
end function
|
||||
|
||||
function OnCodeSet(event as object)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<component name="YouTubeLoginDialog" extends="StandardDialog" initialFocus="buttonArea" includes="AutoBind">
|
||||
<interface>
|
||||
<field id="profilesService" type="node" bind="/ProfilesService" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="code" type="string" alias="codeLabel.text" />
|
||||
<field id="url" type="string" onChange="OnUrlSet" />
|
||||
<field id="alwaysOnTop" type="boolean" />
|
||||
@@ -10,7 +11,8 @@
|
||||
|
||||
<StdDlgTitleArea primaryTitle="Login to YouTube" />
|
||||
<StdDlgContentArea>
|
||||
<StdDlgTextItem text="Open the link 'https://yt.be/activate' and enter the following code:" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<StdDlgTextItem id="linkInstructionLabel" text="Open the link 'https://yt.be/activate' and enter the following code:" />
|
||||
<StdDlgTextItem id="codeLabel" text="Loading..." />
|
||||
</StdDlgContentArea>
|
||||
<StdDlgButtonArea id="buttonArea">
|
||||
@@ -24,7 +26,7 @@
|
||||
showDivider="false">
|
||||
<Label
|
||||
id="scanLabel"
|
||||
text="Scan the QR Code"
|
||||
text="Scan the QR code"
|
||||
horizAlign="center"
|
||||
wrap="true" width="400">
|
||||
<Font role="font" uri="font:SystemFontFile" size="24" />
|
||||
@@ -37,11 +39,11 @@
|
||||
loadHeight="300"
|
||||
padding="10"
|
||||
translation="[50, 50]" />
|
||||
<Label
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="https://yt.be/activate"
|
||||
horizAlign="center"
|
||||
width="400"
|
||||
translation="[0, 380]"
|
||||
text="https://yt.be/activate">
|
||||
translation="[0, 380]">
|
||||
<Font role="font" uri="font:MediumSystemFontFile" size="18" />
|
||||
</Label>
|
||||
</StdDlgSideCardArea>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/Dialog/YouTubeLoginAccountItemUtils.bs"
|
||||
import "pkg:/components/Services/Innertube/InnertubeService.bs"
|
||||
import "pkg:/source/utils/CancellationUtils.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
@@ -17,13 +18,10 @@ function YouTubeLoginTask(input as object) as object
|
||||
end if
|
||||
|
||||
if authCode.error <> invalid
|
||||
LogError(authCode.error)
|
||||
DialogUtils.ShowDialogEx({
|
||||
title: "Error"
|
||||
message: authCode.error
|
||||
large: true
|
||||
})
|
||||
return invalid
|
||||
return {
|
||||
success: false
|
||||
error: authCode.error
|
||||
}
|
||||
end if
|
||||
|
||||
url = InnertubeService.AuthGetActivationUrl(authCode)
|
||||
@@ -40,13 +38,10 @@ function YouTubeLoginTask(input as object) as object
|
||||
end if
|
||||
|
||||
if accessToken.error <> invalid
|
||||
LogError(accessToken.error)
|
||||
DialogUtils.ShowDialogEx({
|
||||
title: "Error"
|
||||
message: accessToken.error
|
||||
large: true
|
||||
})
|
||||
return invalid
|
||||
return {
|
||||
success: false
|
||||
error: accessToken.error
|
||||
}
|
||||
end if
|
||||
|
||||
accounts = InnertubeService.AuthListAccounts(accessToken.accessToken, cancellation)
|
||||
@@ -56,63 +51,33 @@ function YouTubeLoginTask(input as object) as object
|
||||
end if
|
||||
|
||||
if IsAssociativeArray(accounts) and accounts.error <> invalid
|
||||
LogError(accounts.error)
|
||||
DialogUtils.ShowDialogEx({
|
||||
title: "Error"
|
||||
message: accounts.error
|
||||
large: true
|
||||
})
|
||||
return invalid
|
||||
return {
|
||||
success: false
|
||||
error: accounts.error
|
||||
}
|
||||
end if
|
||||
|
||||
if not IsArray(accounts) or accounts.Count() = 0
|
||||
LogError("No accounts found")
|
||||
DialogUtils.ShowDialogEx({
|
||||
title: "Error"
|
||||
message: "No accounts found"
|
||||
large: true
|
||||
})
|
||||
return invalid
|
||||
return {
|
||||
success: false
|
||||
error: Tr(Locale.Dialogs.NoValidAccountsFound)
|
||||
}
|
||||
end if
|
||||
|
||||
selectedAccount = invalid
|
||||
for each account in accounts
|
||||
if ValidBool(account.isSelected)
|
||||
selectedAccount = account
|
||||
exit for
|
||||
end if
|
||||
end for
|
||||
' If there is only one account, we can skip the selection screen
|
||||
' and just create a profile
|
||||
if accounts.Count() = 1
|
||||
profile = YouTubeLoginAccountItemUtils.CreateProfileContentNode(accounts[0], accessToken)
|
||||
profilesNode@.LoginWithProfile(profile)
|
||||
|
||||
if selectedAccount = invalid
|
||||
selectedAccount = accounts[0]
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
end if
|
||||
|
||||
profile = CreateProfileContentNode(selectedAccount, accessToken)
|
||||
profilesNode@.LoginWithProfile(profile)
|
||||
|
||||
dialogNode.close = true
|
||||
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function CreateProfileContentNode(account as object, accessToken as object) as object
|
||||
profile = CreateObject("roSGNode", "ProfileContentNode")
|
||||
profile.type = "youtube"
|
||||
profile.serverUrl = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
username = account.channelHandle
|
||||
if StringUtils.IsNullOrEmpty(username)
|
||||
username = account.accountByline
|
||||
end if
|
||||
profile.username = username
|
||||
profile.thumbnail = account.accountPhoto
|
||||
profile.accessToken = accessToken.accessToken
|
||||
profile.refreshToken = accessToken.refreshToken
|
||||
profile.scope = accessToken.scope
|
||||
profile.tokenType = accessToken.tokenType
|
||||
profile.expiresIn = accessToken.expiresIn
|
||||
profile.expiresTimestamp = accessToken.expiresTimestamp
|
||||
profile.clientId = accessToken.clientId
|
||||
profile.clientSecret = accessToken.clientSecret
|
||||
|
||||
return profile
|
||||
return {
|
||||
success: true
|
||||
accounts: accounts
|
||||
accessToken: accessToken
|
||||
}
|
||||
end function
|
||||
@@ -42,8 +42,7 @@
|
||||
<AppVersionLabel
|
||||
fontUri="font:BoldSystemFontFile"
|
||||
fontSize="16"
|
||||
translation="[0, 48]"
|
||||
/>
|
||||
translation="[0, 48]" />
|
||||
</Poster>
|
||||
|
||||
<MarkupList
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import "pkg:/source/utils/MathUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/TimeUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
@@ -5,6 +6,7 @@ import "pkg:/source/utils/Types.bs"
|
||||
function Init()
|
||||
m.durationRect = m.top.FindNode("durationRect")
|
||||
m.durationLabel = m.top.FindNode("durationLabel")
|
||||
m.progressRect = m.top.FindNode("progressRect")
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
@@ -35,6 +37,8 @@ function OnContentSet() as void
|
||||
|
||||
m.top.thumbnailUri = content.thumbnail
|
||||
|
||||
m.top.percentDurationWatched = content.percentDurationWatched
|
||||
|
||||
SetDurationText(content.lengthText)
|
||||
end function
|
||||
|
||||
@@ -60,3 +64,12 @@ function SetDurationText(text as string) as void
|
||||
rect.width = size.width + 16
|
||||
rect.translation = [rectParent.width - rect.width, rect.translation[1]]
|
||||
end function
|
||||
|
||||
function OnPercentDurationWatched() as void
|
||||
if m.progressRect = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
percent = MathUtils.Clamp(m.top.percentDurationWatched, 0, 100) / 100.0
|
||||
m.progressRect.scale = [percent, 1]
|
||||
end function
|
||||
@@ -6,6 +6,7 @@
|
||||
<field id="thumbnailUri" type="uri" alias="thumbnailPoster.uri" />
|
||||
<field id="duration" type="string" alias="durationLabel.text" />
|
||||
<field id="durationRectVisible" type="boolean" alias="durationRect.visible" />
|
||||
<field id="percentDurationWatched" type="float" onChange="OnPercentDurationWatched" />
|
||||
</interface>
|
||||
<children>
|
||||
<Poster
|
||||
@@ -29,6 +30,14 @@
|
||||
font="font:SmallestSystemFont"
|
||||
translation="[8, 0]" />
|
||||
</Rectangle>
|
||||
<Rectangle
|
||||
id="progressRect"
|
||||
width="190"
|
||||
height="5"
|
||||
color="#FF0000"
|
||||
translation="[0, 102]"
|
||||
scale="[0, 1]">
|
||||
</Rectangle>
|
||||
|
||||
</Poster>
|
||||
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
showRowLabel="[true]"
|
||||
rowFocusAnimationStyle="floatingfocus"
|
||||
variableWidthItems="true"
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
|
||||
/>
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
||||
</Group>
|
||||
</children>
|
||||
</component>
|
||||
+2
@@ -36,7 +36,9 @@
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png">
|
||||
<ContentNode role="content">
|
||||
<ContentNode>
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<BackendTypeContentNode id="BackendTypeYouTube" title="YouTube" backendLogoUri="pkg:/images/youtube-logo.png" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<BackendTypeContentNode id="BackendTypeInvidious" title="Invidious" backendLogoUri="pkg:/images/invidious-logo.png" />
|
||||
</ContentNode>
|
||||
</ContentNode>
|
||||
|
||||
+1
-2
@@ -65,8 +65,7 @@
|
||||
id="backendTypePoster"
|
||||
width="60"
|
||||
height="60"
|
||||
translation="[110,110]"
|
||||
/>
|
||||
translation="[110,110]" />
|
||||
</CirclePoster>
|
||||
<Poster
|
||||
id="CrownPoster"
|
||||
|
||||
@@ -81,13 +81,12 @@ function LoginWithInvidious() as void
|
||||
end function
|
||||
|
||||
function ShowLoginWithYouTubeDialog() as void
|
||||
' TODO:P2 localize
|
||||
dialog = DialogUtils.ShowDialogEx({
|
||||
title: "Disclaimer"
|
||||
title: Tr(Locale.Dialogs.Disclaimer)
|
||||
message: [
|
||||
"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."
|
||||
"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."
|
||||
"Use responsibly, especially if your YouTube account is tied to business or monetization."
|
||||
Tr(Locale.Dialogs.YouTubeLoginDisclaimer1)
|
||||
Tr(Locale.Dialogs.YouTubeLoginDisclaimer2)
|
||||
Tr(Locale.Dialogs.YouTubeLoginDisclaimer3)
|
||||
]
|
||||
large: true
|
||||
buttons: [
|
||||
|
||||
@@ -52,8 +52,7 @@
|
||||
id="backendTypePoster"
|
||||
width="60"
|
||||
height="60"
|
||||
translation="[110,110]"
|
||||
/>
|
||||
translation="[110,110]" />
|
||||
</CirclePoster>
|
||||
<Poster
|
||||
id="CrownPoster"
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function OnContentSet() as void
|
||||
content = m.top.itemContent
|
||||
if content = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
accountItem = content.accountItem
|
||||
if not IsAssociativeArray(accountItem)
|
||||
return
|
||||
end if
|
||||
|
||||
m.top.accountPhoto = accountItem.accountPhoto
|
||||
m.top.text1 = accountItem.accountName
|
||||
m.top.text2 = accountItem.channelHandle
|
||||
end function
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<component name="YouTubeAccountListItem" extends="Group">
|
||||
<interface>
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
|
||||
<field id="accountPhoto" type="uri" alias="accountPhoto.uri" />
|
||||
<field id="text1" type="string" alias="text1Label.text" />
|
||||
<field id="text2" type="string" alias="text2Label.text" />
|
||||
</interface>
|
||||
<children>
|
||||
<LayoutGroup layoutDirection="horiz" translation="[0, 2]" itemSpacings="[10]">
|
||||
<Poster
|
||||
width="64"
|
||||
height="64"
|
||||
blendColor="#DDDDDDFF"
|
||||
uri="pkg:/images/white-circle.png">
|
||||
|
||||
<CirclePoster
|
||||
id="accountPhoto"
|
||||
width="60"
|
||||
height="60"
|
||||
translation="[2,2]"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
|
||||
</Poster>
|
||||
|
||||
<LayoutGroup layoutDirection="vert" translation="[8, 0]" itemSpacings="[10]">
|
||||
<Label id="text1Label" font="font:SmallestBoldSystemFont" />
|
||||
<Label id="text2Label" font="font:SmallestSystemFont" />
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
</children>
|
||||
</component>
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
import "pkg:/components/Dialog/YouTubeLoginAccountItemUtils.bs"
|
||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Locale.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/RemoteKeys.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.accountList = m.top.FindNode("accountList")
|
||||
m.accountList.ObserveField("itemSelected", FuncName(OnAccountSelected))
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.accountList, true)
|
||||
end function
|
||||
|
||||
function OnKeyEvent(key as string, press as boolean) as boolean
|
||||
if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = RemoteKeys.Back and press
|
||||
Close()
|
||||
return true
|
||||
end if
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
function Close()
|
||||
m.top.appController@.PopScreen()
|
||||
end function
|
||||
|
||||
function OnAccountsChanged() as void
|
||||
accounts = m.top.accounts
|
||||
if not IsArray(accounts) or accounts.Count() = 0
|
||||
m.accountList.content = invalid
|
||||
LogError(Tr(Locale.Dialogs.NoValidAccountsFound))
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
content = CreateObject("roSGNode", "ContentNode")
|
||||
accountNodes = []
|
||||
for each accountItem in accounts
|
||||
if not IsAssociativeArray(accountItem)
|
||||
continue for
|
||||
end if
|
||||
|
||||
accountNode = CreateObject("roSGNode", "ContentNode")
|
||||
accountNode.addField("accountItem", "assocarray", false)
|
||||
accountNode.accountItem = accountItem
|
||||
accountNodes.Push(accountNode)
|
||||
end for
|
||||
|
||||
if accountNodes.Count() = 0
|
||||
m.accountList.content = invalid
|
||||
LogError(Tr(Locale.Dialogs.NoValidAccountsFound))
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
content.appendChildren(accountNodes)
|
||||
m.accountList.content = content
|
||||
end function
|
||||
|
||||
function OnAccountSelected(event as object) as void
|
||||
itemSelected = m.accountList.itemSelected
|
||||
itemNode = m.accountList.content.GetChild(itemSelected)
|
||||
if itemNode = invalid
|
||||
LogError("Invalid item selected:", itemSelected)
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
accountItem = itemNode.accountItem
|
||||
if not IsAssociativeArray(accountItem)
|
||||
LogError("Invalid account item selected:", accountItem)
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
accessToken = m.top.accessToken
|
||||
if accessToken = invalid or not IsAssociativeArray(accessToken)
|
||||
LogError("No valid access token available for YouTube login.")
|
||||
Close()
|
||||
return
|
||||
end if
|
||||
|
||||
profileNode = YouTubeLoginAccountItemUtils.CreateProfileContentNode(accountItem, accessToken)
|
||||
m.top.profilesService@.LoginWithProfile(profileNode)
|
||||
|
||||
Close()
|
||||
end function
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<component name="YouTubeAccountSelectionView" extends="Group" includes="AutoBind,Focus">
|
||||
<interface>
|
||||
<field id="accessToken" type="assocarray" />
|
||||
<field id="accounts" type="array" onChange="OnAccountsChanged" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="profilesService" type="node" bind="/ProfilesService" />
|
||||
</interface>
|
||||
<children>
|
||||
<Rectangle
|
||||
width="1280"
|
||||
height="720"
|
||||
color="#000000"
|
||||
opacity="0.5">
|
||||
</Rectangle>
|
||||
|
||||
<Rectangle
|
||||
width="720"
|
||||
height="520"
|
||||
translation="[280,100]"
|
||||
color="#242424">
|
||||
<Label
|
||||
width="720"
|
||||
horizAlign="center"
|
||||
translation="[0,45]"
|
||||
text="Who's watching?">
|
||||
<Font role="font" uri="font:SystemFontFile" size="24" />
|
||||
</Label>
|
||||
|
||||
<MarkupGrid
|
||||
id="accountList"
|
||||
itemComponentName="YouTubeAccountListItem"
|
||||
itemSize="[640,70]"
|
||||
itemSpacing="[0,20]"
|
||||
numColumns="1"
|
||||
numRows="4"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
translation="[40,120]"
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-27.9.png" />
|
||||
</Rectangle>
|
||||
</children>
|
||||
</component>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
namespace YouTubeAccountSelectionViewUtils
|
||||
|
||||
function Open(appController as object) as object
|
||||
youTubeAccountSelectionView = CreateObject("roSGNode", "YouTubeAccountSelectionView")
|
||||
|
||||
appController@.PushScreen(youTubeAccountSelectionView)
|
||||
youTubeAccountSelectionView@.BindNode()
|
||||
return youTubeAccountSelectionView
|
||||
end function
|
||||
|
||||
end namespace
|
||||
@@ -16,8 +16,7 @@
|
||||
vertAlign="center"
|
||||
text="Could not get IP address: are we connected to the internet?"
|
||||
wrap="true"
|
||||
translation="[145,0]"
|
||||
/>
|
||||
translation="[145,0]" />
|
||||
</Group>
|
||||
<Group id="yesInternet" visible="false">
|
||||
<LayoutGroup
|
||||
@@ -83,9 +82,9 @@
|
||||
vertAlignment="center"
|
||||
translation="[0,245]">
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="1." />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="1."
|
||||
font="font:SmallSystemFont" />
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
width="380"
|
||||
@@ -93,9 +92,9 @@
|
||||
text="On your phone, connect to the same Wi-Fi network as this device." />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="2." />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="2."
|
||||
font="font:SmallSystemFont" />
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
width="380"
|
||||
@@ -103,14 +102,14 @@
|
||||
text="Open the YouTube app on your phone." />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="3." />
|
||||
<MultiStyleLabel
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="3."
|
||||
font="font:SmallSystemFont" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<MultiStyleLabel text="Tap the cast icon and select this device."
|
||||
id="WifiInstructionWithDeviceNameLabel"
|
||||
width="380"
|
||||
wrap="true"
|
||||
text="Tap the cast icon and select this device." />
|
||||
wrap="true" />
|
||||
</LayoutGroup>
|
||||
<Label
|
||||
text="Roku connected to:"
|
||||
@@ -131,9 +130,9 @@
|
||||
vertAlignment="center"
|
||||
translation="[0,245]">
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="1." />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="1."
|
||||
font="font:SmallSystemFont" />
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
width="380"
|
||||
@@ -141,9 +140,9 @@
|
||||
text="On your phone, open the YouTube app." />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="2." />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="2."
|
||||
font="font:SmallSystemFont" />
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
width="380"
|
||||
@@ -151,9 +150,9 @@
|
||||
text="Tap the cast icon." />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
text="3." />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Label text="3."
|
||||
font="font:SmallSystemFont" />
|
||||
<Label
|
||||
font="font:SmallSystemFont"
|
||||
width="380"
|
||||
|
||||
@@ -18,16 +18,14 @@
|
||||
|
||||
<DynamicMiniKeyboard
|
||||
id="keyboard"
|
||||
translation="[695,110]"
|
||||
/>
|
||||
translation="[695,110]" />
|
||||
<ButtonGroup
|
||||
id="suggestions"
|
||||
focusable="false"
|
||||
minWidth="400"
|
||||
maxWidth="480"
|
||||
buttonHeight="50"
|
||||
translation="[125,100]"
|
||||
/>
|
||||
translation="[125,100]" />
|
||||
<VideoRowList
|
||||
itemComponentName="RowCell"
|
||||
id="rowList"
|
||||
@@ -43,8 +41,7 @@
|
||||
showRowLabel="[true]"
|
||||
rowFocusAnimationStyle="floatingfocus"
|
||||
variableWidthItems="true"
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
|
||||
/>
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
||||
<Animation
|
||||
id="scrollAnimation"
|
||||
duration="0.3">
|
||||
|
||||
+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`
|
||||
|
||||
-2
@@ -24,8 +24,6 @@ end function
|
||||
|
||||
function PrepareTests() as object
|
||||
content = CreateObject("roSGNode", "ContentNode")
|
||||
' TODO:P2 test if video data is reachable (head?)
|
||||
' TODO:P2 test if video data is reachable in proxy mode (local=true)
|
||||
content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.ValidUrl), IsValidUrl))
|
||||
content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.InstanceReachable), IsReachable))
|
||||
content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.FetchVideoDetails), CanFetchVideoDetails))
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
translation="[380,96]" />
|
||||
<Label
|
||||
id="failedLabel"
|
||||
text="Failed to load Invidious public instances."
|
||||
text="Failed to load Invidious public instances"
|
||||
horizAlign="center"
|
||||
translation="[0,60]"
|
||||
width="960" />
|
||||
|
||||
@@ -16,29 +16,29 @@
|
||||
<Font role="font" uri="font:SystemFontFile" size="18" />
|
||||
</Label>
|
||||
<LayoutGroup layoutDirection="horiz">
|
||||
<Button
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Button text="-"
|
||||
id="MinusButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="64"
|
||||
maxWidth="64"
|
||||
showFocusFootprint="true"
|
||||
text="-" />
|
||||
<Button
|
||||
showFocusFootprint="true" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Button text="0"
|
||||
id="NumberButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="150"
|
||||
showFocusFootprint="true"
|
||||
text="0" />
|
||||
<Button
|
||||
showFocusFootprint="true" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<Button text="+"
|
||||
id="PlusButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="64"
|
||||
maxWidth="64"
|
||||
showFocusFootprint="true"
|
||||
text="+" />
|
||||
showFocusFootprint="true" />
|
||||
</LayoutGroup>
|
||||
</children>
|
||||
</component>
|
||||
@@ -23,11 +23,17 @@
|
||||
|
||||
<ContentNode role="content">
|
||||
<ContentNode id="auto" title="Auto" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="1080p" title="1080p" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="720p" title="720p" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="480p" title="480p" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="360p" title="360p" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="240p" title="240p" />
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<ContentNode id="144p" title="144p" />
|
||||
</ContentNode>
|
||||
</CheckList>
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Locale.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
m.top.itemSpacings = [8]
|
||||
|
||||
m.button = m.top.findNode("button")
|
||||
m.button.observeField("buttonSelected", FuncName(OpenSponsorBlockCategories))
|
||||
AdjustButtonLabel(m.button)
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.button, true)
|
||||
end function
|
||||
|
||||
function AdjustButtonLabel(button as object) as void
|
||||
children = button.getChildren(-1, 0)
|
||||
for each child in children
|
||||
if child.isSubtype("Label") and child.hasField("horizAlign")
|
||||
child.observeField("horizAlign", FuncName(OnButtonLabelHorizAlignChanged))
|
||||
child.horizAlign = "left"
|
||||
return
|
||||
end if
|
||||
end for
|
||||
end function
|
||||
|
||||
function OnButtonLabelHorizAlignChanged(event as object)
|
||||
label = event.getRoSGNode()
|
||||
if label.horizAlign <> "left"
|
||||
label.horizAlign = "left"
|
||||
end if
|
||||
end function
|
||||
|
||||
function BindPreference(preferences as object, key as string)
|
||||
if m.preferences <> invalid and m.key <> invalid
|
||||
m.preferences.unobserveFieldScoped(m.key)
|
||||
end if
|
||||
|
||||
m.preferences = preferences
|
||||
m.key = key
|
||||
|
||||
if preferences <> invalid and key <> invalid
|
||||
preferences.observeFieldScoped(key, FuncName(OnPreferenceChange))
|
||||
OnPreferenceChange()
|
||||
end if
|
||||
end function
|
||||
|
||||
function OpenSponsorBlockCategories()
|
||||
categoriesPrefs = CreateObject("roSGNode", "SponsorBlockCategoriesPreferences")
|
||||
m.appController@.PushScreen(categoriesPrefs)
|
||||
categoriesPrefs@.BindNode()
|
||||
categoriesPrefs.value = m.top.value
|
||||
categoriesPrefs.observeField("save", FuncName(OnSaveCategoriesPreferences))
|
||||
end function
|
||||
|
||||
function OnSaveCategoriesPreferences(event as object)
|
||||
categoriesPrefs = event.GetRoSGNode()
|
||||
m.top.value = categoriesPrefs.value
|
||||
end function
|
||||
|
||||
function OnPreferenceChange()
|
||||
m.top.value = m.preferences[m.key]
|
||||
end function
|
||||
|
||||
function OnValueChange() as void
|
||||
if m.preferences = invalid or m.key = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
m.preferences[m.key] = m.top.value
|
||||
end function
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<component name="SponsorBlockCategoriesControl" extends="LayoutGroup" includes="AutoBind,Focus">
|
||||
<interface>
|
||||
<field id="displayText" type="string" alias="Button.text" />
|
||||
<field id="description" type="string" alias="DescriptionLabel.text" />
|
||||
<field id="value" type="assocarray" onChange="OnValueChange" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<function name="BindPreference" />
|
||||
</interface>
|
||||
<children>
|
||||
<Button
|
||||
id="button"
|
||||
minWidth="300"
|
||||
showFocusFootprint="true" />
|
||||
<Label id="DescriptionLabel"
|
||||
width="450"
|
||||
color="0xb4b4b4ff"
|
||||
wrap="true">
|
||||
<Font role="font" uri="font:SystemFontFile" size="18" />
|
||||
</Label>
|
||||
</children>
|
||||
</component>
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs"
|
||||
import "pkg:/components/VideoPlayer/SponsorBlockSegmentAction.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/RemoteKeys.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.categoryList = m.top.findNode("categoryList")
|
||||
m.categoryList.ObserveField("itemSelected", FuncName(OnCategorySelected))
|
||||
m.service = new SponsorBlock.SponsorBlockService()
|
||||
|
||||
optionTitles = {}
|
||||
optionTitles[SponsorBlock.SegmentAction.Disable] = Tr(Locale.SponsorBlock.Disable)
|
||||
optionTitles[SponsorBlock.SegmentAction.AutoSkip] = Tr(Locale.SponsorBlock.AutoSkip)
|
||||
optionTitles[SponsorBlock.SegmentAction.ManualSkip] = Tr(Locale.SponsorBlock.ManualSkip)
|
||||
optionTitles[SponsorBlock.SegmentAction.ShowInSeekbar] = Tr(Locale.SponsorBlock.ShowInSeekbar)
|
||||
m.optionTitles = optionTitles
|
||||
|
||||
SetupCategoriesUi()
|
||||
|
||||
m.closeButton = m.top.findNode("closeButton")
|
||||
m.saveButton = m.top.findNode("saveButton")
|
||||
SetButtonPositions()
|
||||
|
||||
SetNavigation(m.saveButton, RemoteKeys.Right, m.closeButton)
|
||||
SetNavigation(m.closeButton, RemoteKeys.Left, m.saveButton)
|
||||
SetNavigation(m.saveButton, RemoteKeys.Up, m.categoryList)
|
||||
SetNavigation(m.closeButton, RemoteKeys.Up, m.categoryList)
|
||||
SetNavigation(m.categoryList, RemoteKeys.Down, m.saveButton)
|
||||
|
||||
m.saveButton.observeField("buttonSelected", FuncName(OnSaveButtonSelected))
|
||||
m.closeButton.observeField("buttonSelected", FuncName(Close))
|
||||
end function
|
||||
|
||||
function SetupCategoriesUi() as void
|
||||
categories = m.service.GetCategories()
|
||||
if categories.Count() = 0
|
||||
return
|
||||
end if
|
||||
|
||||
content = CreateObject("roSGNode", "ContentNode")
|
||||
categoryContentNodes = []
|
||||
|
||||
for each category in categories
|
||||
categoryNode = CreateObject("roSGNode", "SponsorBlockCategoryContent")
|
||||
categoryNode.category = category
|
||||
categoryNode.categoryTitle = Tr(m.service.SegmentTitle(category))
|
||||
categoryNode.selectedOption = SponsorBlock.SegmentAction.Disable
|
||||
categoryNode.options = m.service.GetOptionsForCategory(category)
|
||||
categoryNode.optionTitles = m.optionTitles
|
||||
categoryNode.color = m.service.SegmentColor(category)
|
||||
categoryContentNodes.push(categoryNode)
|
||||
end for
|
||||
|
||||
content.appendChildren(categoryContentNodes)
|
||||
m.categoryList.content = content
|
||||
end function
|
||||
|
||||
function SetButtonPositions()
|
||||
saveButtonWidth = m.saveButton.width
|
||||
closeButtonWidth = m.closeButton.width
|
||||
buttonsWith = closeButtonWidth + saveButtonWidth + 20
|
||||
m.saveButton.translation = [720 / 2 - buttonsWith / 2, m.saveButton.translation[1]]
|
||||
m.closeButton.translation = [720 / 2 + buttonsWith / 2 - closeButtonWidth, m.closeButton.translation[1]]
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.categoryList, true)
|
||||
end function
|
||||
|
||||
function OnKeyEvent(key as string, press as boolean) as boolean
|
||||
if NavigationKeyHandler(key, press).handled
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = RemoteKeys.Back and press
|
||||
Close()
|
||||
return true
|
||||
end if
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
function OnValueChange() as void
|
||||
content = m.categoryList.content
|
||||
if content = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
value = m.top.value
|
||||
if not IsAssociativeArray(value)
|
||||
return
|
||||
end if
|
||||
|
||||
categoryContentNodes = content.getChildren(-1, 0)
|
||||
categoryNodeMap = {}
|
||||
for each categoryContentNode in categoryContentNodes
|
||||
categoryNodeMap[categoryContentNode.category] = categoryContentNode
|
||||
end for
|
||||
|
||||
for each category in value
|
||||
if not categoryNodeMap.DoesExist(category)
|
||||
continue for
|
||||
end if
|
||||
categoryNode = categoryNodeMap[category]
|
||||
if categoryNode = invalid
|
||||
continue for
|
||||
end if
|
||||
categoryNode.selectedOption = value[category].option
|
||||
end for
|
||||
end function
|
||||
|
||||
function OnSaveButtonSelected()
|
||||
m.top.save = true
|
||||
Close()
|
||||
end function
|
||||
|
||||
function Close()
|
||||
m.appController@.PopScreen()
|
||||
end function
|
||||
|
||||
function OnCategorySelected(event as object) as void
|
||||
itemSelected = m.categoryList.itemSelected
|
||||
itemNode = m.categoryList.content.GetChild(itemSelected)
|
||||
if itemNode = invalid
|
||||
LogError("Invalid item selected:", itemSelected)
|
||||
return
|
||||
end if
|
||||
|
||||
options = itemNode.options
|
||||
optionTitles = itemNode.optionTitles
|
||||
optionTitlesArray = []
|
||||
for each option in options
|
||||
optionTitlesArray.push(optionTitles[option])
|
||||
end for
|
||||
|
||||
dialog = DialogUtils.ShowDialogEx({
|
||||
title: itemNode.categoryTitle
|
||||
message: Tr(Locale.Settings.SelectOptionFor).Replace("%1", itemNode.categoryTitle)
|
||||
buttons: optionTitlesArray
|
||||
})
|
||||
if dialog = invalid
|
||||
return
|
||||
end if
|
||||
dialog.addFields({
|
||||
"categoryContentNode": itemNode
|
||||
"options": options
|
||||
})
|
||||
dialog.observeField("buttonSelected", FuncName(OnCategoryDialogResult), ["buttonSelected"])
|
||||
end function
|
||||
|
||||
function OnCategoryDialogResult(event as object) as void
|
||||
dialog = event.getRoSGNode()
|
||||
options = dialog.options
|
||||
buttonIndex = event.GetData()
|
||||
|
||||
if not IsInt(buttonIndex) or buttonIndex < 0 or buttonIndex >= options.Count()
|
||||
return
|
||||
end if
|
||||
|
||||
selectedOption = options[buttonIndex]
|
||||
category = dialog.categoryContentNode.category
|
||||
|
||||
value = m.top.value
|
||||
value[category].option = selectedOption
|
||||
m.top.value = value
|
||||
|
||||
LogInfo("SponsorBlock category", category, "set to", selectedOption)
|
||||
end function
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<component name="SponsorBlockCategoriesPreferences" extends="Group" includes="AutoBind,Focus">
|
||||
<interface>
|
||||
<field id="value" type="assocarray" onChange="OnValueChange" />
|
||||
<field id="save" type="boolean" alwaysNotify="true" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
</interface>
|
||||
<children>
|
||||
<Rectangle
|
||||
width="1280"
|
||||
height="720"
|
||||
color="#000000"
|
||||
opacity="0.5">
|
||||
</Rectangle>
|
||||
<Rectangle
|
||||
width="720"
|
||||
height="600"
|
||||
translation="[300,60]"
|
||||
color="#242424">
|
||||
<Label
|
||||
width="720"
|
||||
horizAlign="center"
|
||||
translation="[0,38]"
|
||||
text="Categories">
|
||||
<Font role="font" uri="font:SystemFontFile" size="24" />
|
||||
</Label>
|
||||
|
||||
<MarkupGrid
|
||||
id="categoryList"
|
||||
itemComponentName="SponsorBlockCategoryListItem"
|
||||
itemSize="[640,32]"
|
||||
itemSpacing="[0,10]"
|
||||
numColumns="1"
|
||||
numRows="10"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
translation="[40,100]"
|
||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
||||
|
||||
<ButtonEx
|
||||
id="saveButton"
|
||||
iconVisible="false"
|
||||
text="Save"
|
||||
padding="[30,30]"
|
||||
translation="[340,500]" />
|
||||
<ButtonEx
|
||||
id="closeButton"
|
||||
iconVisible="false"
|
||||
text="Close"
|
||||
padding="[30,30]"
|
||||
translation="[496,500]" />
|
||||
</Rectangle>
|
||||
</children>
|
||||
</component>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<component name="SponsorBlockCategoryContent" extends="ContentNode">
|
||||
<interface>
|
||||
<field id="category" type="string" />
|
||||
<field id="categoryTitle" type="string" />
|
||||
<field id="selectedOption" type="string" />
|
||||
<field id="options" type="stringarray" />
|
||||
<field id="optionTitles" type="assocarray" />
|
||||
<field id="color" type="color" />
|
||||
</interface>
|
||||
</component>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
function OnContentSet() as void
|
||||
content = m.top.itemContent
|
||||
if content = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
m.top.categoryTitle = content.categoryTitle
|
||||
optionTitles = content.optionTitles
|
||||
m.top.optionTitle = optionTitles[content.selectedOption]
|
||||
m.top.color = content.color
|
||||
end function
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<component name="SponsorBlockCategoryListItem" extends="Group">
|
||||
<interface>
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
|
||||
<field id="categoryTitle" type="string" alias="categoryLabel.text" />
|
||||
<field id="optionTitle" type="string" alias="optionLabel.text" />
|
||||
<field id="color" type="color" alias="colorRect.color" />
|
||||
</interface>
|
||||
<children>
|
||||
<Rectangle id="colorRect"
|
||||
width="52"
|
||||
height="28"
|
||||
translation="[10, 2]" />
|
||||
|
||||
<Label id="categoryLabel"
|
||||
font="font:SmallestSystemFont"
|
||||
width="320"
|
||||
height="32"
|
||||
vertAlign="center"
|
||||
horizAlign="left"
|
||||
translation="[80, 0]" />
|
||||
<Label id="optionLabel"
|
||||
width="320"
|
||||
height="32"
|
||||
font="font:SmallestSystemFont"
|
||||
vertAlign="center"
|
||||
horizAlign="right"
|
||||
translation="[310, 0]" />
|
||||
</children>
|
||||
</component>
|
||||
@@ -1,14 +1,18 @@
|
||||
import "pkg:/components/Services/Innertube/Context.bs"
|
||||
import "pkg:/source/services/HttpClient.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function CreateBrowseRequest(browseId as string, clienType as Innertube.ClientType, params = "" as string, continuation = "" as string) as object
|
||||
function CreateBrowseRequest(browseId as string, clienType as Innertube.ClientType, options = invalid as object) as object
|
||||
params = OptionUtils.GetOrDefault(options, "params", "")
|
||||
continuation = OptionUtils.GetOrDefault(options, "continuation", "")
|
||||
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
"context": Innertube.CreateContext(clienType, deviceInfo, "", "")
|
||||
"context": Innertube.CreateContext(clienType, deviceInfo, options)
|
||||
}
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
@@ -21,12 +25,7 @@ namespace Innertube
|
||||
end if
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(Innertube.CreateHeaders(clienType))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(clienType))
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
namespace Innertube
|
||||
@@ -12,18 +13,24 @@ namespace Innertube
|
||||
function CreateHeaders(clienType as Innertube.ClientType) as object
|
||||
if clienType = ClientType.Web
|
||||
return {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
"user-agent": INNERTUBE_WEB_USER_AGENT
|
||||
"x-youtube-client-name": INNERTUBE_WEB_CLIENT_NAME
|
||||
"x-youtube-client-version": INNERTUBE_WEB_CLIENT_VERSION
|
||||
}
|
||||
else if clienType = ClientType.IOS
|
||||
return {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
"user-agent": INNERTUBE_IOS_USER_AGENT
|
||||
"x-youtube-client-name": INNERTUBE_IOS_CLIENT_NAME
|
||||
"x-youtube-client-version": INNERTUBE_IOS_CLIENT_VERSION
|
||||
}
|
||||
else if clienType = ClientType.Tv
|
||||
return {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
"user-agent": INNERTUBE_TV_USER_AGENT
|
||||
"x-youtube-client-name": INNERTUBE_TV_CLIENT_NAME
|
||||
"x-youtube-client-version": INNERTUBE_TV_CLIENT_VERSION
|
||||
@@ -33,7 +40,7 @@ namespace Innertube
|
||||
end if
|
||||
end function
|
||||
|
||||
function CreateContext(clienType as Innertube.ClientType, deviceInfo as object, ctt as string, visitorData as string) as object
|
||||
function CreateContext(clienType as Innertube.ClientType, deviceInfo as object, options = invalid as object) as object
|
||||
client = invalid
|
||||
if clienType = ClientType.Web
|
||||
client = CreateContextClientWeb(deviceInfo)
|
||||
@@ -45,6 +52,10 @@ namespace Innertube
|
||||
throw "Invalid client type"
|
||||
end if
|
||||
|
||||
credentialTransferToken = OptionUtils.Get(options, "credentialTransferToken")
|
||||
visitorData = OptionUtils.Get(options, "visitorData")
|
||||
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
||||
|
||||
context = {
|
||||
"client": client
|
||||
"user": {
|
||||
@@ -57,9 +68,9 @@ namespace Innertube
|
||||
}
|
||||
}
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(ctt)
|
||||
if not StringUtils.IsNullOrEmpty(credentialTransferToken)
|
||||
context["user"]["credentialTransferTokens"] = [{
|
||||
"token": ctt
|
||||
"token": credentialTransferToken
|
||||
"scope": "VIDEO"
|
||||
}]
|
||||
end if
|
||||
@@ -68,6 +79,10 @@ namespace Innertube
|
||||
context["client"]["visitorData"] = visitorData
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(onBehalfOfUser)
|
||||
context["user"]["onBehalfOfUser"] = onBehalfOfUser
|
||||
end if
|
||||
|
||||
return context
|
||||
end function
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -11,36 +11,17 @@ import "pkg:/components/Services/Innertube/SubscriptionEndpoint.bs"
|
||||
import "pkg:/source/services/HttpClient.bs"
|
||||
import "pkg:/source/utils/CancellationUtils.bs"
|
||||
import "pkg:/source/utils/ObjectUtils.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/TimeUtils.bs"
|
||||
|
||||
namespace InnertubeService
|
||||
|
||||
function GetVideoMetadata(videoId as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
fetchNext = true
|
||||
ctt = ""
|
||||
visitorData = ""
|
||||
raw = false
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
fetchNext = OptionUtils.GetOrDefault(options, "fetchNext", true)
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("fetchNext")
|
||||
fetchNext = options.fetchNext
|
||||
end if
|
||||
if options.DoesExist("ctt")
|
||||
ctt = options.ctt
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
if options.DoesExist("visitorData")
|
||||
visitorData = options.visitorData
|
||||
end if
|
||||
end if
|
||||
|
||||
playerRequest = Innertube.CreatePlayerRequest(videoId, ctt, visitorData, Innertube.ClientType.IOS)
|
||||
playerRequest = Innertube.CreatePlayerRequest(videoId, Innertube.ClientType.IOS, options)
|
||||
playerRequest.Cancellation(cancellation)
|
||||
if raw
|
||||
playerRequest.LogCurlCommand()
|
||||
@@ -51,7 +32,7 @@ namespace InnertubeService
|
||||
nextRequest = invalid
|
||||
nextResponse = invalid
|
||||
if fetchNext
|
||||
nextRequest = Innertube.CreateNextRequest({ "videoId": videoId }, ctt)
|
||||
nextRequest = Innertube.CreateNextRequest({ "videoId": videoId }, options)
|
||||
nextRequest.Cancellation(cancellation)
|
||||
if raw
|
||||
nextRequest.LogCurlCommand()
|
||||
@@ -111,20 +92,11 @@ namespace InnertubeService
|
||||
}
|
||||
end if
|
||||
|
||||
cancellation = invalid
|
||||
retry = true
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("retry")
|
||||
retry = options.retry
|
||||
end if
|
||||
end if
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
retry = OptionUtils.GetOrDefault(options, "retry", true)
|
||||
|
||||
params = Innertube.GetEncodedNextParams(videoIds)
|
||||
request = Innertube.CreateNextRequest({ "params": params }, "")
|
||||
request = Innertube.CreateNextRequest({ "params": params })
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
response = request.Await()
|
||||
@@ -186,38 +158,24 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetTrending(options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
trendingType = LCase(OptionUtils.GetOrDefault(options, "type", ""))
|
||||
disableShorts = OptionUtils.GetOrDefault(options, "disableShorts", false)
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
|
||||
params = ""
|
||||
disableShorts = false
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("type")
|
||||
trendingType = LCase(ValidString(options.type))
|
||||
|
||||
if trendingType = "music"
|
||||
' {"44:proto": {"3:string": "ytma_charts"}}
|
||||
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
|
||||
else if trendingType = "gaming"
|
||||
' {"44:proto": {"3:string": "gaming_corpus_most_popular"}}
|
||||
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
|
||||
else if trendingType = "movies"
|
||||
' {"44:proto": {"3:string": "trailers"}}
|
||||
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
||||
end if
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
if trendingType = "music"
|
||||
' {"44:proto": {"3:string": "ytma_charts"}}
|
||||
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
|
||||
else if trendingType = "gaming"
|
||||
' {"44:proto": {"3:string": "gaming_corpus_most_popular"}}
|
||||
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
|
||||
else if trendingType = "movies"
|
||||
' {"44:proto": {"3:string": "trailers"}}
|
||||
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
||||
end if
|
||||
|
||||
request = Innertube.CreateBrowseRequest("FEtrending", Innertube.ClientType.WEB, params)
|
||||
request = Innertube.CreateBrowseRequest("FEtrending", Innertube.ClientType.WEB, { params: params })
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
if raw
|
||||
@@ -270,27 +228,12 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetBrowseAuthenticatedPage(browserId as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
accessToken = invalid
|
||||
continuation = ""
|
||||
disableShorts = false
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
disableShorts = OptionUtils.GetOrDefault(options, "disableShorts", false)
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("accessToken")
|
||||
accessToken = options.accessToken
|
||||
end if
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
end if
|
||||
request = Innertube.CreateBrowseRequest(browserId, Innertube.ClientType.Tv, options)
|
||||
|
||||
request = Innertube.CreateBrowseRequest(browserId, Innertube.ClientType.Tv, "", continuation)
|
||||
if accessToken <> invalid
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
end if
|
||||
@@ -325,7 +268,7 @@ namespace InnertubeService
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
|
||||
playerRequest = Innertube.CreatePlayerRequest(videoId, "", "", Innertube.ClientType.Tv)
|
||||
playerRequest = Innertube.CreatePlayerRequest(videoId, Innertube.ClientType.Tv, options)
|
||||
playerRequest.Cancellation(cancellation)
|
||||
playerRequest.Header("Authorization", "Bearer " + accessToken)
|
||||
|
||||
@@ -338,6 +281,13 @@ namespace InnertubeService
|
||||
|
||||
json = playerResponse.Json()
|
||||
|
||||
error = Innertube.ParsePlayerResponseForError(json)
|
||||
if error <> ""
|
||||
return {
|
||||
error: error
|
||||
}
|
||||
end if
|
||||
|
||||
videostatsPlaybackUrl = ObjectUtils.Dig(json, ["playbackTracking", "videostatsPlaybackUrl", "baseUrl"])
|
||||
videostatsWatchtimeUrl = ObjectUtils.Dig(json, ["playbackTracking", "videostatsWatchtimeUrl", "baseUrl"])
|
||||
|
||||
@@ -348,12 +298,9 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function AuthMarkVideoWatched(videostatsPlaybackUrl as string, options as object) as boolean
|
||||
cancellation = invalid
|
||||
accessToken = options.accessToken
|
||||
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
||||
|
||||
videostatsPlaybackUrl = videostatsPlaybackUrl.replace("https://s.", "https://www.")
|
||||
queryParams = UrlUtils.ParseQueryComponents(videostatsPlaybackUrl)
|
||||
@@ -371,6 +318,9 @@ namespace InnertubeService
|
||||
request.NoCache()
|
||||
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
if not StringUtils.IsNullOrEmpty(onBehalfOfUser)
|
||||
request.Header("X-Goog-Pageid", onBehalfOfUser)
|
||||
end if
|
||||
|
||||
response = request.Await()
|
||||
if not response.IsSuccess()
|
||||
@@ -383,14 +333,9 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function AuthMarkVideoWatchTime(time as float, videostatsWatchtimeUrl as string, options = invalid as object) as boolean
|
||||
cancellation = invalid
|
||||
accessToken = options.accessToken
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
end if
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
onBehalfOfUser = OptionUtils.Get(options, "onBehalfOfUser")
|
||||
|
||||
timeStr = time.ToStr("%.3f")
|
||||
|
||||
@@ -412,6 +357,9 @@ namespace InnertubeService
|
||||
request.NoCache()
|
||||
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
if not StringUtils.IsNullOrEmpty(onBehalfOfUser)
|
||||
request.Header("X-Goog-Pageid", onBehalfOfUser)
|
||||
end if
|
||||
|
||||
response = request.Await()
|
||||
if not response.IsSuccess()
|
||||
@@ -437,27 +385,10 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetChannel(channelId as string, options = invalid as object) as object
|
||||
continuation = ""
|
||||
params = ""
|
||||
cancellation = invalid
|
||||
raw = false
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("params")
|
||||
params = options.params
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
end if
|
||||
|
||||
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Web, params, continuation)
|
||||
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Web, options)
|
||||
request.Cancellation(cancellation)
|
||||
if raw
|
||||
request.LogCurlCommand()
|
||||
@@ -489,16 +420,10 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetSubscriptionStatusForChannel(channelId as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
accessToken = options.accessToken
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
end if
|
||||
|
||||
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Tv, "", "")
|
||||
request = Innertube.CreateBrowseRequest(channelId, Innertube.ClientType.Tv, options)
|
||||
request.Cancellation(cancellation)
|
||||
if accessToken <> invalid
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
@@ -555,16 +480,10 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function SubscribeToChannel(channelId as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
accessToken = options.accessToken
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
end if
|
||||
|
||||
request = Innertube.CreateSubscribeRequest(channelId, "")
|
||||
request = Innertube.CreateSubscribeRequest(channelId, options)
|
||||
request.Cancellation(cancellation)
|
||||
if accessToken <> invalid
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
@@ -578,16 +497,10 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function UnsubscribeFromChannel(channelId as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
accessToken = options.accessToken
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
end if
|
||||
|
||||
request = Innertube.CreateUnsubscribeRequest(channelId, "")
|
||||
request = Innertube.CreateUnsubscribeRequest(channelId, options)
|
||||
request.Cancellation(cancellation)
|
||||
if accessToken <> invalid
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
@@ -601,25 +514,9 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetPlaylist(playlistId as string, options = invalid as object) as object
|
||||
continuation = ""
|
||||
cancellation = invalid
|
||||
raw = false
|
||||
accessToken = invalid
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
if options.DoesExist("accessToken")
|
||||
accessToken = options.accessToken
|
||||
end if
|
||||
end if
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
accessToken = OptionUtils.Get(options, "accessToken")
|
||||
|
||||
if not playlistId.StartsWith("VL")
|
||||
playlistId = "VL" + playlistId
|
||||
@@ -630,7 +527,7 @@ namespace InnertubeService
|
||||
client = Innertube.ClientType.Tv
|
||||
end if
|
||||
|
||||
request = Innertube.CreateBrowseRequest(playlistId, client, "", continuation)
|
||||
request = Innertube.CreateBrowseRequest(playlistId, client, options)
|
||||
request.Cancellation(cancellation)
|
||||
if accessToken <> invalid
|
||||
request.Header("Authorization", "Bearer " + accessToken)
|
||||
@@ -666,27 +563,15 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function GetMix(mixId as string, options = invalid as object) as object
|
||||
videoId = ""
|
||||
cancellation = invalid
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("videoId")
|
||||
videoId = options.videoId
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
end if
|
||||
videoId = OptionUtils.Get(options, "videoId")
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
|
||||
args = { "playlistId": mixId }
|
||||
if videoId <> ""
|
||||
if not StringUtils.IsNullOrEmpty(videoId)
|
||||
args["videoId"] = videoId
|
||||
end if
|
||||
request = Innertube.CreateNextRequest(args, "")
|
||||
request = Innertube.CreateNextRequest(args)
|
||||
request.Cancellation(cancellation)
|
||||
if raw
|
||||
request.LogCurlCommand()
|
||||
@@ -715,13 +600,7 @@ namespace InnertubeService
|
||||
end function
|
||||
|
||||
function ResolveUrl(url as string, options = invalid as object) as object
|
||||
cancellation = invalid
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
end if
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
|
||||
request = Innertube.CreateResolveUrlRequest(url)
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
@@ -8,21 +8,18 @@ import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function CreateNextRequest(payloadArgs as object, ctt as string) as object
|
||||
function CreateNextRequest(payloadArgs as object, options = invalid as object) as object
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
context = Innertube.CreateContext(Innertube.ClientType.Web, deviceInfo, options)
|
||||
|
||||
payload = {
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Web, deviceInfo, ctt, "")
|
||||
"context": context
|
||||
}
|
||||
payload.Append(payloadArgs)
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/next?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.Web))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Web))
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
@@ -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"
|
||||
})
|
||||
@@ -196,7 +196,7 @@ namespace Innertube
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, "", "")
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo)
|
||||
"accountReadMask": {
|
||||
"returnOwner": true
|
||||
"returnBrandAccounts": true
|
||||
@@ -243,6 +243,7 @@ namespace Innertube
|
||||
"hasChannel": ValidBool(accountItem["hasChannel"])
|
||||
"accountByline": ParseText(accountItem["accountByline"])
|
||||
"channelHandle": ParseText(accountItem["channelHandle"])
|
||||
"activeIdentifyToken": ParseAccountItemIdentityToken(accountItem)
|
||||
}
|
||||
parsedAccounts.Push(parsedAccount)
|
||||
end for
|
||||
@@ -250,6 +251,48 @@ namespace Innertube
|
||||
return parsedAccounts
|
||||
end function
|
||||
|
||||
function ParseAccountItemIdentityToken(accountItem as object) as string
|
||||
' Although selected (default) account would have a token, we usually don't
|
||||
' need it, since we don't need to pass the "onBehalfOfUser" argument
|
||||
' when using selected account.
|
||||
if ValidBool(accountItem.isSelected)
|
||||
return ""
|
||||
end if
|
||||
|
||||
supportedTokens = ObjectUtils.Dig(accountItem, ["serviceEndpoint", "selectActiveIdentityEndpoint", "supportedTokens"])
|
||||
if not IsArray(supportedTokens) or supportedTokens.Count() = 0
|
||||
return ""
|
||||
end if
|
||||
|
||||
for each supportedToken in supportedTokens
|
||||
if not IsAssociativeArray(supportedToken)
|
||||
continue for
|
||||
end if
|
||||
|
||||
' TODO:P2 should we stick with pageId, and ignore the rest?
|
||||
pageId = ObjectUtils.Dig(supportedToken, ["pageIdToken", "pageId"])
|
||||
if not StringUtils.IsNullOrEmpty(pageId)
|
||||
return pageId
|
||||
end if
|
||||
|
||||
obfuscatedGaiaId = ObjectUtils.Dig(supportedToken, ["accountStateToken", "obfuscatedGaiaId"])
|
||||
if not StringUtils.IsNullOrEmpty(obfuscatedGaiaId)
|
||||
return obfuscatedGaiaId
|
||||
end if
|
||||
|
||||
datasyncIdToken = ObjectUtils.Dig(supportedToken, ["datasyncIdToken", "datasyncIdToken"])
|
||||
if not StringUtils.IsNullOrEmpty(datasyncIdToken)
|
||||
' "datasyncIdToken": "123456789012345678901||123456789012345678901"
|
||||
match = /(\d+)\|\|(\d+)/.match(datasyncIdToken)
|
||||
if match.Count() = 3
|
||||
return match[1]
|
||||
end if
|
||||
end if
|
||||
end for
|
||||
|
||||
return ""
|
||||
end function
|
||||
|
||||
function ToCamelCase(obj as object) as object
|
||||
if not IsAssociativeArray(obj)
|
||||
return obj
|
||||
|
||||
@@ -10,9 +10,7 @@ namespace Innertube
|
||||
return []
|
||||
end if
|
||||
|
||||
if context = invalid
|
||||
context = {}
|
||||
end if
|
||||
context = ValidAssociativeArray(context)
|
||||
|
||||
if not ValidBool(context.noContainers)
|
||||
containers = GetContainers(responseData)
|
||||
@@ -333,16 +331,37 @@ namespace Innertube
|
||||
end function
|
||||
|
||||
function ParseResponseDataForError(responseData as object) as string
|
||||
error = ""
|
||||
if responseData = invalid
|
||||
return ""
|
||||
return error
|
||||
end if
|
||||
|
||||
alert = ObjectUtils.Dig(responseData, ["alerts", 0, "alertRenderer"])
|
||||
if IsAssociativeArray(alert) and alert.type = "ERROR"
|
||||
return ParseText(alert.text)
|
||||
alerts = responseData["alerts"]
|
||||
if not IsArray(alerts) or alerts.Count() = 0
|
||||
return error
|
||||
end if
|
||||
|
||||
return ""
|
||||
for each alert in alerts
|
||||
if not IsAssociativeArray(alert)
|
||||
continue for
|
||||
end if
|
||||
|
||||
alertRenderer = alert["alertRenderer"]
|
||||
if alertRenderer = invalid
|
||||
alertRenderer = alert["alertWithButtonRenderer"]
|
||||
end if
|
||||
if not IsAssociativeArray(alertRenderer)
|
||||
continue for
|
||||
end if
|
||||
|
||||
alertText = ParseText(alertRenderer.text)
|
||||
LogWarn("Innertube Alert:", `[${alertRenderer.type}]`, alertText)
|
||||
if alertRenderer.type = "ERROR"
|
||||
error += alertText
|
||||
end if
|
||||
end for
|
||||
|
||||
return error
|
||||
end function
|
||||
|
||||
function ParseResponseForCacheControl(response as object) as dynamic
|
||||
|
||||
@@ -6,12 +6,16 @@ import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function CreatePlayerRequest(videoId as string, ctt as string, visitorData as string, client as Innertube.ClientType) as object
|
||||
function CreatePlayerRequest(videoId as string, client as Innertube.ClientType, options = invalid as object) as object
|
||||
visitorData = OptionUtils.Get(options, "visitorData")
|
||||
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
context = Innertube.CreateContext(client, deviceInfo, options)
|
||||
|
||||
payload = {
|
||||
"videoId": videoId
|
||||
"context": Innertube.CreateContext(client, deviceInfo, ctt, visitorData)
|
||||
"context": context
|
||||
"playbackContext": {
|
||||
"contentPlaybackContext": {
|
||||
"vis": 0
|
||||
@@ -32,48 +36,19 @@ namespace Innertube
|
||||
}
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/player?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(Innertube.CreateHeaders(client))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(client))
|
||||
if not StringUtils.IsNullOrEmpty(visitorData)
|
||||
request.Header("x-goog-visitor-id", visitorData)
|
||||
end if
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
function ParseInnertubePlayerResponse(payload as object) as object
|
||||
if not IsAssociativeArray(payload)
|
||||
error = ParsePlayerResponseForError(payload)
|
||||
if error <> ""
|
||||
return {
|
||||
error: "Invalid payload"
|
||||
}
|
||||
end if
|
||||
|
||||
playabilityStatus = payload["playabilityStatus"]
|
||||
if not IsAssociativeArray(playabilityStatus)
|
||||
return {
|
||||
error: "Invalid playability status"
|
||||
}
|
||||
end if
|
||||
|
||||
if playabilityStatus["status"] <> "OK"
|
||||
errorMessage = ""
|
||||
if IsString(playabilityStatus["reason"])
|
||||
errorMessage = playabilityStatus["reason"]
|
||||
end if
|
||||
|
||||
subreason = ParseText(ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorMessageRenderer", "subreason"]))
|
||||
|
||||
if subreason <> ""
|
||||
errorMessage += `\n` + subreason
|
||||
end if
|
||||
|
||||
if errorMessage = ""
|
||||
errorMessage = "Video not available"
|
||||
end if
|
||||
|
||||
return {
|
||||
error: errorMessage
|
||||
error: error
|
||||
}
|
||||
end if
|
||||
|
||||
@@ -114,6 +89,38 @@ namespace Innertube
|
||||
return videoInfo
|
||||
end function
|
||||
|
||||
function ParsePlayerResponseForError(payload as object) as string
|
||||
if not IsAssociativeArray(payload)
|
||||
return "Invalid payload"
|
||||
end if
|
||||
|
||||
playabilityStatus = payload["playabilityStatus"]
|
||||
if not IsAssociativeArray(playabilityStatus)
|
||||
return "Invalid playability status"
|
||||
end if
|
||||
|
||||
if playabilityStatus["status"] = "OK"
|
||||
return ""
|
||||
end if
|
||||
|
||||
errorMessage = ""
|
||||
if IsString(playabilityStatus["reason"])
|
||||
errorMessage = playabilityStatus["reason"]
|
||||
end if
|
||||
|
||||
subreason = ParseText(ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorMessageRenderer", "subreason"]))
|
||||
|
||||
if subreason <> ""
|
||||
errorMessage += `\n` + subreason
|
||||
end if
|
||||
|
||||
if errorMessage = ""
|
||||
errorMessage = "Video not available"
|
||||
end if
|
||||
|
||||
return errorMessage
|
||||
end function
|
||||
|
||||
function ParseStoryboards(payload as object, lengthSeconds as integer) as object
|
||||
storyboard = ObjectUtils.Dig(payload, ["storyboards", "playerLiveStoryboardSpecRenderer", "spec"])
|
||||
if IsString(storyboard)
|
||||
|
||||
@@ -6,17 +6,12 @@ namespace Innertube
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
"context": CreateContext(ClientType.Web, deviceInfo, "", "")
|
||||
"context": CreateContext(ClientType.Web, deviceInfo)
|
||||
"url": url
|
||||
}
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/navigation/resolve_url?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(CreateHeaders(ClientType.Web))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(ClientType.Web))
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
@@ -2,42 +2,25 @@ import "pkg:/components/Services/Innertube/Context.bs"
|
||||
import "pkg:/components/Services/Innertube/Parser.bs"
|
||||
import "pkg:/components/Services/Innertube/SearchFilters.bs"
|
||||
import "pkg:/source/services/HttpClient.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function Search(query as string, options = invalid as object) as object
|
||||
searchFilters = invalid
|
||||
continuation = ""
|
||||
cancellation = invalid
|
||||
disableShorts = false
|
||||
raw = false
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("searchFilters")
|
||||
searchFilters = options.searchFilters
|
||||
end if
|
||||
if options.DoesExist("continuation")
|
||||
continuation = options.continuation
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("disableShorts")
|
||||
disableShorts = options.disableShorts
|
||||
end if
|
||||
if options.DoesExist("raw")
|
||||
raw = options.raw
|
||||
end if
|
||||
end if
|
||||
searchFilters = OptionUtils.Get(options, "searchFilters")
|
||||
continuation = OptionUtils.Get(options, "continuation")
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
disableShorts = OptionUtils.GetOrDefault(options, "disableShorts", false)
|
||||
raw = OptionUtils.GetOrDefault(options, "raw", false)
|
||||
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
context: Innertube.CreateContext(Innertube.ClientType.WEB, deviceInfo, "", "")
|
||||
context: Innertube.CreateContext(Innertube.ClientType.WEB, deviceInfo)
|
||||
}
|
||||
|
||||
if continuation <> ""
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
payload["continuation"] = continuation
|
||||
else
|
||||
payload["query"] = query
|
||||
@@ -50,13 +33,7 @@ namespace Innertube
|
||||
end if
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/search?prettyPrint=false&alt=json", payload)
|
||||
request.Headers({
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
"user-agent": INNERTUBE_WEB_USER_AGENT
|
||||
"x-youtube-client-name": INNERTUBE_WEB_CLIENT_NAME
|
||||
"x-youtube-client-version": INNERTUBE_WEB_CLIENT_VERSION
|
||||
})
|
||||
request.Headers(Innertube.CreateHeaders(ClientType.Web))
|
||||
|
||||
request.Cancellation(cancellation)
|
||||
if raw
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -3,11 +3,11 @@ import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace Innertube
|
||||
|
||||
function CreateSubscribeRequest(channelIds as dynamic, params as string) as object
|
||||
function CreateSubscribeRequest(channelIds as dynamic, options = invalid as object) as object
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, "", "")
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, options)
|
||||
}
|
||||
|
||||
if IsString(channelIds)
|
||||
@@ -15,26 +15,17 @@ namespace Innertube
|
||||
end if
|
||||
payload["channelIds"] = channelIds
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(params)
|
||||
payload["params"] = params
|
||||
end if
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/subscription/subscribe?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
function CreateUnsubscribeRequest(channelIds as dynamic, params as string) as object
|
||||
function CreateUnsubscribeRequest(channelIds as dynamic, options = invalid as object) as object
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
|
||||
payload = {
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, "", "")
|
||||
"context": Innertube.CreateContext(Innertube.ClientType.Tv, deviceInfo, options)
|
||||
}
|
||||
|
||||
if IsString(channelIds)
|
||||
@@ -42,17 +33,8 @@ namespace Innertube
|
||||
end if
|
||||
payload["channelIds"] = channelIds
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(params)
|
||||
payload["params"] = params
|
||||
end if
|
||||
|
||||
request = HttpClient.PostJson("https://www.youtube.com/youtubei/v1/subscription/unsubscribe?prettyPrint=false&alt=json", payload)
|
||||
headers = {
|
||||
"accept": "*/*"
|
||||
"accept-language": "*"
|
||||
}
|
||||
headers.Append(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
request.Headers(headers)
|
||||
request.Headers(Innertube.CreateHeaders(Innertube.ClientType.Tv))
|
||||
|
||||
return request
|
||||
end function
|
||||
|
||||
@@ -8,6 +8,7 @@ import "pkg:/source/utils/CryptoUtils.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/MessagePortUtils.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/OptionUtils.bs"
|
||||
import "pkg:/source/utils/RegistryUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/TimeUtils.bs"
|
||||
@@ -140,21 +141,9 @@ namespace Invidious
|
||||
' have the exact expiration time, we'll use 5 hours. Invidious currently
|
||||
' Does a fresh fetch if the cache is older than 10 minutes.
|
||||
' https://github.com/iv-org/invidious/blob/069e91d2a609b1df94bdfbb693335969b2a281d8/src/invidious/videos.cr#L349
|
||||
cacheSeconds = 18000 ' 5 hours
|
||||
cancellation = invalid
|
||||
tryCount = 2
|
||||
|
||||
if options <> invalid
|
||||
if options.DoesExist("cacheSeconds")
|
||||
cacheSeconds = options.cacheSeconds
|
||||
end if
|
||||
if options.DoesExist("cancellation")
|
||||
cancellation = options.cancellation
|
||||
end if
|
||||
if options.DoesExist("tryCount")
|
||||
tryCount = options.tryCount
|
||||
end if
|
||||
end if
|
||||
cacheSeconds = OptionUtils.GetOrDefault(options, "cacheSeconds", 18000) ' 5 hours
|
||||
cancellation = OptionUtils.Get(options, "cancellation")
|
||||
tryCount = OptionUtils.GetOrDefault(options, "tryCount", 2)
|
||||
|
||||
instance = m.GetInstance()
|
||||
url = `${instance}${Invidious.VIDEOS_ENDPOINT}/${videoId}`
|
||||
@@ -197,6 +186,9 @@ namespace Invidious
|
||||
url = `${authToken.instance}${Invidious.AUTH_PLAYLISTS}/${playlistId}`
|
||||
request = HttpClient.Get(url)
|
||||
request.Headers(m.GetAuthenticationHeaders(authToken.token))
|
||||
if not StringUtils.IsNullOrEmpty(authToken.activeIdentifyToken)
|
||||
request.QueryParam("activeIdentifyToken", authToken.activeIdentifyToken)
|
||||
end if
|
||||
else
|
||||
instance = m.GetInstance()
|
||||
url = `${instance}${Invidious.PLAYLISTS_ENDPOINT}/${playlistId}`
|
||||
@@ -319,6 +311,9 @@ namespace Invidious
|
||||
|
||||
request.Url(authToken.instance + endpoint.url)
|
||||
request.Headers(m.GetAuthenticationHeaders(authToken.token))
|
||||
if not StringUtils.IsNullOrEmpty(authToken.activeIdentifyToken)
|
||||
request.QueryParam("activeIdentifyToken", authToken.activeIdentifyToken)
|
||||
end if
|
||||
end if
|
||||
|
||||
if endpoint.queryParams <> invalid
|
||||
@@ -786,6 +781,9 @@ namespace Invidious
|
||||
|
||||
url = `${authToken.instance}${Invidious.AUTH_SUBSCRIPTIONS}/${channelId}`
|
||||
request = HttpClient.Post(url, "")
|
||||
if not StringUtils.IsNullOrEmpty(authToken.activeIdentifyToken)
|
||||
request.QueryParam("activeIdentifyToken", authToken.activeIdentifyToken)
|
||||
end if
|
||||
request.Headers(m.GetAuthenticationHeaders(authToken.token))
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
@@ -800,6 +798,9 @@ namespace Invidious
|
||||
|
||||
url = `${authToken.instance}${Invidious.AUTH_SUBSCRIPTIONS}/${channelId}`
|
||||
request = HttpClient.Delete(url)
|
||||
if not StringUtils.IsNullOrEmpty(authToken.activeIdentifyToken)
|
||||
request.QueryParam("activeIdentifyToken", authToken.activeIdentifyToken)
|
||||
end if
|
||||
request.Headers(m.GetAuthenticationHeaders(authToken.token))
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
|
||||
@@ -427,8 +427,8 @@ class LoungeApi
|
||||
' Right now we just store only the last ctt, which works ok if we're casting one video at a time.
|
||||
' But if the age restrcited video is added to the queue, we don't capture a token and playing the video would fail.
|
||||
' These tokens need to be managed better, based on the video they belong to.
|
||||
if not StringUtils.IsNullOrEmpty(commandArgs.ctt)
|
||||
m.loungeServiceNode.ctt = commandArgs.ctt
|
||||
if not StringUtils.IsNullOrEmpty(commandArgs[FIELD_CTT])
|
||||
m.loungeServiceNode.credentialTransferToken = commandArgs[FIELD_CTT]
|
||||
end if
|
||||
LoungeVideoQueue.SetPlaylist(m.videoQueueNode, m.invService, commandArgs)
|
||||
end function
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field id="deviceName" type="string" />
|
||||
<field id="screenId" type="string" />
|
||||
<field id="loungeToken" type="string" />
|
||||
<field id="ctt" type="string" />
|
||||
<field id="credentialTransferToken" type="string" />
|
||||
|
||||
<field id="join" type="boolean" alwaysNotify="true" />
|
||||
<field id="outgoingMessages" type="array" alwaysNotify="true" />
|
||||
|
||||
@@ -9,6 +9,7 @@ function Init()
|
||||
"number": "integer"
|
||||
"radio": "string"
|
||||
"array": "array"
|
||||
"assocarray": "assocarray"
|
||||
}
|
||||
|
||||
m.disableSavingToRegistry = false
|
||||
|
||||
@@ -53,6 +53,7 @@ function LoadProfilesFromRegistry()
|
||||
profileNode.thumbnail = profile.thumbnail
|
||||
profileNode.accessToken = profile.accessToken
|
||||
|
||||
profileNode.activeIdentifyToken = profile.activeIdentifyToken
|
||||
profileNode.refreshToken = profile.refreshToken
|
||||
profileNode.scope = profile.scope
|
||||
profileNode.tokenType = profile.tokenType
|
||||
@@ -103,7 +104,7 @@ function MigrateExistingProfiles(userProfiles as object) as boolean
|
||||
return false
|
||||
end if
|
||||
|
||||
id = CreateProfileId(authToken.username, authToken.instance)
|
||||
id = CreateProfileId(authToken.username, "", authToken.instance)
|
||||
for each profile in userProfiles.profiles
|
||||
if profile.id = id
|
||||
return false
|
||||
@@ -161,6 +162,7 @@ function GetProfilesDto(includeAccessToken as boolean) as object
|
||||
"id": profileNode.id
|
||||
"type": profileNode.type
|
||||
"username": profileNode.username
|
||||
"activeIdentifyToken": profileNode.activeIdentifyToken
|
||||
"serverUrl": profileNode.serverUrl
|
||||
"thumbnail": profileNode.thumbnail
|
||||
"color": color
|
||||
@@ -191,7 +193,7 @@ end function
|
||||
function LoginWithProfile(newProfile as object)
|
||||
isNewProfile = true
|
||||
if StringUtils.IsNullOrEmpty(newProfile.id)
|
||||
newProfile.id = CreateProfileId(newProfile.username, newProfile.serverUrl)
|
||||
newProfile.id = CreateProfileId(newProfile.username, newProfile.activeIdentifyToken, newProfile.serverUrl)
|
||||
end if
|
||||
|
||||
existingProfile = invalid
|
||||
@@ -206,6 +208,7 @@ function LoginWithProfile(newProfile as object)
|
||||
|
||||
if not isNewProfile
|
||||
existingProfile.username = newProfile.username
|
||||
existingProfile.activeIdentifyToken = newProfile.activeIdentifyToken
|
||||
existingProfile.thumbnail = newProfile.thumbnail
|
||||
existingProfile.accessToken = newProfile.accessToken
|
||||
existingProfile.refreshToken = newProfile.refreshToken
|
||||
@@ -333,6 +336,7 @@ function SetCurrentProfile(newActiveProfile as object) as void
|
||||
token: newActiveProfile.accessToken
|
||||
instance: newActiveProfile.serverUrl
|
||||
username: newActiveProfile.username
|
||||
activeIdentifyToken: newActiveProfile.activeIdentifyToken
|
||||
profileNode: newActiveProfile
|
||||
}
|
||||
LogInfo("Current profile set to", newActiveProfile.username, "@", newActiveProfile.serverUrl)
|
||||
@@ -353,6 +357,6 @@ function RefreshActiveProfileState(activeProfile as object) as void
|
||||
end for
|
||||
end function
|
||||
|
||||
function CreateProfileId(username as string, serverUrl as string) as string
|
||||
return "v1:" + CryptoUtils.GetMd5(username + serverUrl)
|
||||
function CreateProfileId(username as string, activeIdentifyToken as string, serverUrl as string) as string
|
||||
return "v1:" + CryptoUtils.GetMd5(username + activeIdentifyToken + serverUrl)
|
||||
end function
|
||||
+2
-10
@@ -1,4 +1,5 @@
|
||||
import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs"
|
||||
import "pkg:/components/VideoPlayer/SponsorBlockSegmentAction.bs"
|
||||
|
||||
function Init()
|
||||
m.categoryLabel = m.top.findNode("categoryLabel")
|
||||
@@ -13,16 +14,7 @@ function Init()
|
||||
m.service = SponsorBlock.SponsorBlockService()
|
||||
end function
|
||||
|
||||
function OnActionSet()
|
||||
action = m.top.action
|
||||
category = m.top.segment.category
|
||||
categoryTitle = Tr(ValidString(m.service.SegmentShortTitle(category)))
|
||||
if action = "AutoSkip"
|
||||
m.categoryLabel.text = Tr(Locale.SponsorBlock.Skipped) + `\n` + categoryTitle
|
||||
else
|
||||
m.categoryLabel.text = categoryTitle
|
||||
end if
|
||||
|
||||
function OnDoShow() as void
|
||||
AnimateIn()
|
||||
end function
|
||||
|
||||
|
||||
+24
-14
@@ -1,7 +1,9 @@
|
||||
<component name="SponsorBlockNotification" extends="Group">
|
||||
<interface>
|
||||
<field id="segment" type="assocarray" />
|
||||
<field id="action" type="string" onChange="OnActionSet" alwaysNotify="true" />
|
||||
<field id="segmentId" type="string" />
|
||||
<field id="categoryText" type="string" alias="categoryLabel.text" />
|
||||
<field id="actionText" type="string" alias="actionLabel.text" />
|
||||
<field id="doShow" type="boolean" onChange="OnDoShow" alwaysNotify="true" />
|
||||
</interface>
|
||||
<children>
|
||||
<Poster
|
||||
@@ -16,18 +18,26 @@
|
||||
height="50"
|
||||
translation="[10,10]">
|
||||
</Poster>
|
||||
<Label
|
||||
id="categoryLabel"
|
||||
text="..."
|
||||
font="font:SmallestBoldSystemFont"
|
||||
lineSpacing="5"
|
||||
horizAlign="center"
|
||||
vertAlign="center"
|
||||
wrap="true"
|
||||
width="170"
|
||||
height="70"
|
||||
translation="[70,0]">
|
||||
</Label>
|
||||
<LayoutGroup vertAlignment="center" translation="[70,35]">
|
||||
<Label
|
||||
id="categoryLabel"
|
||||
font="font:TinyBoldSystemFont"
|
||||
horizAlign="center"
|
||||
width="170"
|
||||
lineSpacing="0"
|
||||
maxLines="2"
|
||||
wrap="true">
|
||||
</Label>
|
||||
<Label
|
||||
id="actionLabel"
|
||||
font="font:TinySystemFont"
|
||||
horizAlign="center"
|
||||
width="170"
|
||||
lineSpacing="0"
|
||||
maxLines="2"
|
||||
wrap="true">
|
||||
</Label>
|
||||
</LayoutGroup>
|
||||
</Poster>
|
||||
<Animation
|
||||
id="translationAnimation"
|
||||
|
||||
+21
-5
@@ -1,27 +1,43 @@
|
||||
namespace SponsorBlock
|
||||
const NOTIFICATION_NODE_ID = "SponsorBlockNotification"
|
||||
|
||||
function GetCurrentNotification(notifications as object) as object
|
||||
childCount = notifications.getChildCount()
|
||||
|
||||
for i = 0 to childCount - 1
|
||||
child = notifications.getChild(i)
|
||||
if child.id = NOTIFICATION_NODE_ID
|
||||
return child
|
||||
end if
|
||||
end for
|
||||
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function ShowNotifcation(notifications as object, segment as object, action as dynamic) 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 = notifications.findNode(NOTIFICATION_NODE_ID)
|
||||
notification = GetCurrentNotification(notifications)
|
||||
if notification = invalid
|
||||
notification = notifications.createChild("SponsorBlockNotification")
|
||||
notification.id = NOTIFICATION_NODE_ID
|
||||
end if
|
||||
notification.segment = segment
|
||||
notification.action = action
|
||||
|
||||
notification.segmentId = segment.UUID
|
||||
notification.categoryText = segment.shortTitle
|
||||
notification.actionText = segment.actionText
|
||||
notification.doShow = true
|
||||
end function
|
||||
|
||||
function RemoveNotifcation(notifications as object) as void
|
||||
notification = notifications.findNode(NOTIFICATION_NODE_ID)
|
||||
notification = GetCurrentNotification(notifications)
|
||||
if notification <> invalid
|
||||
notifications.RemoveChild(notification)
|
||||
end if
|
||||
end function
|
||||
|
||||
function SetVisible(notifications as object, visible as boolean)
|
||||
notification = notifications.findNode(NOTIFICATION_NODE_ID)
|
||||
notification = GetCurrentNotification(notifications)
|
||||
if notification <> invalid
|
||||
notification.visible = visible
|
||||
end if
|
||||
|
||||
@@ -5,5 +5,5 @@ function SponsorBlockSegmentViewedTask(input as object)
|
||||
segmentId = input.segmentId
|
||||
service = new SponsorBlock.SponsorBlockService()
|
||||
|
||||
service.PostSegmentViewed(segmentId)
|
||||
service.PostSegmentViewed(segmentId, m.top.cancellation)
|
||||
end function
|
||||
@@ -12,6 +12,26 @@ namespace SponsorBlock
|
||||
m.sponsorBlockConfig = ParseJson(ReadAsciiFile("libpkg:/config/sponsorblock_config.json5"))
|
||||
end function
|
||||
|
||||
function GetCategories() as object
|
||||
if m.sponsorBlockConfig = invalid
|
||||
return []
|
||||
end if
|
||||
|
||||
return ValidArray(m.sponsorBlockConfig.categoryList)
|
||||
end function
|
||||
|
||||
function GetOptionsForCategory(category as string) as object
|
||||
if m.sponsorBlockConfig = invalid
|
||||
return []
|
||||
end if
|
||||
|
||||
if not m.sponsorBlockConfig.categories.doesexist(category)
|
||||
return []
|
||||
end if
|
||||
|
||||
return ValidArray(m.sponsorBlockConfig.categories[category].options)
|
||||
end function
|
||||
|
||||
function SegmentColor(category as string) as integer
|
||||
if m.sponsorBlockConfig = invalid
|
||||
return 0
|
||||
@@ -54,8 +74,10 @@ namespace SponsorBlock
|
||||
return invalid
|
||||
end if
|
||||
|
||||
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler", "exclusive_access"]
|
||||
actionTypes = ["skip", "mute", "chapter", "full", "poi"]
|
||||
' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler", "exclusive_access"]
|
||||
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler"]
|
||||
' actionTypes = ["skip", "mute", "chapter", "full", "poi"]
|
||||
actionTypes = ["skip", "mute", "poi"]
|
||||
|
||||
categoriesJson = FormatJson(categories).EncodeUriComponent()
|
||||
actionTypesJson = FormatJson(actionTypes).EncodeUriComponent()
|
||||
@@ -64,6 +86,11 @@ namespace SponsorBlock
|
||||
hashPrefix = CryptoUtils.GetSha256(videoId).Left(4)
|
||||
url = `${m.sponsorBlockConfig.serverAddress}${SponsorBlock.SKIP_SEGMENT_ENDPOINT}/${hashPrefix}?categories=${categoriesJson}&actionTypes=${actionTypesJson}`
|
||||
response = HttpClient.Get(url).Await()
|
||||
if not response.IsSuccess()
|
||||
LogError("SponsorBlockService: GetSkipSegmentsForVideo failed", response.ErrorMessage())
|
||||
return invalid
|
||||
end if
|
||||
|
||||
json = response.Json()
|
||||
if json = invalid
|
||||
return invalid
|
||||
@@ -78,13 +105,13 @@ namespace SponsorBlock
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function PostSegmentViewed(segmentId as string) as void
|
||||
function PostSegmentViewed(segmentId as string, cancellation = invalid as object) as void
|
||||
if m.sponsorBlockConfig = invalid or StringUtils.IsNullOrEmpty(m.sponsorBlockConfig.serverAddress)
|
||||
return
|
||||
end if
|
||||
|
||||
url = `${m.sponsorBlockConfig.serverAddress}${SponsorBlock.VIEWED_SEGMENT_ENDPOINT}?UUID=${segmentId}`
|
||||
HttpClient.Post(url, "").Await()
|
||||
HttpClient.Post(url, "").Cancellation(cancellation).Await()
|
||||
end function
|
||||
|
||||
function GenerateProgressBarBackground(segments as object, lengthSeconds as integer, path as string)
|
||||
@@ -103,8 +130,8 @@ namespace SponsorBlock
|
||||
continue for
|
||||
end if
|
||||
|
||||
pixelStart = (segment.segment[0] / videoDuration) * width
|
||||
pixelEnd = (segment.segment[1] / videoDuration) * width
|
||||
pixelStart = (segment.start / videoDuration) * width
|
||||
pixelEnd = (segment.end / videoDuration) * width
|
||||
color = m.SegmentColor(segment.category)
|
||||
' highlight's duration is zero, so it is not visble on the bar.
|
||||
' Add a few pixels to see it
|
||||
|
||||
@@ -1,22 +1,139 @@
|
||||
import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs"
|
||||
import "pkg:/components/VideoPlayer/SponsorBlockSegmentAction.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
@asynctask
|
||||
function SponsorBlockTask(input as object) as object
|
||||
videoId = input.metadata.videoId
|
||||
lengthSeconds = input.metadata.lengthSeconds
|
||||
showNotifications = input.showNotifications
|
||||
categories = input.categories
|
||||
|
||||
service = new SponsorBlock.SponsorBlockService()
|
||||
skipSegments = service.GetSkipSegmentsForVideo(videoId)
|
||||
barPath = invalid
|
||||
|
||||
skipSegments = ProcessSkipSegments(skipSegments, showNotifications, categories, service)
|
||||
|
||||
barPath = invalid
|
||||
if skipSegments <> invalid
|
||||
barPath = `tmp:/sponsorblock_bar.png`
|
||||
service.GenerateProgressBarBackground(skipSegments, lengthSeconds, barPath)
|
||||
end if
|
||||
|
||||
' Usually segment.start and segment.end are equal for poi_highlight
|
||||
' We pad the duration for poi_highlight segments so that the chapter label
|
||||
' can be visible when seeking in trickplay.
|
||||
' Padding poi_highlight is done after generating the progress bar, so that the
|
||||
' highlight is not too long in the bar.
|
||||
skipSegments = PadHightlightSegment(skipSegments, lengthSeconds)
|
||||
|
||||
' Sort the segments by start time, so we can binary search them later.
|
||||
if skipSegments <> invalid
|
||||
skipSegments.SortBy("start")
|
||||
end if
|
||||
|
||||
return {
|
||||
videoId: videoId
|
||||
skipSegments: skipSegments
|
||||
barPath: barPath
|
||||
}
|
||||
end function
|
||||
|
||||
function ProcessSkipSegments(skipSegments as object, showNotifications as boolean, categories as object, service as SponsorBlock.SponsorBlockService) as object
|
||||
if skipSegments = invalid
|
||||
return invalid
|
||||
end if
|
||||
|
||||
processedSegments = []
|
||||
for each segment in skipSegments
|
||||
' When a submission reaches the score of -2 or lower, it gets removed and will not appear anymore for users
|
||||
' https://wiki.sponsor.ajay.app/w/FAQ#How_does_voting_work_and_what_do_certain_amounts_of_votes_mean?
|
||||
if ValidInt(segment.votes) < -1
|
||||
continue for
|
||||
end if
|
||||
|
||||
option = GetOptionForSegment(segment, categories)
|
||||
if option = SponsorBlock.SegmentAction.Disable
|
||||
continue for
|
||||
end if
|
||||
|
||||
segment.option = option
|
||||
|
||||
segment.showNotification = showNotifications and ShouldShowNotification(segment, categories)
|
||||
if segment.showNotification
|
||||
if option = SponsorBlock.SegmentAction.AutoSkip
|
||||
segment.actionText = Tr(Locale.SponsorBlock.Skipped)
|
||||
else if option = SponsorBlock.SegmentAction.ManualSkip
|
||||
segment.actionText = Tr(Locale.SponsorBlock.PressOkToSkip)
|
||||
else
|
||||
segment.actionText = ""
|
||||
end if
|
||||
end if
|
||||
|
||||
segmentRange = segment["segment"]
|
||||
segmentStart = segmentRange[0]
|
||||
segmentEnd = segmentRange[1]
|
||||
segment.Delete("segment")
|
||||
segment.start = segmentStart
|
||||
segment.end = segmentEnd
|
||||
|
||||
segment.title = Tr(ValidString(service.SegmentTitle(segment.category)))
|
||||
segment.shortTitle = Tr(ValidString(service.SegmentShortTitle(segment.category)))
|
||||
|
||||
processedSegments.push(segment)
|
||||
end for
|
||||
|
||||
return processedSegments
|
||||
end function
|
||||
|
||||
function GetOptionForSegment(segment as object, categories as object) as string
|
||||
category = categories[segment.category]
|
||||
if not IsAssociativeArray(category)
|
||||
return false
|
||||
end if
|
||||
|
||||
option = category.option
|
||||
if StringUtils.IsNullOrEmpty(option)
|
||||
option = SponsorBlock.SegmentAction.Disable
|
||||
end if
|
||||
|
||||
return option
|
||||
end function
|
||||
|
||||
function ShouldShowNotification(segment as object, categories as object) as boolean
|
||||
option = GetOptionForSegment(segment, categories)
|
||||
return option = SponsorBlock.SegmentAction.AutoSkip or option = SponsorBlock.SegmentAction.ManualSkip
|
||||
end function
|
||||
|
||||
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
|
||||
|
||||
segmentPaddedDuration = 5
|
||||
|
||||
if lengthSeconds > 0
|
||||
if lengthSeconds < 120
|
||||
segmentPaddedDuration = 1
|
||||
else if lengthSeconds < 300
|
||||
segmentPaddedDuration = 2
|
||||
else if lengthSeconds < 900
|
||||
segmentPaddedDuration = 5
|
||||
else
|
||||
segmentPaddedDuration = 10
|
||||
end if
|
||||
end if
|
||||
|
||||
segmentDuration = Abs(segment.end - segment.start)
|
||||
padding = Abs(segmentPaddedDuration - segmentDuration) / 2
|
||||
segment.start = segment.start - padding
|
||||
segment.end = segment.end + padding
|
||||
end for
|
||||
|
||||
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
|
||||
|
||||
@@ -23,6 +23,7 @@ function MarkVideoWatchedTask(input as object) as object
|
||||
|
||||
playbackTrackingUrls = InnertubeService.AuthGetPlaybackTrackingUrls(videoId, {
|
||||
accessToken: authToken.token
|
||||
onBehalfOfUser: authToken.activeIdentifyToken
|
||||
cancellation: cancellation
|
||||
})
|
||||
|
||||
@@ -38,6 +39,7 @@ function MarkVideoWatchedTask(input as object) as object
|
||||
|
||||
markedAsWatched = InnertubeService.AuthMarkVideoWatched(playbackTrackingUrls.videostatsPlaybackUrl, {
|
||||
accessToken: authToken.token
|
||||
onBehalfOfUser: authToken.activeIdentifyToken
|
||||
cancellation: cancellation
|
||||
})
|
||||
if not markedAsWatched
|
||||
@@ -67,6 +69,7 @@ function MarkVideoWatchedTask(input as object) as object
|
||||
watchTime = message.getData()
|
||||
InnertubeService.AuthMarkVideoWatchTime(watchTime, playbackTrackingUrls.videostatsWatchtimeUrl, {
|
||||
accessToken: authToken.token
|
||||
onBehalfOfUser: authToken.activeIdentifyToken
|
||||
cancellation: cancellation
|
||||
})
|
||||
end while
|
||||
|
||||
@@ -2,6 +2,7 @@ import "pkg:/components/Services/SponsorBlock/Notifications/SponsorBlockNotifica
|
||||
import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs"
|
||||
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||
import "SponsorBlockSegmentAction.bs"
|
||||
import "VideoPlayer.bs"
|
||||
|
||||
namespace SponsorBlock
|
||||
@@ -12,18 +13,62 @@ namespace SponsorBlock
|
||||
end if
|
||||
|
||||
m.sponsorBlockService = new SponsorBlock.SponsorBlockService()
|
||||
|
||||
PositionChapterLabel()
|
||||
m.top.trickPlayBar.observeField("visible", FuncName(OnTrickPlayBarVisible))
|
||||
m.chapterLabelTimer = m.top.findNode("chapterLabelTimer")
|
||||
m.chapterLabelTimer.observeField("fire", FuncName(OnChapterLabelTimer))
|
||||
m._sponsorBlockLastTime = 0.0#
|
||||
|
||||
' TODO:P1 more precision on when notifications should be visible
|
||||
' Should notifcations be visible when the video is not fullscreen?
|
||||
SponsorBlock.SetVisible(m.notifications, m.container.fullscreen)
|
||||
end function
|
||||
|
||||
function FetchSponsorBlock(metadata as object) as void
|
||||
if not m.preferences["sponsorblock.enabled"]
|
||||
return
|
||||
end if
|
||||
|
||||
if m.sponsorBlockTask <> invalid
|
||||
m.sponsorBlockTask.cancel = true
|
||||
end if
|
||||
|
||||
m.sponsorBlockTask = AsyncTask.Start(Tasks.SponsorBlockTask, {
|
||||
metadata: metadata
|
||||
showNotifications: m.preferences["sponsorblock.show_notifications"]
|
||||
categories: m.preferences["sponsorblock.categories"]
|
||||
}, OnSponsorBlockTaskResults)
|
||||
end function
|
||||
|
||||
function OnSponsorBlockTaskResults(output as object) as void
|
||||
m.sponsorBlockTask = invalid
|
||||
if output.cancelled or m.onCloseCalled = true
|
||||
return
|
||||
end if
|
||||
|
||||
if not output.success
|
||||
error = ErrorUtils.Format(output.error)
|
||||
LogError(error)
|
||||
return
|
||||
end if
|
||||
|
||||
skipSegments = output.result.skipSegments
|
||||
if skipSegments = invalid or skipSegments.Count() = 0
|
||||
return
|
||||
end if
|
||||
|
||||
m.skipSegments = skipSegments
|
||||
m.top.seekMode = "accurate"
|
||||
|
||||
barPath = output.result.barPath
|
||||
if barPath <> invalid
|
||||
m.top.trickPlayBar.trackImageUri = barPath
|
||||
m.top.trickPlayBar.filledBarBlendColor = "#FF000080"
|
||||
end if
|
||||
|
||||
m.top.ObserveFieldScoped("position", FuncName(OnPositionChangeSkipSponsorBlockSections))
|
||||
|
||||
if m.top.hasField("trickPlayPosition")
|
||||
PositionChapterLabel()
|
||||
m.chapterLabelTimer = m.top.findNode("chapterLabelTimer")
|
||||
m.chapterLabelTimer.observeField("fire", FuncName(OnChapterLabelTimer))
|
||||
m._sponsorBlockLastTimeChapterUpdated = 0.0#
|
||||
m.top.trickPlayBar.observeField("visible", FuncName(OnTrickPlayBarVisible))
|
||||
end if
|
||||
end function
|
||||
|
||||
function PositionChapterLabel()
|
||||
m.chapterLabel = m.top.findNode("chapterLabel")
|
||||
' We move the chapter label under m.top.trickPlayBar
|
||||
@@ -43,162 +88,136 @@ namespace SponsorBlock
|
||||
end function
|
||||
|
||||
function OnChapterLabelTimer() as void
|
||||
if m.skipSegments = invalid
|
||||
trickPlayPosition = m.top.trickPlayPosition
|
||||
if m._sponsorBlockLastTimeChapterUpdated = trickPlayPosition
|
||||
return
|
||||
end if
|
||||
|
||||
' trickPlayPosition is not documented on Roku website, this is why we're checking
|
||||
if not IsDouble(m.top.trickPlayPosition)
|
||||
return
|
||||
end if
|
||||
|
||||
if m._sponsorBlockLastTime = m.top.trickPlayPosition
|
||||
return
|
||||
end if
|
||||
|
||||
m._sponsorBlockLastTime = m.top.trickPlayPosition
|
||||
|
||||
UpdateSponsorBlockChapter(m._sponsorBlockLastTime)
|
||||
m._sponsorBlockLastTimeChapterUpdated = trickPlayPosition
|
||||
UpdateSponsorBlockChapter(trickPlayPosition)
|
||||
end function
|
||||
|
||||
function UpdateSponsorBlockChapter(time as double) as void
|
||||
segments = m.skipSegments
|
||||
for each segment in segments
|
||||
category = segment["category"]
|
||||
segmentRange = segment["segment"]
|
||||
segmentStart = segmentRange[0]
|
||||
segmentEnd = segmentRange[1]
|
||||
|
||||
' Usually segmentStart and segmentEnd are equal for poi_highlight
|
||||
' We pad the duration for poi_highlight segments so that the chapter label
|
||||
' can be visible when seeking in trickplay
|
||||
if category = "poi_highlight"
|
||||
segmentPaddedDuration = 5
|
||||
|
||||
duration = m.top.duration
|
||||
if duration > 0
|
||||
if duration < 120
|
||||
segmentPaddedDuration = 1
|
||||
else if duration < 300
|
||||
segmentPaddedDuration = 2
|
||||
else if duration < 900
|
||||
segmentPaddedDuration = 5
|
||||
else
|
||||
segmentPaddedDuration = 10
|
||||
end if
|
||||
end if
|
||||
|
||||
segmentDuration = Abs(segmentEnd - segmentStart)
|
||||
padding = Abs(segmentPaddedDuration - segmentDuration) / 2
|
||||
segmentStart = segmentStart - padding
|
||||
segmentEnd = segmentEnd + padding
|
||||
end if
|
||||
|
||||
if (segmentStart <= time) and (segmentEnd >= time)
|
||||
m.top.chapter = Tr(ValidString(m.sponsorBlockService.SegmentTitle(category)))
|
||||
return
|
||||
end if
|
||||
end for
|
||||
m.top.chapter = ""
|
||||
segment = FindSegmentByTime(segments, time)
|
||||
if segment = invalid
|
||||
m.top.chapter = ""
|
||||
return
|
||||
end if
|
||||
m.top.chapter = segment.title
|
||||
end function
|
||||
|
||||
function FetchSponsorBlock(metadata as object) as void
|
||||
if not m.preferences["sponsorblock.enabled"]
|
||||
return
|
||||
end if
|
||||
|
||||
if m.sponsorBlockTask <> invalid
|
||||
m.sponsorBlockTask.cancel = true
|
||||
end if
|
||||
|
||||
m.sponsorBlockTask = AsyncTask.Start(Tasks.SponsorBlockTask, { metadata: metadata }, OnSponsorBlockTaskResults)
|
||||
end function
|
||||
|
||||
function OnSponsorBlockTaskResults(output as object) as void
|
||||
m.sponsorBlockTask = invalid
|
||||
if output.cancelled or m.onCloseCalled = true
|
||||
return
|
||||
end if
|
||||
|
||||
if not output.success
|
||||
error = ErrorUtils.Format(output.error)
|
||||
LogError(error)
|
||||
return
|
||||
end if
|
||||
|
||||
skipSegments = output.result.skipSegments
|
||||
if skipSegments = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
m.skipSegments = skipSegments
|
||||
m.top.seekMode = "accurate"
|
||||
|
||||
barPath = output.result.barPath
|
||||
if barPath <> invalid
|
||||
m.top.trickPlayBar.trackImageUri = barPath
|
||||
m.top.trickPlayBar.filledBarBlendColor = "#FF000080"
|
||||
end if
|
||||
|
||||
m.top.ObserveFieldScoped("position", FuncName(OnPositionChangeSkipSponsorBlockSections))
|
||||
function FindSegmentByTime(segments as object, time as dynamic) as dynamic
|
||||
' Binary search for the segment that contains the time.
|
||||
' This search sometimes fails if the segments overlap.
|
||||
' For most cases, this is acceptable, since it is not common for segments to overlap.
|
||||
low = 0
|
||||
high = segments.Count() - 1
|
||||
while low <= high
|
||||
middle = (low + high) \ 2
|
||||
segment = segments[middle]
|
||||
if time < segment.start
|
||||
high = middle - 1
|
||||
else if time > segment.end
|
||||
low = middle + 1
|
||||
else
|
||||
return segment
|
||||
end if
|
||||
end while
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function OnPositionChangeSkipSponsorBlockSections() as void
|
||||
segments = m.skipSegments
|
||||
if segments = invalid
|
||||
position = m.top.position
|
||||
|
||||
segment = FindSegmentByTime(segments, position)
|
||||
if segment = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
for each segment in segments
|
||||
segmentRange = segment["segment"]
|
||||
segmentStart = segmentRange[0]
|
||||
segmentEnd = segmentRange[1]
|
||||
currentPosition = m.top.position
|
||||
if (segmentStart < currentPosition) and ((segmentEnd - 1) > currentPosition)
|
||||
action = GetActionForSegment(segment)
|
||||
if m.preferences["sponsorblock.show_notifications"] = true
|
||||
SponsorBlock.ShowNotifcation(m.notifications, segment, action)
|
||||
end if
|
||||
action = segment.option
|
||||
|
||||
if action = "AutoSkip"
|
||||
duration = m.top.duration
|
||||
' Sometimes segmentEnd is greater than duration
|
||||
if duration > 0 and segmentEnd > duration
|
||||
segmentEnd = duration
|
||||
end if
|
||||
' If the segment is at the end of the video, skip the video instead of seeking
|
||||
if duration > 0 and Abs(segmentEnd - duration) < 2
|
||||
LogInfo("Skipping section:", segment["category"], "at end of video")
|
||||
SendSkippedSectionEvent(segment.UUID)
|
||||
OnVideoFinished()
|
||||
return
|
||||
else
|
||||
LogInfo("Skipping section:", segment["category"])
|
||||
SendSkippedSectionEvent(segment.UUID)
|
||||
m.top.seek = segmentEnd
|
||||
return
|
||||
end if
|
||||
end if
|
||||
' If we're close to the end of the segment, we don't want to show
|
||||
' 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)
|
||||
|
||||
if action = SegmentAction.ManualSkip
|
||||
' We'll save the segment here, and handle it in case the user
|
||||
' presses the OK button on the notification.
|
||||
m.manualSkipSegment = segment
|
||||
return
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
|
||||
if action = SegmentAction.AutoSkip
|
||||
SkipSegment(segment, position)
|
||||
end if
|
||||
end function
|
||||
|
||||
function GetActionForSegment(segment as object) as dynamic
|
||||
category = segment["category"]
|
||||
if category = "sponsor"
|
||||
return "AutoSkip"
|
||||
else if category = "poi_highlight"
|
||||
return "ManualSkip"
|
||||
else if category = "exclusive_access"
|
||||
return "ShowOverlay"
|
||||
else if category = "chapter"
|
||||
return "ShowOverlay"
|
||||
function SkipSegment(segment as object, position as dynamic) as void
|
||||
segmentEnd = segment.end
|
||||
|
||||
duration = m.top.duration
|
||||
' Sometimes segmentEnd is greater than duration
|
||||
if duration > 0 and segmentEnd > duration
|
||||
segmentEnd = duration
|
||||
end if
|
||||
return ""
|
||||
|
||||
' If we're skipping a very short distance, it's not worth it
|
||||
' since we can cause rebuffering
|
||||
if Abs(segmentEnd - position) < 2
|
||||
LogInfo("Skip position is within 2 seconds of segment end, not skipping")
|
||||
return
|
||||
end if
|
||||
|
||||
' If the segment is at the end of the video, skip the video instead of seeking
|
||||
if duration > 0 and Abs(segmentEnd - duration) < 2
|
||||
LogInfo("Skipping section:", segment.category, "at end of video")
|
||||
OnVideoFinished()
|
||||
else
|
||||
LogInfo("Skipping section:", segment.category)
|
||||
m.top.seek = segmentEnd
|
||||
end if
|
||||
SendSkippedSectionEvent(segment.UUID)
|
||||
end function
|
||||
|
||||
function ManualSkipSegment() as boolean
|
||||
segment = m.manualSkipSegment
|
||||
if segment = invalid
|
||||
return false
|
||||
end if
|
||||
|
||||
m.manualSkipSegment = invalid
|
||||
|
||||
notification = SponsorBlock.GetCurrentNotification(m.notifications)
|
||||
if notification = invalid
|
||||
return false
|
||||
end if
|
||||
|
||||
notificationSegmentId = notification.segmentId
|
||||
if notificationSegmentId <> segment.UUID
|
||||
return false
|
||||
end if
|
||||
|
||||
position = m.top.position
|
||||
if (position < segment.start) or (segment.end < position)
|
||||
return false
|
||||
end if
|
||||
|
||||
SkipSegment(segment, position)
|
||||
SponsorBlock.RemoveNotifcation(m.notifications)
|
||||
return true
|
||||
end function
|
||||
|
||||
function SendSkippedSectionEvent(segmentId as string)
|
||||
AsyncTask.Start(Tasks.SponsorBlockSegmentViewedTask, { segmentId: segmentId })
|
||||
if m.sponsorSkipEventTask <> invalid
|
||||
m.sponsorSkipEventTask.cancel = true
|
||||
end if
|
||||
|
||||
m.sponsorSkipEventTask = AsyncTask.Start(Tasks.SponsorBlockSegmentViewedTask, { segmentId: segmentId })
|
||||
end function
|
||||
|
||||
end namespace
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace SponsorBlock
|
||||
|
||||
enum SegmentAction
|
||||
' Disable: we do not care about this segment.
|
||||
Disable = "disable"
|
||||
' AutoSkip: we want to skip this segment automatically.
|
||||
AutoSkip = "auto_skip"
|
||||
' ManualSkip: we want to skip this segment manually, by showing a notification.
|
||||
' The user would have to press the skip button on the notification.
|
||||
ManualSkip = "manual_skip"
|
||||
' ShowInSeekbar: we want to show this segment in the seekbar, but not skip it.
|
||||
' No notification will be shown
|
||||
ShowInSeekbar = "show_in_seekbar"
|
||||
end enum
|
||||
|
||||
end namespace
|
||||
@@ -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
|
||||
"ctt": loungeServiceNode.ctt
|
||||
"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
|
||||
@@ -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
|
||||
@@ -518,6 +525,10 @@ function HideUIAndStopTimer()
|
||||
end function
|
||||
|
||||
function HandleOKPress() as boolean
|
||||
if SponsorBlock.ManualSkipSegment()
|
||||
return false
|
||||
end if
|
||||
|
||||
if not m.showUIEnabled
|
||||
return false
|
||||
end if
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</interface>
|
||||
<children>
|
||||
<Label id="chapterLabel" width="350" height="25" horizAlign="center" vertAlign="center" font="font:SmallestSystemFont" />
|
||||
<Timer id="chapterLabelTimer" repeat="true" duration="0.25" />
|
||||
<Timer id="chapterLabelTimer" repeat="true" duration="0.5" />
|
||||
<Animation id="minimizeAnimation" duration="0.3" optional="true">
|
||||
<FloatFieldInterpolator id="widthInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.width" />
|
||||
<FloatFieldInterpolator id="heightInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.height" />
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<function name="PlayWithContent" />
|
||||
</interface>
|
||||
<children>
|
||||
<SimpleLabel
|
||||
text="Dev Player!"
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<SimpleLabel text="Dev Player!"
|
||||
color="#FF0000"
|
||||
fontUri="font:SmallestBoldSystemFont"
|
||||
horizOrigin="right"
|
||||
|
||||
@@ -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
|
||||
+37
@@ -69,6 +69,12 @@ namespace Http
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
continuation = request.query.continuation
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
options.continuation = continuation
|
||||
@@ -141,6 +147,12 @@ namespace Http
|
||||
options = {
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
continuation = request.query.continuation
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
options.continuation = continuation
|
||||
@@ -188,6 +200,11 @@ namespace Http
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
continuation = request.query.continuation
|
||||
hasContinuation = not StringUtils.IsNullOrEmpty(continuation)
|
||||
if hasContinuation
|
||||
@@ -302,6 +319,11 @@ namespace Http
|
||||
"disableShorts": m.preferences["content_feed.disable_shorts"]
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
continuation = request.query.continuation
|
||||
if not StringUtils.IsNullOrEmpty(continuation)
|
||||
options.continuation = continuation
|
||||
@@ -589,6 +611,11 @@ namespace Http
|
||||
accessToken = request.headers["authorization"]
|
||||
if not StringUtils.IsNullOrEmpty(accessToken) and accessToken.StartsWith("Bearer ")
|
||||
options["accessToken"] = accessToken.Mid("Bearer ".Len())
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
end if
|
||||
|
||||
if playlistId.StartsWith("RD")
|
||||
@@ -781,6 +808,11 @@ namespace Http
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
result = InnertubeService.SubscribeToChannel(channelId, options)
|
||||
|
||||
if result.success <> true
|
||||
@@ -836,6 +868,11 @@ namespace Http
|
||||
"accessToken": accessToken.Mid("Bearer ".Len())
|
||||
}
|
||||
|
||||
activeIdentifyToken = request.query.activeIdentifyToken
|
||||
if not StringUtils.IsNullOrEmpty(activeIdentifyToken)
|
||||
options.onBehalfOfUser = activeIdentifyToken
|
||||
end if
|
||||
|
||||
result = InnertubeService.UnsubscribeFromChannel(channelId, options)
|
||||
|
||||
if result.success <> 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
|
||||
|
||||
@@ -128,6 +128,52 @@
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
},
|
||||
{
|
||||
displayText: "Categories",
|
||||
key: "sponsorblock.categories",
|
||||
description: "Configure which segments to skip",
|
||||
type: "assocarray",
|
||||
visibility: "tv",
|
||||
rokuComponent: "SponsorBlockCategoriesControl",
|
||||
defaultValue: {
|
||||
// TODO:P1 support for exclusive_access and chapter
|
||||
// TODO:P1 support for manual skip for poi_highlight
|
||||
sponsor: {
|
||||
option: "auto_skip",
|
||||
},
|
||||
selfpromo: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
interaction: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
poi_highlight: {
|
||||
option: "show_in_seekbar",
|
||||
},
|
||||
intro: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
outro: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
preview: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
filler: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
music_offtopic: {
|
||||
option: "manual_skip",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayText: "Categories",
|
||||
key: "sponsorblock.categories",
|
||||
description: "Configure which segments to skip",
|
||||
visibility: "web",
|
||||
svelteComponent: "SponsorBlockCategoriesControl",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,116 +1,70 @@
|
||||
{
|
||||
serverAddress: 'https://sponsor.ajay.app',
|
||||
serverAddress: "https://sponsor.ajay.app",
|
||||
categoryList: [
|
||||
'sponsor',
|
||||
'selfpromo',
|
||||
'exclusive_access',
|
||||
'interaction',
|
||||
'poi_highlight',
|
||||
'intro',
|
||||
'outro',
|
||||
'preview',
|
||||
'filler',
|
||||
'chapter',
|
||||
'music_offtopic',
|
||||
"sponsor",
|
||||
"selfpromo",
|
||||
"interaction",
|
||||
"poi_highlight",
|
||||
"intro",
|
||||
"outro",
|
||||
"preview",
|
||||
"filler",
|
||||
"music_offtopic",
|
||||
],
|
||||
categories: {
|
||||
sponsor: {
|
||||
title: 'Sponsor',
|
||||
short_title: 'Sponsor',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
'full',
|
||||
],
|
||||
color: '#00D400B3',
|
||||
title: "Sponsor",
|
||||
short_title: "Sponsor",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#00D400B3",
|
||||
},
|
||||
selfpromo: {
|
||||
title: 'Unpaid/Self Promotion',
|
||||
short_title: 'Unpaid/Self Promotion',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
'full',
|
||||
],
|
||||
color: '#FFFF00B3',
|
||||
},
|
||||
exclusive_access: {
|
||||
title: 'Exclusive Access',
|
||||
short_title: 'Exclusive Access',
|
||||
categorySupport: [
|
||||
'full',
|
||||
],
|
||||
color: '#008A5CB3',
|
||||
title: "Unpaid/Self Promotion",
|
||||
short_title: "Unpaid/Self Promotion",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#FFFF00B3",
|
||||
},
|
||||
interaction: {
|
||||
title: 'Interaction Reminder (Subscribe)',
|
||||
short_title: 'Interaction Reminder',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
],
|
||||
color: '#CC00FFB3',
|
||||
title: "Interaction Reminder (Subscribe)",
|
||||
short_title: "Interaction Reminder",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#CC00FFB3",
|
||||
},
|
||||
poi_highlight: {
|
||||
title: 'Highlight',
|
||||
short_title: 'Highlight',
|
||||
categorySupport: [
|
||||
'poi',
|
||||
],
|
||||
color: '#FF1684B3',
|
||||
title: "Highlight",
|
||||
short_title: "Highlight",
|
||||
options: ["show_in_seekbar", "disable"],
|
||||
color: "#FF1684B3",
|
||||
},
|
||||
intro: {
|
||||
title: 'Intermission/Intro Animation',
|
||||
short_title: 'Intermission',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
],
|
||||
color: '#00FFFFB3',
|
||||
title: "Intermission/Intro Animation",
|
||||
short_title: "Intermission",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#00FFFFB3",
|
||||
},
|
||||
outro: {
|
||||
title: 'Endcards/Credits',
|
||||
short_title: 'Endcards/Credits',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
],
|
||||
color: '#0202EDB3',
|
||||
title: "Endcards/Credits",
|
||||
short_title: "Endcards/Credits",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#0202EDB3",
|
||||
},
|
||||
preview: {
|
||||
title: 'Preview/Recap/Hook',
|
||||
// Note: short title renamed from "Preview/Recap/Hook" to "Preview/Recap" to fit in the UI
|
||||
short_title: 'Preview/Recap',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
],
|
||||
color: '#008FD6B3',
|
||||
title: "Preview/Recap/Hook",
|
||||
short_title: "Preview/Recap",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#008FD6B3",
|
||||
},
|
||||
filler: {
|
||||
title: 'Filler Tangent/Jokes',
|
||||
short_title: 'Filler',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
'mute',
|
||||
],
|
||||
color: '#7300FFE6',
|
||||
},
|
||||
chapter: {
|
||||
title: 'Chapter',
|
||||
short_title: 'Chapter',
|
||||
categorySupport: [
|
||||
'chapter',
|
||||
],
|
||||
color: '#FFFFFFC8',
|
||||
title: "Filler Tangent/Jokes",
|
||||
short_title: "Filler",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#7300FFE6",
|
||||
},
|
||||
music_offtopic: {
|
||||
title: 'Music: Non-Music Section',
|
||||
short_title: 'Non-Music',
|
||||
categorySupport: [
|
||||
'skip',
|
||||
],
|
||||
color: '#FF9900B3',
|
||||
title: "Music: Non-Music Section",
|
||||
short_title: "Non-Music",
|
||||
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
|
||||
color: "#FF9900B3",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1284,5 +1284,109 @@
|
||||
<source>Recommended</source>
|
||||
<translation>Empfohlen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable short videos.</source>
|
||||
<translation>Kurze Videos ausblenden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable Shorts</source>
|
||||
<translation>Shorts ausblenden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Backend</source>
|
||||
<translation>Backend</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Backend preferences</source>
|
||||
<translation>Backend-Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Selected backend</source>
|
||||
<translation>Ausgewähltes Backend</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The backend used for browsing and playing videos.</source>
|
||||
<translation>Das für das Durchstöbern und Anschauen von Videos genutzte Backend.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Content Feed</source>
|
||||
<translation>Inhalts-Feed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Feed preferences</source>
|
||||
<translation>Feed-Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disclaimer</source>
|
||||
<translation>Haftungsausschluss</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<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>
|
||||
@@ -264,6 +264,42 @@
|
||||
<source>Failed to get session data. Please restart Playlet to use the cast function.</source>
|
||||
<translation>Failed to get session data. Please restart Playlet to use the cast function.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a service to login</source>
|
||||
<translation>Select a service to login</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login to YouTube</source>
|
||||
<translation>Login to YouTube</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open the link %1 and enter the following code:</source>
|
||||
<translation>Open the link %1 and enter the following code:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disclaimer</source>
|
||||
<translation>Disclaimer</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>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.</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>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.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use responsibly, especially if your YouTube account is tied to business or monetization.</source>
|
||||
<translation>Use responsibly, especially if your YouTube account is tied to business or monetization.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Who's watching?</source>
|
||||
<translation>Who's watching?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No valid accounts found for YouTube login.</source>
|
||||
<translation>No valid accounts found for YouTube login.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invidious custom instance</source>
|
||||
<translation>Invidious custom instance</translation>
|
||||
@@ -320,6 +356,10 @@
|
||||
<source>Success</source>
|
||||
<translation>Success</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Refresh</source>
|
||||
<translation>Refresh</translation>
|
||||
@@ -844,6 +884,18 @@
|
||||
<source>Show notifications when a segment is skipped</source>
|
||||
<translation>Show notifications when a segment is skipped</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Categories</source>
|
||||
<translation>Categories</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure which segments to skip</source>
|
||||
<translation>Configure which segments to skip</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select option for %1</source>
|
||||
<translation>Select option for %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Search History</source>
|
||||
<translation>Search History</translation>
|
||||
@@ -964,6 +1016,26 @@
|
||||
<source>Skipped</source>
|
||||
<translation>Skipped</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Press OK to skip</source>
|
||||
<translation>Press OK to skip</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable</source>
|
||||
<translation>Disable</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auto Skip</source>
|
||||
<translation>Auto Skip</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Manual Skip</source>
|
||||
<translation>Manual Skip</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show in Seekbar</source>
|
||||
<translation>Show in Seekbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sponsor</source>
|
||||
<translation>Sponsor</translation>
|
||||
|
||||
@@ -2,7 +2,7 @@ title=PlayletLib
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=39
|
||||
minor_version=40
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
@@ -14,9 +14,10 @@ namespace AsyncTask
|
||||
task.id = id
|
||||
task.input = input
|
||||
|
||||
m[`asynctask_${id}`] = task
|
||||
m[`asynctask_${id}_callback`] = callback
|
||||
task.ObserveFieldScoped("state", FuncName(internal_OnTaskState))
|
||||
if callback <> invalid
|
||||
m[`asynctask_${id}_callback`] = callback
|
||||
task.ObserveFieldScoped("state", FuncName(internal_OnTaskState))
|
||||
end if
|
||||
|
||||
return task
|
||||
end function
|
||||
@@ -39,9 +40,6 @@ 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
|
||||
|
||||
@@ -86,6 +86,16 @@ namespace Locale
|
||||
LoungeFailedToGetLoungeToken = "Failed to get lounge token. Please restart Playlet to use the cast function."
|
||||
LoungeInvalidResponse = "Invalid response: %1"
|
||||
LoungeFailedToGetSessionData = "Failed to get session data. Please restart Playlet to use the cast function."
|
||||
' YouTube login
|
||||
SelectServiceToLogin = "Select a service to login"
|
||||
LoginToYouTube = "Login to YouTube"
|
||||
OpenLinkAndEnterFollowingCode = "Open the link %1 and enter the following code:"
|
||||
Disclaimer = "Disclaimer"
|
||||
YouTubeLoginDisclaimer1 = "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."
|
||||
YouTubeLoginDisclaimer2 = "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."
|
||||
YouTubeLoginDisclaimer3 = "Use responsibly, especially if your YouTube account is tied to business or monetization."
|
||||
WhosWatching = "Who's watching?"
|
||||
NoValidAccountsFound = "No valid accounts found for YouTube login."
|
||||
end enum
|
||||
|
||||
@locale
|
||||
@@ -106,6 +116,7 @@ namespace Locale
|
||||
Yes = "Yes"
|
||||
No = "No"
|
||||
Success = "Success"
|
||||
Error = "Error"
|
||||
end enum
|
||||
|
||||
@locale
|
||||
@@ -274,6 +285,9 @@ namespace Locale
|
||||
EnabledDescription = "Enable SponsorBlock"
|
||||
ShowNotifications = "Show notifications"
|
||||
ShowNotificationsDescription = "Show notifications when a segment is skipped"
|
||||
Categories = "Categories"
|
||||
CategoriesDescription = "Configure which segments to skip"
|
||||
SelectOptionFor = "Select option for %1"
|
||||
|
||||
SearchHistory = "Search History"
|
||||
SearchHistoryPreferences = "Search history preferences"
|
||||
@@ -322,6 +336,12 @@ namespace Locale
|
||||
@locale
|
||||
enum SponsorBlock
|
||||
Skipped = "Skipped"
|
||||
PressOkToSkip = "Press OK to skip"
|
||||
|
||||
Disable = "Disable"
|
||||
AutoSkip = "Auto Skip"
|
||||
ManualSkip = "Manual Skip"
|
||||
ShowInSeekbar = "Show in Seekbar"
|
||||
|
||||
SponsorTitle = "Sponsor"
|
||||
SelfPromoTitle = "Unpaid/Self Promotion"
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
namespace OptionUtils
|
||||
|
||||
function Get(opts as object, key as string, passthroughFunction = invalid as dynamic) as dynamic
|
||||
function Get(opts as object, key as string) as dynamic
|
||||
if opts = invalid
|
||||
if passthroughFunction = invalid
|
||||
return invalid
|
||||
end if
|
||||
return passthroughFunction(invalid)
|
||||
return invalid
|
||||
end if
|
||||
|
||||
return opts[key]
|
||||
end function
|
||||
|
||||
function GetOrDefault(opts as object, key as string, defaultValue as dynamic) as dynamic
|
||||
if opts = invalid or not opts.DoesExist(key)
|
||||
return defaultValue
|
||||
end if
|
||||
|
||||
value = opts[key]
|
||||
if value = invalid
|
||||
if passthroughFunction = invalid
|
||||
return invalid
|
||||
end if
|
||||
return passthroughFunction(invalid)
|
||||
return defaultValue
|
||||
end if
|
||||
|
||||
if passthroughFunction <> invalid
|
||||
return passthroughFunction(value)
|
||||
end if
|
||||
return value
|
||||
end function
|
||||
|
||||
|
||||
Generated
+107
-32
@@ -1,32 +1,34 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-web",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"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.3",
|
||||
"svelte": "^5.30.1",
|
||||
"postcss": "^8.5.4",
|
||||
"svelte": "^5.33.15",
|
||||
"svelte-check": "^4.2.1",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"terser": "^5.39.2",
|
||||
"terser": "^5.41.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": "^13.4.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"
|
||||
},
|
||||
@@ -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",
|
||||
@@ -3627,9 +3671,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"version": "3.3.11",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
|
||||
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3637,6 +3681,7 @@
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
@@ -3766,9 +3811,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.3",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
||||
"integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
|
||||
"version": "8.5.4",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz",
|
||||
"integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3786,7 +3831,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.8",
|
||||
"nanoid": "^3.3.11",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
},
|
||||
@@ -4371,9 +4416,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte": {
|
||||
"version": "5.30.1",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.30.1.tgz",
|
||||
"integrity": "sha512-QIYtKnJGkubWXtNkrUBKVCvyo9gjcccdbnvXfwsGNhvbeNNdQjRDTa/BiQcJ2kWXbXPQbWKyT7CUu53KIj1rfw==",
|
||||
"version": "5.33.15",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.33.15.tgz",
|
||||
"integrity": "sha512-068mFjz25qg+UTaWlnGEUfCX3VtypcODx3SbRUBvMfAnVim0jGs5q7M50SFKeI4EPvTe87cB1GJgMZhXAAc6OQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4592,9 +4637,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.39.2",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz",
|
||||
"integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==",
|
||||
"version": "5.41.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.41.0.tgz",
|
||||
"integrity": "sha512-H406eLPXpZbAX14+B8psIuvIr8+3c+2hkuYzpMkoE0ij+NdsVATbA78vb8neA/eqrj7rywa2pIkdmWRsXW6wmw==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
@@ -4712,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",
|
||||
@@ -4910,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/*"
|
||||
@@ -5049,6 +5108,22 @@
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/youtubei.js": {
|
||||
"version": "13.4.0",
|
||||
"resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-13.4.0.tgz",
|
||||
"integrity": "sha512-+fmIZU/dWAjsROONrASy1REwVpy6umAPVuoNLr/4iNmZXl84LyBef0n3hrd1Vn9035EuINToGyQcBmifwUEemA==",
|
||||
"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,32 +1,34 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.39.1",
|
||||
"version": "0.40.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
"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.3",
|
||||
"svelte": "^5.30.1",
|
||||
"postcss": "^8.5.4",
|
||||
"svelte": "^5.33.15",
|
||||
"svelte-check": "^4.2.1",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"terser": "^5.39.2",
|
||||
"terser": "^5.41.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": "^13.4.0"
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
playletStateStore,
|
||||
preferencesModelStore,
|
||||
searchHistoryStore,
|
||||
sponsorBlockConfigStore,
|
||||
userPreferencesStore,
|
||||
} from "lib/Stores";
|
||||
import BottomNavigation from "lib/BottomNavigation.svelte";
|
||||
@@ -24,7 +25,7 @@
|
||||
import RemoteControlScreen from "lib/Screens/RemoteControlScreen.svelte";
|
||||
import { fetchLocale } from "lib/Api/Locale";
|
||||
|
||||
onMount(async () => {
|
||||
onMount(() => {
|
||||
PlayletApi.getState().then((value) => {
|
||||
playletStateStore.set(value);
|
||||
fetchLocale(value.device?.current_locale);
|
||||
@@ -38,6 +39,10 @@
|
||||
homeLayoutFileStore.set(value);
|
||||
});
|
||||
|
||||
PlayletApi.getSponsorBlockConfigFile().then((value) => {
|
||||
sponsorBlockConfigStore.set(value);
|
||||
});
|
||||
|
||||
PlayletApi.getInvidiousVideoApiFile().then((apiDefinitions) => {
|
||||
invidiousVideoApiStore.set(apiDefinitions);
|
||||
});
|
||||
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user