diff --git a/package-lock.json b/package-lock.json index a35d0a85..f1486cc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "version": "0.19.1", "hasInstallScript": true, "devDependencies": { - "@rokucommunity/bslint": "^0.8.16", + "@rokucommunity/bslint": "^0.8.17", "@types/crypto-js": "^4.2.2", "@types/fs-extra": "^11.0.4", - "@types/node": "^20.11.7", + "@types/node": "^20.11.16", "@types/xml2js": "^0.4.14", "argparse": "^2.0.1", - "brighterscript": "0.65.18", - "brighterscript-formatter": "^1.6.39", + "brighterscript": "0.65.21", + "brighterscript-formatter": "^1.6.40", "convert-svg-to-png": "^0.6.4", "cross-fetch": "^4.0.0", "crypto-js": "^4.2.0", @@ -27,9 +27,9 @@ "imap": "^0.8.19", "ip": "^1.1.8", "json5": "^2.2.3", - "mailparser": "^3.6.6", + "mailparser": "^3.6.7", "roku-deploy": "^3.11.2", - "rooibos-roku": "^5.10.0", + "rooibos-roku": "^5.11.0", "semver": "^7.5.4", "shelljs": "^0.8.5", "ts-node": "^10.9.2", @@ -276,9 +276,9 @@ "dev": true }, "node_modules/@rokucommunity/bslint": { - "version": "0.8.16", - "resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.16.tgz", - "integrity": "sha512-+3FSL3/GFFFxsUAbQrRtBY8oZ+i7KL8DbshgtILpii2LsNuYXeeUy69gSn5OehcYHz+tmcR+ucBxlw1fNfOmfA==", + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.17.tgz", + "integrity": "sha512-e0ksPVYnN+QkhzuV97yPTf1NxSkBQZNMJRhlCFnMJf6gfps+VdY1HwYn3IlqDz3XJxfYcRSDa3v3fQ5dQynVEA==", "dev": true, "dependencies": { "fs-extra": "^10.0.0", @@ -370,9 +370,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.7.tgz", - "integrity": "sha512-GPmeN1C3XAyV5uybAf4cMLWT9fDWcmQhZVtMFu7OR32WjrqGG+Wnk2V1d0bmtUyE/Zy1QJ9BxyiTih9z8Oks8A==", + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -728,9 +728,9 @@ } }, "node_modules/brighterscript": { - "version": "0.65.18", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.18.tgz", - "integrity": "sha512-6RU9gE1wYMS8thQCBuUcwrGeDo8ywnMp7DKzS/Zl5yHqvU9LstBP6Z3vFxDFxxovYGhIy5o1B6OulnxPBD0pVA==", + "version": "0.65.21", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.21.tgz", + "integrity": "sha512-KijLoifDbIRf0wz/Zwv8FKFYTQIbgb5nSDepRG9D5YbNf+nd7F+4MWpKoS1YDfhaFZsBhvVjm+BpROgEspJpdQ==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -771,12 +771,12 @@ } }, "node_modules/brighterscript-formatter": { - "version": "1.6.39", - "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.39.tgz", - "integrity": "sha512-etA0vLVVUAIVP5qjXrCvqzibLyzndh/4TREij7LfB6R5IjbxlMnuw4r5GpjkPiZTVYAMSfRnwPtvb0FcdCT9Ow==", + "version": "1.6.40", + "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.40.tgz", + "integrity": "sha512-cxvGGluNfxy6p3khtcMt/3AschwqEnERjLRIEt3XVU0R0l2QgwXelDp8ViqgnQ2hQYa8LnfnOiV1u7OCqbiZPA==", "dev": true, "dependencies": { - "brighterscript": "^0.65.18", + "brighterscript": "^0.65.19", "glob-all": "^3.3.0", "jsonc-parser": "^3.0.0", "source-map": "^0.7.3", @@ -2980,9 +2980,9 @@ } }, "node_modules/mailparser": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.6.tgz", - "integrity": "sha512-noCjBl3FToxmqTP2fp7z17hQsiCroWNntfTd8O+UejOAF59xeN5WGZK27ilexXV2e2X/cbUhG3L8sfEKaz0/sw==", + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.7.tgz", + "integrity": "sha512-/3x8HW70DNehw+3vdOPKdlLuxOHoWcGB5jfx5vJ5XUbY9/2jUJbrrhda5Si8Dj/3w08U0y5uGAkqs5+SPTPKoA==", "dev": true, "dependencies": { "encoding-japanese": "2.0.0", @@ -2992,7 +2992,7 @@ "libmime": "5.2.1", "linkify-it": "5.0.0", "mailsplit": "5.4.0", - "nodemailer": "6.9.8", + "nodemailer": "6.9.9", "tlds": "1.248.0" } }, @@ -3200,9 +3200,9 @@ } }, "node_modules/nodemailer": { - "version": "6.9.8", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.8.tgz", - "integrity": "sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ==", + "version": "6.9.9", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz", + "integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==", "dev": true, "engines": { "node": ">=6.0.0" @@ -3994,9 +3994,9 @@ } }, "node_modules/rooibos-roku": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz", - "integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.11.0.tgz", + "integrity": "sha512-qxTYwsyp6Ihb6B8tmFm+24DE/s2gMCxagvdABElGWgqL834M+kZtmwrQXvSrMkM+0gkmQfIDuw1M4v484gycYQ==", "dev": true, "dependencies": { "source-map": "^0.7.3", diff --git a/package.json b/package.json index 1fe537b3..db6d52d7 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,14 @@ "version": "0.19.1", "description": "Unofficial Youtube client for Roku", "devDependencies": { - "@rokucommunity/bslint": "^0.8.16", + "@rokucommunity/bslint": "^0.8.17", "@types/crypto-js": "^4.2.2", "@types/fs-extra": "^11.0.4", - "@types/node": "^20.11.7", + "@types/node": "^20.11.16", "@types/xml2js": "^0.4.14", "argparse": "^2.0.1", - "brighterscript": "0.65.18", - "brighterscript-formatter": "^1.6.39", + "brighterscript": "0.65.21", + "brighterscript-formatter": "^1.6.40", "convert-svg-to-png": "^0.6.4", "cross-fetch": "^4.0.0", "crypto-js": "^4.2.0", @@ -21,9 +21,9 @@ "imap": "^0.8.19", "ip": "^1.1.8", "json5": "^2.2.3", - "mailparser": "^3.6.6", + "mailparser": "^3.6.7", "roku-deploy": "^3.11.2", - "rooibos-roku": "^5.10.0", + "rooibos-roku": "^5.11.0", "semver": "^7.5.4", "shelljs": "^0.8.5", "ts-node": "^10.9.2", diff --git a/playlet-lib/src/components/MainScene.transpiled.xml b/playlet-lib/src/components/MainScene.transpiled.xml index fe42c1a2..b8397366 100644 --- a/playlet-lib/src/components/MainScene.transpiled.xml +++ b/playlet-lib/src/components/MainScene.transpiled.xml @@ -8,6 +8,7 @@ + diff --git a/playlet-lib/src/components/Services/Dash/DashManifest.bs b/playlet-lib/src/components/Services/Dash/DashManifest.bs index ba922028..3b96356c 100644 --- a/playlet-lib/src/components/Services/Dash/DashManifest.bs +++ b/playlet-lib/src/components/Services/Dash/DashManifest.bs @@ -73,11 +73,10 @@ class DashManifest end if if xml.Node("AdaptationSet", adaptationSetAttributes) - xml.Node("Role", { + xml.EmptyNode("Role", { "schemeIdUri": "urn:mpeg:dash:role:2011" "value": audioSet.acont = "original" ? "main" : "alternate" }) - xml.End() for i = 0 to audioStreams.Count() - 1 stream = audioStreams[i] @@ -100,31 +99,23 @@ class DashManifest "bandwidth": stream.bitrate }) - xml.Node("AudioChannelConfiguration", { + xml.EmptyNode("AudioChannelConfiguration", { "schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011" "value": `${stream.audioChannels}` }) - xml.End() - if xml.Node("BaseURL") - xml.Text(stream.url) - xml.End() - end if + xml.TextNode("BaseURL", stream.url) + + if xml.Node("SegmentBase", { "indexRange": stream.index }) + xml.EmptyNode("Initialization", { "range": stream.init }) - if xml.Node("SegmentBase", { - "indexRange": stream.index - }) - if xml.Node("Initialization", { - "range": stream.init - }) - xml.End() - end if xml.End() end if xml.End() end if end for + xml.End() end if @@ -178,14 +169,9 @@ class DashManifest xml.End() end if - if xml.Node("SegmentBase", { - "indexRange": stream.index - }) - if xml.Node("Initialization", { - "range": stream.init - }) - xml.End() - end if + if xml.Node("SegmentBase", { "indexRange": stream.index }) + xml.EmptyNode("Initialization", { "range": stream.init }) + xml.End() end if @@ -249,12 +235,11 @@ class DashManifest "mimeType": "image/jpeg" "contentType": "image" }) - xml.Node("SegmentTemplate", { + xml.EmptyNode("SegmentTemplate", { "media": url "duration": duration "startNumber": 0 }) - xml.End() if xml.Node("Representation", { "id": `thumbnails_${id}` @@ -263,11 +248,10 @@ class DashManifest "height": storyboardHeightInPixels }) - xml.Node("EssentialProperty", { + xml.EmptyNode("EssentialProperty", { "schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile" "value": `${storyboardWidth}x${storyboardHeight}` }) - xml.End() xml.End() end if @@ -399,11 +383,10 @@ class DashManifest if videoStream.colorInfo.primaries <> invalid primaries = m.colorInfo.primaries[videoStream.colorInfo.primaries] if primaries <> invalid - xml.Node("EssentialProperty", { + xml.EmptyNode("EssentialProperty", { "schemeIdUri": "urn:mpeg:mpegB:cicp:ColourPrimaries" "value": primaries }) - xml.End() else LogWarn("Unknown colorInfo.primaries:", videoStream.colorInfo.primaries) end if @@ -412,11 +395,10 @@ class DashManifest if videoStream.colorInfo.transferCharacteristics <> invalid transferCharacteristics = m.colorInfo.transferCharacteristics[videoStream.colorInfo.transferCharacteristics] if transferCharacteristics <> invalid - xml.Node("EssentialProperty", { + xml.EmptyNode("EssentialProperty", { "schemeIdUri": "urn:mpeg:mpegB:cicp:TransferCharacteristics" "value": transferCharacteristics }) - xml.End() else LogWarn("Unknown colorInfo.transferCharacteristics:", videoStream.colorInfo.transferCharacteristics) end if @@ -425,11 +407,10 @@ class DashManifest if videoStream.colorInfo.matrixCoefficients <> invalid matrixCoefficients = m.colorInfo.matrixCoefficients[videoStream.colorInfo.matrixCoefficients] if matrixCoefficients <> invalid - xml.Node("EssentialProperty", { + xml.EmptyNode("EssentialProperty", { "schemeIdUri": "urn:mpeg:mpegB:cicp:MatrixCoefficients" "value": matrixCoefficients }) - xml.End() else LogWarn("Unknown colorInfo.matrixCoefficients:", videoStream.colorInfo.matrixCoefficients) end if diff --git a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs index ddef96a3..3f2f2f74 100644 --- a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs +++ b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs @@ -505,14 +505,22 @@ We apologize for the inconvenience.` function VerifyTokenScope(token as string) as boolean tokenObject = ParseJson(token) if tokenObject = invalid + LogWarn("Failed to json parse token:", token) return false end if if not IsArray(tokenObject.scopes) + LogWarn("Token scopes are not an array:", tokenObject.scopes) return false end if scopes = tokenObject.scopes.join(",") - return scopes = Invidious.AUTH_SCOPES + expectedScopes = Invidious.AUTH_SCOPES + validScopes = expectedScopes = scopes + + if not validScopes + LogWarn(`Token scopes do not match expected scopes. Expected: "${expectedScopes}", got: "${scopes}"`) + end if + return validScopes end function function DeleteAuthToken() diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs index 7dfd6dbc..31cccfb8 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs @@ -58,11 +58,11 @@ namespace Http m.http_code = errcode buffer = `