Compare commits

..
25 Commits
Author SHA1 Message Date
Brahim Hadriche b80b067afb Release v0.43.4 (#777) 2025-11-03 13:36:02 -05:00
Brahim Hadriche 777b36852f Fallback for post live dvr and OTF videos 2025-11-03 13:23:05 -05:00
Brahim Hadriche dd1cd8db97 update dependencies (#773) 2025-11-02 09:27:27 -05:00
Brahim Hadriche a1caa78e6e [skip ci] Fallback to iOS HLS for post dvr videos 2025-10-30 16:44:47 -04:00
Brahim Hadriche 4d1e46cbcc Fix playback error when regular videos are returned with DRM protection 2025-10-30 16:00:16 -04:00
Brahim Hadriche f59ed85b62 [skip ci] capture player error position and duration 2025-10-30 12:14:09 -04:00
Brahim Hadriche ad0c363ae0 Release v0.43.3 (#772) 2025-10-30 09:23:04 -04:00
Brahim Hadriche d8a86f88e1 [skip ci] channel parsing 2025-10-30 09:18:15 -04:00
Brahim Hadriche 9dd634e8dd [skip ci] capture url errors 2025-10-30 08:58:11 -04:00
Brahim Hadriche ba876be76d Filter out promo tiles 2025-10-29 20:21:13 -04:00
Brahim Hadriche 2fa3df7aae test fix 2025-10-29 20:20:53 -04:00
Brahim Hadriche 0d1da36e28 Release v0.43.2 (#770) 2025-10-29 13:43:15 -04:00
Brahim Hadriche c61c8aecc6 [skip ci] req id filtering 2025-10-29 13:37:53 -04:00
Brahim Hadriche 7a63b26c73 grid movie renderer 2025-10-29 13:35:24 -04:00
Brahim Hadriche 0d949b1752 byte array slice fix 2025-10-29 09:29:34 -04:00
Brahim Hadriche 33518607c5 parse radioRenderer 2025-10-28 20:25:59 -04:00
Brahim Hadriche 8a47c02179 capture different tiles 2025-10-28 19:46:01 -04:00
Brahim Hadriche a1251c065d Tweak LOCKUP_CONTENT_TYPE_SHORT 2025-10-28 19:45:50 -04:00
Brahim Hadriche 8882e3a03e Release v0.43.1 (#769) 2025-10-28 09:14:46 -04:00
Brahim Hadriche 3206d6a632 Capture player response 2025-10-28 09:09:36 -04:00
Brahim Hadriche b49a2ee05a [skip ci] Use cachefs for artifacts to avoid memory hog 2025-10-28 08:29:42 -04:00
Brahim Hadriche 963b44c8c8 [skip ci] Hls: fallback to original url if failed to fetch 2025-10-27 19:55:46 -04:00
Brahim Hadriche f3e60c639f Trickplay fix 2025-10-27 16:51:58 -04:00
Brahim Hadriche c216714c5b Additional capture for unimplemented nodes 2025-10-27 09:11:13 -04:00
Brahim Hadriche 460ae9a392 log movie related nodes 2025-10-26 18:19:40 -04:00
28 changed files with 751 additions and 372 deletions

No files matched your search

+29
View File
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.43.4] - 2025-11-03
### Fixed
- Playback error when regular videos are returned with DRM protection (unless they are OTF)
- Fallback to iOS HLS for post dvr and OTF videos
## [0.43.3] - 2025-10-30
### Fixed
- Improve channel parsing in Recommended feed
## [0.43.2] - 2025-10-29
### Fixed
- Crash on older Roku OS version due to `roByteArray.Slice` not being available
## [0.43.1] - 2025-10-28
### Added
- Support for additional nodes parsing
### Fixed
- Trickplay storyboards on DRM videos
## [0.43.0] - 2025-10-26 ## [0.43.0] - 2025-10-26
### Added ### Added
+33 -32
View File
@@ -1,21 +1,21 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.43.0", "version": "0.43.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.43.0", "version": "0.43.4",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.37", "@rokucommunity/bslint": "^0.8.38",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^24.9.1", "@types/node": "^24.9.2",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.70.2", "brighterscript": "0.70.3",
"brighterscript-formatter": "^1.7.19", "brighterscript-formatter": "^1.7.19",
"convert-svg-to-png": "^0.7.1", "convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
@@ -27,8 +27,8 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.7.5", "mailparser": "^3.7.5",
"protocol-buffers-schema": "^3.6.0", "protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.26.1", "puppeteer": "^24.27.0",
"roku-deploy": "^3.13.0", "roku-deploy": "^3.14.4",
"roku-test-automation": "^2.2.1", "roku-test-automation": "^2.2.1",
"rooibos-roku": "5.15.5", "rooibos-roku": "5.15.5",
"rounded-rect-9patch": "^1.1.2", "rounded-rect-9patch": "^1.1.2",
@@ -415,9 +415,9 @@
"dev": true "dev": true
}, },
"node_modules/@rokucommunity/bslint": { "node_modules/@rokucommunity/bslint": {
"version": "0.8.37", "version": "0.8.38",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.37.tgz", "resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.38.tgz",
"integrity": "sha512-22/1RqqI0S95Qd9XuSq9G9U/15pR9qOAQTKNjyZ2OQukWyhjEMJPdB7Yy2MOut56OjSwoJ1ihvWFeWN3snCccw==", "integrity": "sha512-HpAkxWHev3d/d9thJsSwjO8fP18IRspjI2xS95EAz0GIPrsEdWuazoa+dXwHcAHrJ8QDGVMBg2nyZRwyvt7hYw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -737,9 +737,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.9.1", "version": "24.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.2.tgz",
"integrity": "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==", "integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1280,9 +1280,9 @@
} }
}, },
"node_modules/brighterscript": { "node_modules/brighterscript": {
"version": "0.70.2", "version": "0.70.3",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.70.2.tgz", "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.70.3.tgz",
"integrity": "sha512-BHCZOKUNM4Pt7uLcA9JhQ17rxGnEz60dUdMfANTXGa8gYVjLNVd2WwVQS1L8roYRUuKXc83Hk01uxzmrcGmz9Q==", "integrity": "sha512-R9r/AWvxDZioTfDvRZT50yO+PAHl/nElKA3SO9eWfmF43J88CBEtLT1dpLfFPfmPfdtxjcF58ZW87rmcqqYVyA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1312,7 +1312,7 @@
"parse-ms": "^2.1.0", "parse-ms": "^2.1.0",
"readline": "^1.3.0", "readline": "^1.3.0",
"require-relative": "^0.8.7", "require-relative": "^0.8.7",
"roku-deploy": "^3.13.0", "roku-deploy": "^3.14.4",
"safe-json-stringify": "^1.2.0", "safe-json-stringify": "^1.2.0",
"serialize-error": "^7.0.1", "serialize-error": "^7.0.1",
"source-map": "^0.7.4", "source-map": "^0.7.4",
@@ -5318,9 +5318,9 @@
} }
}, },
"node_modules/puppeteer": { "node_modules/puppeteer": {
"version": "24.26.1", "version": "24.27.0",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.26.1.tgz", "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.27.0.tgz",
"integrity": "sha512-3RG2UqclzMFolM2fS4bN8t5/EjZ0VwEoAGVxG8PMGeprjLzj+x0U4auH7MQ4B6ftW+u1JUnTTN8ab4ABPdl4mA==", "integrity": "sha512-eEcAFGxmHRSrk74DVkFAMAwfj4l3Ak8avBuA2bZaAoocY1+Fb9WLS3I7jlOc/tIOU7EmGLiDdVP08R44wADpHw==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
@@ -5328,8 +5328,8 @@
"@puppeteer/browsers": "2.10.12", "@puppeteer/browsers": "2.10.12",
"chromium-bidi": "10.5.1", "chromium-bidi": "10.5.1",
"cosmiconfig": "^9.0.0", "cosmiconfig": "^9.0.0",
"devtools-protocol": "0.0.1508733", "devtools-protocol": "0.0.1521046",
"puppeteer-core": "24.26.1", "puppeteer-core": "24.27.0",
"typed-query-selector": "^2.12.0" "typed-query-selector": "^2.12.0"
}, },
"bin": { "bin": {
@@ -5460,9 +5460,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/puppeteer/node_modules/devtools-protocol": { "node_modules/puppeteer/node_modules/devtools-protocol": {
"version": "0.0.1508733", "version": "0.0.1521046",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1508733.tgz", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1521046.tgz",
"integrity": "sha512-QJ1R5gtck6nDcdM+nlsaJXcelPEI7ZxSMw1ujHpO1c4+9l+Nue5qlebi9xO1Z2MGr92bFOQTW7/rrheh5hHxDg==", "integrity": "sha512-vhE6eymDQSKWUXwwA37NtTTVEzjtGVfDr3pRbsWEQ5onH/Snp2c+2xZHWJJawG/0hCCJLRGt4xVtEVUVILol4w==",
"dev": true, "dev": true,
"license": "BSD-3-Clause" "license": "BSD-3-Clause"
}, },
@@ -5474,16 +5474,16 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/puppeteer/node_modules/puppeteer-core": { "node_modules/puppeteer/node_modules/puppeteer-core": {
"version": "24.26.1", "version": "24.27.0",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.26.1.tgz", "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.27.0.tgz",
"integrity": "sha512-YHZdo3chJ5b9pTYVnuDuoI3UX/tWJFJyRZvkLbThGy6XeHWC+0KI8iN0UMCkvde5l/YOk3huiVZ/PvwgSbwdrA==", "integrity": "sha512-yubwj2XXmTM3wRIpbhO5nCjbByPgpFHlgrsD4IK+gMPqO7/a5FfnoSXDKjmqi8A2M1Ewusz0rTI/r+IN0GU0MA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@puppeteer/browsers": "2.10.12", "@puppeteer/browsers": "2.10.12",
"chromium-bidi": "10.5.1", "chromium-bidi": "10.5.1",
"debug": "^4.4.3", "debug": "^4.4.3",
"devtools-protocol": "0.0.1508733", "devtools-protocol": "0.0.1521046",
"typed-query-selector": "^2.12.0", "typed-query-selector": "^2.12.0",
"webdriver-bidi-protocol": "0.3.8", "webdriver-bidi-protocol": "0.3.8",
"ws": "^8.18.3" "ws": "^8.18.3"
@@ -6355,9 +6355,9 @@
} }
}, },
"node_modules/roku-deploy": { "node_modules/roku-deploy": {
"version": "3.13.0", "version": "3.14.4",
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.13.0.tgz", "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.14.4.tgz",
"integrity": "sha512-Bmg2n/NzZmnydfsGeCtMiXagRkm3o4xB8OYGy33NT1+Ghn9tWeniDmzWO8/G3hTbqtqG/jYpWBpSuzVwUUaNGQ==", "integrity": "sha512-JWx+VetKadMPnGrc80cQCSaJSuTtR1tAA/3JiygFBJiK7gPYBCx8/2c9fq1wajuJ+t/0dqP7XYD/6v33nliFwA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -6375,6 +6375,7 @@
"moment": "^2.29.1", "moment": "^2.29.1",
"parse-ms": "^2.1.0", "parse-ms": "^2.1.0",
"postman-request": "^2.88.1-postman.40", "postman-request": "^2.88.1-postman.40",
"semver": "^7.7.3",
"temp-dir": "^2.0.0", "temp-dir": "^2.0.0",
"xml2js": "^0.5.0" "xml2js": "^0.5.0"
}, },
+6 -6
View File
@@ -1,15 +1,15 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.43.0", "version": "0.43.4",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.37", "@rokucommunity/bslint": "^0.8.38",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^24.9.1", "@types/node": "^24.9.2",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.70.2", "brighterscript": "0.70.3",
"brighterscript-formatter": "^1.7.19", "brighterscript-formatter": "^1.7.19",
"convert-svg-to-png": "^0.7.1", "convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
@@ -21,8 +21,8 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.7.5", "mailparser": "^3.7.5",
"protocol-buffers-schema": "^3.6.0", "protocol-buffers-schema": "^3.6.0",
"puppeteer": "^24.26.1", "puppeteer": "^24.27.0",
"roku-deploy": "^3.13.0", "roku-deploy": "^3.14.4",
"roku-test-automation": "^2.2.1", "roku-test-automation": "^2.2.1",
"rooibos-roku": "5.15.5", "rooibos-roku": "5.15.5",
"rounded-rect-9patch": "^1.1.2", "rounded-rect-9patch": "^1.1.2",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.43.0", "version": "0.43.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.43.0" "version": "0.43.4"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.43.0", "version": "0.43.4",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-app", "prebuild": "node ../tools/rm.js ../build/playlet-app",
+2 -2
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=43 minor_version=43
build_version=00000 build_version=00004
ui_resolutions=hd ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p uri_resolution_autosub=$$RES$$,480p,720p,1080p
@@ -38,4 +38,4 @@ playlet_lib_zip_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown git_commit_sha=unknown
bs_const=DEBUG=false;DEBUG_FALLBACK_TO_EMBEDDED=true bs_const=DEBUG=false;TEST_MODE=false;DEBUG_FALLBACK_TO_EMBEDDED=true
+8 -1
View File
@@ -35,7 +35,14 @@ namespace Logger
msg += `app_state: ${lastExitInfo.app_state}\n` msg += `app_state: ${lastExitInfo.app_state}\n`
msg += `media_player_state: ${lastExitInfo.media_player_state}\n` msg += `media_player_state: ${lastExitInfo.media_player_state}\n`
msg += `mem_limit: ${lastExitInfo.mem_limit}\n` msg += `mem_limit: ${lastExitInfo.mem_limit}\n`
msg += `console_log:\n${lastExitInfo.console_log}\n`
' Sometimes lastExitInfo.console_log would contain 'AppExitComplete', which
' is used to detect test runner exits. So we don't log it in test mode.
#if TEST_MODE
#else
msg += `console_log:\n${lastExitInfo.console_log}\n`
#end if
msg += `********** End Last Exit Info **********\n` msg += `********** End Last Exit Info **********\n`
print msg print msg
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.43.0", "version": "0.43.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.43.0" "version": "0.43.4"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.43.0", "version": "0.43.4",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-lib", "prebuild": "node ../tools/rm.js ../build/playlet-lib",
+13 -8
View File
@@ -59,14 +59,19 @@ function LoggerLoop()
DeleteFile(previousLogsFile) DeleteFile(previousLogsFile)
MoveFile(logsFile, previousLogsFile) MoveFile(logsFile, previousLogsFile)
startUpLogs = ReadAsciiFile(FILENAME_STARTUP) ' Sometimes lastExitInfo.console_log (which would be contained in startUpLogs)
if not StringUtils.IsNullOrEmpty(startUpLogs) ' would contain 'AppExitComplete', which is used to detect test runner exits.
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n` ' So we don't log it in test mode.
print line #if TEST_MODE
buffer.FromAsciiString(line) #else
buffer.AppendFile(logsFile) startUpLogs = ReadAsciiFile(FILENAME_STARTUP)
end if if not StringUtils.IsNullOrEmpty(startUpLogs)
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n`
print line
buffer.FromAsciiString(line)
buffer.AppendFile(logsFile)
end if
#end if
m.eventThrottleTimer = CreateObject("roTimespan") m.eventThrottleTimer = CreateObject("roTimespan")
appMemoryMonitor = CreateObject("roAppMemoryMonitor") appMemoryMonitor = CreateObject("roAppMemoryMonitor")
@@ -32,7 +32,7 @@ class DashManifest
} }
end function end function
function fromVideoMetadata(metadata as object, qualityFilter as object, local as boolean) as string function FromVideoMetadata(metadata as object, qualityFilter as object, local as boolean) as string
adaptiveFormats = [] adaptiveFormats = []
adaptiveFormats.Append(metadata.adaptiveFormats) adaptiveFormats.Append(metadata.adaptiveFormats)
@@ -56,6 +56,7 @@ class DashManifest
end if end if
if videoStreams.Count() = 0 if videoStreams.Count() = 0
lastPlayerResponse = ValidString(ReadAsciiFile("cachefs:/last_player_response.json"))
LogTelemetryEvent({ LogTelemetryEvent({
level: "error" level: "error"
message: "No video streams found in metadata for Dash." message: "No video streams found in metadata for Dash."
@@ -64,6 +65,10 @@ class DashManifest
filename: "metadata.json" filename: "metadata.json"
content_type: "application/json" content_type: "application/json"
data: FormatJson(metadata) data: FormatJson(metadata)
}, {
filename: "last_player_response.json"
content_type: "application/json"
data: lastPlayerResponse
}] }]
}) })
end if end if
@@ -86,214 +91,9 @@ class DashManifest
if xml.Node("Period") if xml.Node("Period")
id = 0 id = 0
for each audioSet in audioSets id = m.GenerateAudioAdaptationSets(xml, audioSets, audioStreams, id)
adaptationSetAttributes = { id = m.GenerateVideoAdaptationSets(xml, videoMimeTypes, videoStreams, id)
"id": `${id}` m.GenerateImageAdaptationSets(xml, storyboards, id)
"mimeType": audioSet.mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
}
if not StringUtils.IsNullOrEmpty(audioSet.lang)
adaptationSetAttributes["lang"] = audioSet.lang
end if
if xml.Node("AdaptationSet", adaptationSetAttributes)
xml.EmptyNode("Role", {
"schemeIdUri": "urn:mpeg:dash:role:2011"
"value": audioSet.acont = "original" ? "main" : "alternate"
})
for i = 0 to audioStreams.Count() - 1
stream = audioStreams[i]
streamMimeType = stream.type.Tokenize(";")[0]
if streamMimeType <> audioSet.mimeType or stream.languageInfo.lang <> audioSet.lang or stream.languageInfo.acont <> audioSet.acont
continue for
end if
codecs = stream.type.split("codecs=")[1]
if codecs.startsWith(`"`)
codecs = codecs.mid(1)
end if
if codecs.endsWith(`"`)
codecs = codecs.left(codecs.len() - 1)
end if
if xml.Node("Representation", {
"id": stream.itag
"codecs": codecs
"bandwidth": stream.bitrate
})
xml.EmptyNode("AudioChannelConfiguration", {
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
"value": `${stream.audioChannels}`
})
if StringUtils.IsNullOrEmpty(stream.url)
xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`)
else if stream.url.InStr("yt_live_broadcast") <> -1 or stream.url.InStr("yt_premiere_broadcast") <> -1
xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`)
end if
xml.TextNode("BaseURL", ValidString(stream.url))
if StringUtils.IsNullOrEmpty(stream.index) or StringUtils.IsNullOrEmpty(stream.init)
xml.Comment(`[ERROR] Stream index: ${stream.index}, init: ${stream.init} is invalid for itag: ${stream.itag}`)
end if
if xml.Node("SegmentBase", { "indexRange": stream.index })
xml.EmptyNode("Initialization", { "range": stream.init })
xml.End()
end if
xml.End()
end if
end for
xml.End()
end if
id += 1
end for
for each mimeType in videoMimeTypes
if xml.Node("AdaptationSet", {
"id": `${id}`
"mimeType": mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
})
for i = 0 to videoStreams.Count() - 1
stream = videoStreams[i]
streamMimeType = stream.type.Tokenize(";")[0]
if streamMimeType <> mimeType
continue for
end if
codecs = stream.type.split("codecs=")[1]
if codecs.startsWith(`"`)
codecs = codecs.mid(1)
end if
if codecs.endsWith(`"`)
codecs = codecs.left(codecs.len() - 1)
end if
representationAttributes = {
"id": stream.itag
"codecs": codecs
"startWithSAP": "1"
"maxPlayoutRate": "1"
"bandwidth": stream.bitrate
}
if stream.width <> invalid
representationAttributes["width"] = `${stream.width}`
end if
if stream.height <> invalid
representationAttributes["height"] = `${stream.height}`
end if
if stream.fps <> invalid
representationAttributes["frameRate"] = `${stream.fps}`
end if
if xml.Node("Representation", representationAttributes)
m.AddColorInfo(stream, xml)
if StringUtils.IsNullOrEmpty(stream.url)
xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`)
else if stream.url.InStr("yt_live_broadcast") <> -1 or stream.url.InStr("yt_premiere_broadcast") <> -1
xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`)
end if
xml.TextNode("BaseURL", ValidString(stream.url))
if StringUtils.IsNullOrEmpty(stream.index) or StringUtils.IsNullOrEmpty(stream.init)
xml.Comment(`[ERROR] Stream index: ${stream.index}, init: ${stream.init} is invalid for itag: ${stream.itag}`)
end if
if xml.Node("SegmentBase", { "indexRange": stream.index })
xml.EmptyNode("Initialization", { "range": stream.init })
xml.End()
end if
xml.End()
end if
end for
xml.End()
end if
id += 1
end for
' https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md#dash-standard-thumbnail-tiles
for each storyboard in storyboards
interval = ValidInt(storyboard.interval)
if interval = 0
LogWarnNoTelemetry("Invalid storyboard interval:", storyboard.interval)
continue for
end if
storyboardWidth = storyboard.storyboardWidth
storyboardHeight = storyboard.storyboardHeight
storyboardCount = storyboard.storyboardCount
tileWidthInPixels = storyboard.width
tileHeightInPixels = storyboard.height
totalTileCount = storyboard.count
' For the last page, the image height might be smaller than the storyboard height
if storyboardCount = 1
storyboardHeight = totalTileCount \ storyboardWidth
if totalTileCount mod storyboardWidth > 0
storyboardHeight += 1
end if
end if
intervalInSeconds = interval / 1000.0
' YouTube template uses the var $M for tile pages
' DASH-IF uses $Number$ in the SegmentTemplate
' https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf
url = storyboard.templateUrl.replace("$M", "$Number$")
tilesPerPage = storyboardWidth * storyboardHeight
duration = tilesPerPage * intervalInSeconds
storyboardWidthInPixels = tileWidthInPixels * storyboardWidth
storyboardHeightInPixels = tileHeightInPixels * storyboardHeight
' Bandwidth is kind of a guess...
bandwidth = ((storyboardWidthInPixels * storyboardHeightInPixels * 0.5) / duration)
if xml.Node("AdaptationSet", {
"id": `${id}`
"mimeType": "image/jpeg"
"contentType": "image"
})
xml.EmptyNode("SegmentTemplate", {
"media": url
"duration": duration
"startNumber": 0
})
if xml.Node("Representation", {
"id": `thumbnails_${id}`
"bandwidth": bandwidth
"width": storyboardWidthInPixels
"height": storyboardHeightInPixels
})
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
"value": `${storyboardWidth}x${storyboardHeight}`
})
xml.End()
end if
xml.End()
end if
id += 1
end for
xml.End() xml.End()
end if end if
@@ -303,6 +103,225 @@ class DashManifest
return xml.ToXmlString() return xml.ToXmlString()
end function end function
function GenerateAudioAdaptationSets(xml as object, audioSets as object, audioStreams as object, id as integer) as integer
for each audioSet in audioSets
adaptationSetAttributes = {
"id": `${id}`
"mimeType": audioSet.mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
}
if not StringUtils.IsNullOrEmpty(audioSet.lang)
adaptationSetAttributes["lang"] = audioSet.lang
end if
if xml.Node("AdaptationSet", adaptationSetAttributes)
xml.EmptyNode("Role", {
"schemeIdUri": "urn:mpeg:dash:role:2011"
"value": audioSet.acont = "original" ? "main" : "alternate"
})
for i = 0 to audioStreams.Count() - 1
stream = audioStreams[i]
streamMimeType = stream.type.Tokenize(";")[0]
if streamMimeType <> audioSet.mimeType or stream.languageInfo.lang <> audioSet.lang or stream.languageInfo.acont <> audioSet.acont
continue for
end if
codecs = stream.type.split("codecs=")[1]
if codecs.startsWith(`"`)
codecs = codecs.mid(1)
end if
if codecs.endsWith(`"`)
codecs = codecs.left(codecs.len() - 1)
end if
if xml.Node("Representation", {
"id": stream.itag
"codecs": codecs
"bandwidth": stream.bitrate
})
xml.EmptyNode("AudioChannelConfiguration", {
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
"value": `${stream.audioChannels}`
})
if StringUtils.IsNullOrEmpty(stream.url)
xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`)
else if stream.url.InStr("yt_live_broadcast") <> -1 or stream.url.InStr("yt_premiere_broadcast") <> -1
xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`)
end if
xml.TextNode("BaseURL", ValidString(stream.url))
if StringUtils.IsNullOrEmpty(stream.index) or StringUtils.IsNullOrEmpty(stream.init)
xml.Comment(`[ERROR] Stream index: ${stream.index}, init: ${stream.init} is invalid for itag: ${stream.itag}`)
end if
if xml.Node("SegmentBase", { "indexRange": stream.index, "indexRangeExact": "true" })
xml.EmptyNode("Initialization", { "range": stream.init })
xml.End()
end if
xml.End()
end if
end for
xml.End()
end if
id += 1
end for
return id
end function
function GenerateVideoAdaptationSets(xml as object, videoMimeTypes as object, videoStreams as object, id as integer) as integer
for each mimeType in videoMimeTypes
if xml.Node("AdaptationSet", {
"id": `${id}`
"mimeType": mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
})
for i = 0 to videoStreams.Count() - 1
stream = videoStreams[i]
streamMimeType = stream.type.Tokenize(";")[0]
if streamMimeType <> mimeType
continue for
end if
codecs = stream.type.split("codecs=")[1]
if codecs.startsWith(`"`)
codecs = codecs.mid(1)
end if
if codecs.endsWith(`"`)
codecs = codecs.left(codecs.len() - 1)
end if
representationAttributes = {
"id": stream.itag
"codecs": codecs
"startWithSAP": "1"
"maxPlayoutRate": "1"
"bandwidth": stream.bitrate
}
if stream.width <> invalid
representationAttributes["width"] = `${stream.width}`
end if
if stream.height <> invalid
representationAttributes["height"] = `${stream.height}`
end if
if stream.fps <> invalid
representationAttributes["frameRate"] = `${stream.fps}`
end if
if xml.Node("Representation", representationAttributes)
m.AddColorInfo(stream, xml)
if StringUtils.IsNullOrEmpty(stream.url)
xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`)
else if stream.url.InStr("yt_live_broadcast") <> -1 or stream.url.InStr("yt_premiere_broadcast") <> -1
xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`)
end if
xml.TextNode("BaseURL", ValidString(stream.url))
if StringUtils.IsNullOrEmpty(stream.index) or StringUtils.IsNullOrEmpty(stream.init)
xml.Comment(`[ERROR] Stream index: ${stream.index}, init: ${stream.init} is invalid for itag: ${stream.itag}`)
end if
if xml.Node("SegmentBase", { "indexRange": stream.index, "indexRangeExact": "true" })
xml.EmptyNode("Initialization", { "range": stream.init })
xml.End()
end if
xml.End()
end if
end for
xml.End()
end if
id += 1
end for
return id
end function
function GenerateImageAdaptationSets(xml as object, storyboards as object, id as integer) as integer
' https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md#dash-standard-thumbnail-tiles
for i = storyboards.Count() - 1 to 0 step -1
storyboard = storyboards[i]
interval = ValidInt(storyboard.interval)
if interval = 0
LogWarnNoTelemetry("Invalid storyboard interval:", storyboard.interval)
continue for
end if
storyboardWidth = storyboard.storyboardWidth
storyboardHeight = storyboard.storyboardHeight
storyboardCount = storyboard.storyboardCount
tileWidthInPixels = storyboard.width
tileHeightInPixels = storyboard.height
totalTileCount = storyboard.count
' For the last page, the image height might be smaller than the storyboard height
if storyboardCount = 1
storyboardHeight = totalTileCount \ storyboardWidth
if totalTileCount mod storyboardWidth > 0
storyboardHeight += 1
end if
end if
intervalInSeconds = interval / 1000.0
' YouTube template uses the var $M for tile pages
' DASH-IF uses $Number$ in the SegmentTemplate
' https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf
url = storyboard.templateUrl.replace("$M", "$Number$")
tilesPerPage = storyboardWidth * storyboardHeight
duration = tilesPerPage * intervalInSeconds
storyboardWidthInPixels = tileWidthInPixels * storyboardWidth
storyboardHeightInPixels = tileHeightInPixels * storyboardHeight
' Bandwidth is kind of a guess...
bandwidth = ((storyboardWidthInPixels * storyboardHeightInPixels * 0.5) / duration)
if xml.Node("AdaptationSet", {
"id": `${id}`
"mimeType": "image/jpeg"
"contentType": "image"
})
xml.EmptyNode("SegmentTemplate", {
"media": url
"duration": duration
"startNumber": 0
})
if xml.Node("Representation", {
"id": `thumbnails_${id}`
"bandwidth": bandwidth
"width": storyboardWidthInPixels
"height": storyboardHeightInPixels
})
xml.EmptyNode("EssentialProperty", {
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
"value": `${storyboardWidth}x${storyboardHeight}`
})
xml.End()
end if
xml.End()
end if
id += 1
end for
return id
end function
function getAudioStreams(streams as object) as object function getAudioStreams(streams as object) as object
audioStreams = [] audioStreams = []
for i = 0 to streams.Count() - 1 for i = 0 to streams.Count() - 1
@@ -81,16 +81,16 @@ namespace InnertubeService
end if end if
playerResponseJson = playerResponse.Json() playerResponseJson = playerResponse.Json()
isLive = Innertube.IsLiveStream(playerResponseJson) notDashSupported = Innertube.IsLiveStream(playerResponseJson) or Innertube.IsPostLiveDvr(playerResponseJson) or Innertube.IsTypeOTF(playerResponseJson)
if isLive and client = Innertube.ClientType.Tv if notDashSupported and client = Innertube.ClientType.Tv
LogDebug("Live video detected, falling back to iOS for HLS streams.") LogDebug("Falling back to iOS client for live/DVR/OTF video.")
isLoggedIn = Innertube.ParseIsLoggedIn(playerResponseJson) isLoggedIn = Innertube.ParseIsLoggedIn(playerResponseJson)
playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(playerResponseJson, isLoggedIn) playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(playerResponseJson, isLoggedIn)
client = Innertube.ClientType.IOS client = Innertube.ClientType.IOS
continue while continue while
end if end if
parsedResponse = Innertube.ParseInnertubePlayerResponse(playerResponseJson, {}, playerRequest, cancellation) parsedResponse = Innertube.ParseInnertubePlayerResponse(playerRequest, playerResponse, {}, cancellation)
if parsedResponse.error = invalid if parsedResponse.error = invalid
exit while exit while
@@ -93,25 +93,26 @@ namespace Innertube
"tvSurfaceContentContinuation": ParseTvSurfaceContentContinuation "tvSurfaceContentContinuation": ParseTvSurfaceContentContinuation
"gridButtonRenderer": ParseGridButtonRenderer "gridButtonRenderer": ParseGridButtonRenderer
"movieRenderer": ParseMovieRenderer "movieRenderer": ParseMovieRenderer
"gridMovieRenderer": ParseGridMovieRenderer
"compactMovieRenderer": ParseCompactMovieRenderer "compactMovieRenderer": ParseCompactMovieRenderer
"horizontalMovieListRenderer": ParseHorizontalMovieListRenderer
' Movies and shows are partially supported, but these renderers are not yet implemented.
' "gridMovieRenderer": ParseNotImplemented
' "gridShowRenderer": ParseNotImplemented
' "playlistShowMetadataRenderer": ParseNotImplemented
' Ignored nodes: ' Ignored nodes:
' TODO:P2 handle navigateAction - which are usually a redirect ' TODO:P2 handle navigateAction - which are usually a redirect
"navigateAction": ParseNotImplemented ' "navigateAction": ParseNotImplemented
' TODO:P2 radioRenderer seems like a Mix https://github.com/iBicha/playlet/issues/709 ' TODO:P2 radioRenderer seems like a Mix https://github.com/iBicha/playlet/issues/709
"radioRenderer": ParseNotImplemented "radioRenderer": ParseRadioRenderer
"compactRadioRenderer": ParseNotImplemented ' "compactRadioRenderer": ParseNotImplemented
' TODO:P2 A carousel of videos, found on the home tab of a channel. ' TODO:P2 A carousel of videos, found on the home tab of a channel.
' Should probably be parsed. ' Should probably be parsed.
"carouselItemRenderer": ParseNotImplemented ' "carouselItemRenderer": ParseNotImplemented
' When searching for hashtags, this renderer is used. ' When searching for hashtags, this renderer is used.
' It redirects to a page similar to a channel page, with browseId "FEhashtag" ' It redirects to a page similar to a channel page, with browseId "FEhashtag"
' the hashtag name is encoded in a proto and passed as a param to the browseEndpoint. ' the hashtag name is encoded in a proto and passed as a param to the browseEndpoint.
"hashtagTileRenderer": ParseNotImplemented "hashtagTileRenderer": ParseNotImplemented
' Movies and shows are partially supported, but these renderers are not yet implemented.
"horizontalMovieListRenderer": ParseNotImplemented
"gridMovieRenderer": ParseNotImplemented
"gridShowRenderer": ParseNotImplemented
"playlistShowMetadataRenderer": ParseNotImplemented
' Contains comments "teaser". ' Contains comments "teaser".
"commentsEntryPointHeaderRenderer": ParseNotImplemented "commentsEntryPointHeaderRenderer": ParseNotImplemented
' Contains the owner of the video from "videoPrimaryInfoRenderer" ' Contains the owner of the video from "videoPrimaryInfoRenderer"
@@ -997,6 +998,33 @@ namespace Innertube
return invalid return invalid
end function end function
function ParseRadioRenderer(nodeData as object, context as object) as object
playlistId = nodeData["playlistId"]
if not IsString(playlistId)
Warning("Invalid playlist ID in radioRenderer", nodeData, context)
return invalid
end if
videoCountText = ParseText(nodeData["videoCountText"])
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": ParseText(nodeData["title"])
"playlistThumbnail": ObjectUtils.Dig(nodeData, ["thumbnail", "thumbnails", 0, "url"])
"videoCountText": videoCountText
}
' Mixes have a videoId, which is the first video in the mix
videoId = ObjectUtils.Dig(nodeData, ["navigationEndpoint", "watchEndpoint", "videoId"])
if IsString(videoId)
playlist["videoId"] = videoId
end if
PushFeedItem(playlist, context)
return invalid
end function
function ParseGridShelfViewModel(nodeData as object, _context as object) as object function ParseGridShelfViewModel(nodeData as object, _context as object) as object
return nodeData["contents"] return nodeData["contents"]
end function end function
@@ -1100,6 +1128,16 @@ namespace Innertube
title = ObjectUtils.Dig(metadata, ["title", "content"]) title = ObjectUtils.Dig(metadata, ["title", "content"])
authorId = ObjectUtils.Dig(metadata, ["image", "decoratedAvatarViewModel", "rendererContext", "commandContext", "onTap", "innertubeCommand", "browseEndpoint", "browseId"]) authorId = ObjectUtils.Dig(metadata, ["image", "decoratedAvatarViewModel", "rendererContext", "commandContext", "onTap", "innertubeCommand", "browseEndpoint", "browseId"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "thumbnailViewModel"])
if context.generateVideoThumbnails = true
videoThumbnails = GenerateVideoThumbnails(videoId)
else
videoThumbnails = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources"])
if videoThumbnails = invalid
videoThumbnails = GenerateVideoThumbnails(videoId)
end if
end if
lines = invalid lines = invalid
contentMetadataViewModel = ObjectUtils.Dig(metadata, ["metadata", "contentMetadataViewModel"]) contentMetadataViewModel = ObjectUtils.Dig(metadata, ["metadata", "contentMetadataViewModel"])
metadataRows = ObjectUtils.Dig(contentMetadataViewModel, ["metadataRows"]) metadataRows = ObjectUtils.Dig(contentMetadataViewModel, ["metadataRows"])
@@ -1126,7 +1164,7 @@ namespace Innertube
"title": title "title": title
"authorId": authorId "authorId": authorId
"lines": lines "lines": lines
"videoThumbnails": GenerateVideoThumbnails(videoId) "videoThumbnails": videoThumbnails
} }
PushFeedItem(video, context) PushFeedItem(video, context)
@@ -1330,6 +1368,13 @@ namespace Innertube
return invalid return invalid
end if end if
' YouTube promo (purchase premium, etc) tileRenderer
thumbailUrl = ValidString(ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnail", "thumbnails", 0, "url"]))
if thumbailUrl.InStr("gstatic.com/youtube/img/promos") <> -1
LogWarnNoTelemetry("Skipping tileRenderer without contentType for YouTube promo")
return invalid
end if
' "More news" tileRenderer ' "More news" tileRenderer
browseId = ValidString(ObjectUtils.Dig(nodeData, ["onSelectCommand", "browseEndpoint", "browseId"])) browseId = ValidString(ObjectUtils.Dig(nodeData, ["onSelectCommand", "browseEndpoint", "browseId"]))
if browseId = "FEtopics_news" if browseId = "FEtopics_news"
@@ -1352,11 +1397,9 @@ namespace Innertube
else if contentType = "TILE_CONTENT_TYPE_PLAYLIST" else if contentType = "TILE_CONTENT_TYPE_PLAYLIST"
return TileRendererTypePlaylist(nodeData, context) return TileRendererTypePlaylist(nodeData, context)
else if contentType = "TILE_CONTENT_TYPE_CHANNEL" else if contentType = "TILE_CONTENT_TYPE_CHANNEL"
' Not implemented yet - https://github.com/iBicha/playlet/issues/724 return TileRendererTypeChannel(nodeData, context)
return invalid
else if contentType = "TILE_CONTENT_TYPE_EDU" else if contentType = "TILE_CONTENT_TYPE_EDU"
' Not implemented yet - https://github.com/iBicha/playlet/issues/751 ' Not implemented yet - https://github.com/iBicha/playlet/issues/751
return invalid
end if end if
Warning(`Unknown content type: ${contentType}`, nodeData, context) Warning(`Unknown content type: ${contentType}`, nodeData, context)
@@ -1556,6 +1599,42 @@ namespace Innertube
return invalid return invalid
end function end function
function TileRendererTypeChannel(nodeData as object, context as object) as object
channelId = nodeData["contentId"]
if not IsString(channelId)
Warning("Invalid channel ID in tileRendererTypeChannel", nodeData, context)
return invalid
end if
' TODO:P1 Channel IDs starting with "SC" are shows, not supported yet.
if channelId.StartsWith("SC")
LogWarnNoTelemetry("Shows are not supported yet in TileRendererTypeChannel")
return invalid
end if
renderedLines = []
lines = ObjectUtils.Dig(nodeData, ["metadata", "tileMetadataRenderer", "lines"])
if IsArray(lines)
for each line in lines
if not IsAssociativeArray(line)
continue for
end if
renderedLines.Push(ParseLineRenderer(line["lineRenderer"]))
end for
end if
channel = {
"type": "channel"
"authorId": channelId
"author": ParseText(ObjectUtils.Dig(nodeData, ["metadata", "tileMetadataRenderer", "title"]))
"authorThumbnails": ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnail", "thumbnails"])
"lines": renderedLines
}
PushFeedItem(channel, context)
return invalid
end function
function ParseTileRendererAuthorId(nodeData as object) as dynamic function ParseTileRendererAuthorId(nodeData as object) as dynamic
' We're checking in the long press menu if there's a browseId that starts with "UC". ' We're checking in the long press menu if there's a browseId that starts with "UC".
' This is usually the the id of the channel. ' This is usually the the id of the channel.
@@ -1758,6 +1837,59 @@ namespace Innertube
return invalid return invalid
end function end function
function ParseGridMovieRenderer(nodeData as object, context as object) as object
videoId = nodeData["videoId"]
if not IsString(videoId)
Warning("Invalid videoId in gridMovieRenderer", nodeData, context)
return invalid
end if
title = ParseText(nodeData["title"])
metadata = ParseText(nodeData["metadata"])
author = invalid
authorId = invalid
if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
author = context.currentAuthor
authorId = context.currentAuthorId
end if
lines = invalid
if metadata <> ""
lines = [author, metadata]
end if
lengthText = ParseText(nodeData["lengthText"])
if lengthText = ""
thumbnailOverlays = nodeData["thumbnailOverlays"]
if IsArray(thumbnailOverlays)
for each overlay in thumbnailOverlays
parsedTimeStatusRenderer = ParseThumbnailOverlayTimeStatusRenderer(overlay)
if parsedTimeStatusRenderer <> invalid
lengthText = parsedTimeStatusRenderer.text
if lengthText <> ""
exit for
end if
end if
end for
end if
end if
video = {
"type": "video"
"videoId": videoId
"title": title
"author": author
"authorId": authorId
"videoThumbnails": GenerateVideoThumbnails(videoId)
"lines": lines
"lengthText": lengthText
}
PushFeedItem(video, context)
return invalid
end function
function ParseCompactMovieRenderer(nodeData as object, context as object) as object function ParseCompactMovieRenderer(nodeData as object, context as object) as object
videoId = nodeData["videoId"] videoId = nodeData["videoId"]
if not IsString(videoId) if not IsString(videoId)
@@ -1800,6 +1932,10 @@ namespace Innertube
return invalid return invalid
end function end function
function ParseHorizontalMovieListRenderer(nodeData as object, _context as object) as object
return nodeData["items"]
end function
function ParseText(data as dynamic) as string function ParseText(data as dynamic) as string
if IsString(data) if IsString(data)
return data return data
@@ -67,7 +67,11 @@ namespace Innertube
return request return request
end function end function
function ParseInnertubePlayerResponse(payload as object, parsedResponse as object, playerRequest as dynamic, cancellation as object) as object function ParseInnertubePlayerResponse(playerRequest as dynamic, playerResponse as dynamic, parsedResponse as object, cancellation as object) as object
WriteAsciiFile("cachefs:/last_player_response.json", playerResponse.Text())
payload = playerResponse.Json()
error = ParsePlayerResponseForError(payload, playerRequest) error = ParsePlayerResponseForError(payload, playerRequest)
if error <> "" if error <> ""
parsedResponse["error"] = error parsedResponse["error"] = error
@@ -606,6 +610,10 @@ namespace Innertube
return false return false
end function end function
function IsPostLiveDvr(payload as object) as boolean
return ValidBool(ObjectUtils.Dig(payload, ["videoDetails", "isPostLiveDvr"]))
end function
function FormatsHaveLiveStreamingData(formats as object) as boolean function FormatsHaveLiveStreamingData(formats as object) as boolean
if not IsArray(formats) if not IsArray(formats)
return false return false
@@ -619,4 +627,22 @@ namespace Innertube
return false return false
end function end function
function IsTypeOTF(payload as object) as boolean
return FormatsHasTypeOTF(ObjectUtils.Dig(payload, ["streamingData", "adaptiveFormats"]))
end function
function FormatsHasTypeOTF(formats as object) as boolean
if not IsArray(formats)
return false
end if
for each fmt in formats
if ValidString(fmt["type"]) = "FORMAT_STREAM_TYPE_OTF"
return true
end if
end for
return false
end function
end namespace end namespace
+13 -28
View File
@@ -129,37 +129,22 @@ namespace Sentry
end function end function
function ReplaceRequestId(message as string) as dynamic function ReplaceRequestId(message as string) as dynamic
reqIdStart = `\nRequestId: ` requestIdRegex = m.requestIdRegex
reqIdPlaceholder = "<REQUEST_ID>" if requestIdRegex = invalid
result = message requestIdRegex = /RequestId:\s*[0-9]+/
replaced = false m.requestIdRegex = requestIdRegex
searchIndex = 0 end if
while true
requestIdIndex = result.InStr(searchIndex, reqIdStart)
if requestIdIndex = -1
exit while
end if
reqIdStartIndex = requestIdIndex + reqIdStart.Len() matches = requestIdRegex.MatchAll(message)
newLineIndex = result.InStr(reqIdStartIndex, `\n`) if not IsArray(matches) or matches.Count() = 0
if newLineIndex = -1
exit while
end if
reqIdEndIndex = newLineIndex - 1
if (reqIdEndIndex <= reqIdStartIndex) or ((reqIdEndIndex - reqIdStartIndex) > 20)
exit while
end if
result = result.Mid(0, reqIdStartIndex) + reqIdPlaceholder + result.Mid(reqIdEndIndex + 1)
replaced = true
searchIndex = reqIdStartIndex + reqIdPlaceholder.Len()
end while
if not replaced
return invalid return invalid
end if end if
return result for each match in matches
fullMatch = match[0]
message = message.Replace(fullMatch, "RequestId: <REQUEST_ID>")
end for
return message
end function end function
end namespace end namespace
@@ -17,8 +17,8 @@ function ExecuteJob() as void
return return
end if end if
DeleteFile("tmp:/last_generated_dash.xml") DeleteFile("cachefs:/last_generated_dash.xml")
DeleteFile("tmp:/last_generated_hls.m3u8") DeleteFile("cachefs:/last_generated_hls.m3u8")
if StringUtils.IsNullOrEmpty(contentNode.videoId) if StringUtils.IsNullOrEmpty(contentNode.videoId)
JobError("Can't load video information: videoId is missing") JobError("Can't load video information: videoId is missing")
@@ -103,8 +103,8 @@ function ExecuteJob() as void
return return
end if end if
isDrmDash = SupportsDrmDashManifest(metadata) isDrm = not StringUtils.IsNullOrEmpty(metadata.drmParams)
if isDrmDash if isDrm
licenseServerURL = UrlUtils.BuildUrl(`http://127.0.0.1:${playletServerPort}/api/innertube/get_drm_license`, invalid, { licenseServerURL = UrlUtils.BuildUrl(`http://127.0.0.1:${playletServerPort}/api/innertube/get_drm_license`, invalid, {
videoId: metadata.videoId videoId: metadata.videoId
drmParams: metadata.drmParams drmParams: metadata.drmParams
@@ -129,8 +129,12 @@ function ExecuteJob() as void
playletStreamUrlIndex: 0 playletStreamUrlIndex: 0
}) })
LogDebug("Setting first url:", streamUrls[0]) firstUrl = streamUrls[0]
contentNode.url = streamUrls[0] LogDebug("Setting first url:", firstUrl)
if StringUtils.IsNullOrEmpty(firstUrl)
LogError("First stream URL is empty!")
end if
contentNode.url = firstUrl
SetCaptions(metadata, service, contentNode) SetCaptions(metadata, service, contentNode)
@@ -146,8 +150,11 @@ function CreateStreamUrls(metadata as object, service as Invidious.InvidiousServ
streamUrls = [] streamUrls = []
if SupportsDrmDashManifest(metadata) if SupportsDrmDashManifestUrl(metadata)
streamUrls.push(metadata.dashUrl) dashUrl = UrlUtils.AppendQueryParams(`http://127.0.0.1:${playletServerPort}/api/dash`, {
url: metadata.dashUrl
})
streamUrls.push(dashUrl)
else if SupportsHls(metadata) else if SupportsHls(metadata)
metadata.hlsUrl = AddInstanceToUrlIfNeeded(metadata.hlsUrl, instance) metadata.hlsUrl = AddInstanceToUrlIfNeeded(metadata.hlsUrl, instance)
AddHlsUrls(streamUrls, metadata, preferredQuality, backend, proxyVideos, playletServerPort) AddHlsUrls(streamUrls, metadata, preferredQuality, backend, proxyVideos, playletServerPort)
@@ -188,11 +195,15 @@ function SupportsMuxedFormats(metadata as object) as boolean
return IsArray(metadata.formatStreams) and metadata.formatStreams.Count() > 0 return IsArray(metadata.formatStreams) and metadata.formatStreams.Count() > 0
end function end function
function SupportsDrmDashManifest(metadata as object) as boolean function SupportsDrmDashManifestUrl(metadata as object) as boolean
if StringUtils.IsNullOrEmpty(metadata.drmParams) if StringUtils.IsNullOrEmpty(metadata.drmParams)
return false return false
end if end if
if StringUtils.IsNullOrEmpty(metadata.dashUrl)
return false
end if
if StringUtils.IsNullOrEmpty(metadata.drmSessionId) if StringUtils.IsNullOrEmpty(metadata.drmSessionId)
return false return false
end if end if
@@ -205,10 +216,6 @@ function SupportsDrmDashManifest(metadata as object) as boolean
return false return false
end if end if
if StringUtils.IsNullOrEmpty(metadata.dashUrl)
return false
end if
return true return true
end function end function
@@ -460,10 +460,11 @@ function OnVideoPlayerStateChange() as void
content.playletStreamUrlIndex = playletStreamUrlIndex content.playletStreamUrlIndex = playletStreamUrlIndex
if playletStreamUrlIndex < playletStreamUrls.Count() if playletStreamUrlIndex < playletStreamUrls.Count()
nextUrl = playletStreamUrls[playletStreamUrlIndex] nextUrl = playletStreamUrls[playletStreamUrlIndex]
LogErrorNoTelemetry(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`) msg = `Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`
LogErrorNoTelemetry(msg)
LogTelemetryEvent({ LogTelemetryEvent({
level: "error" level: "error"
message: `Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}` message: msg
fingerprint: ["Stream <URL> failed to play. Trying next stream <URL>"] fingerprint: ["Stream <URL> failed to play. Trying next stream <URL>"]
}) })
@@ -557,34 +558,32 @@ function GetPlayerErrorData(videoId as string, errorInfo as object) as object
end function end function
function ReportVideoError(errorData as object, url as string) as void function ReportVideoError(errorData as object, url as string) as void
if errorData.body.Instr("DRM exception") <> -1
return
end if
attachments = invalid attachments = invalid
if errorData.body.Instr("malformed data") <> -1 or errorData.body.Instr("invalid pathname") <> -1 if errorData.body.Instr("malformed data") <> -1 or errorData.body.Instr("invalid pathname") <> -1
lastGeneratedDash = ReadAsciiFile("tmp:/last_generated_dash.xml") lastGeneratedDash = ValidString(ReadAsciiFile("cachefs:/last_generated_dash.xml"))
if not StringUtils.IsNullOrEmpty(lastGeneratedDash) lastGeneratedHls = ValidString(ReadAsciiFile("cachefs:/last_generated_hls.m3u8"))
attachments = [{ lastPlayerResponse = ValidString(ReadAsciiFile("cachefs:/last_player_response.json"))
filename: "last_generated_dash.xml"
content_type: "plain/text" attachments = [{
data: lastGeneratedDash filename: "last_generated_dash.xml"
}] content_type: "plain/text"
else data: lastGeneratedDash
lastGeneratedHls = ReadAsciiFile("tmp:/last_generated_hls.m3u8") }, {
if not StringUtils.IsNullOrEmpty(lastGeneratedHls) filename: "last_generated_hls.m3u8"
attachments = [{ content_type: "plain/text"
filename: "last_generated_hls.m3u8" data: lastGeneratedHls
content_type: "plain/text" }, {
data: lastGeneratedHls filename: "last_player_response.json"
}] content_type: "application/json"
end if data: lastPlayerResponse
end if }]
end if end if
position = m.top.position
duration = m.top.duration
LogTelemetryEvent({ LogTelemetryEvent({
level: "error" level: "error"
message: errorData.title + " " + errorData.body + `\nurl: ${url}` message: errorData.title + " " + errorData.body + `\nurl: ${url}\nposition: ${position}\nduration: ${duration}`
fingerprint: errorData.fingerprint fingerprint: errorData.fingerprint
attachments: attachments attachments: attachments
}) })
@@ -23,38 +23,43 @@ namespace Http
request = context.request request = context.request
response = context.response response = context.response
url = request.query.url
if not StringUtils.IsNullOrEmpty(url)
return m.GenerateDashManifestAppendStoryboards(context)
end if
v = request.query.v v = request.query.v
local = request.query.local local = request.query.local
quality = request.query.quality quality = request.query.quality
if StringUtils.IsNullOrEmpty(v) if StringUtils.IsNullOrEmpty(v)
response.Default(400, "Missing video id") response.Default(400, "Missing video id")
WriteAsciiFile("tmp:/last_generated_dash.xml", "400 Missing video id") WriteAsciiFile("cachefs:/last_generated_dash.xml", "400 Missing video id")
return true return true
end if end if
metadata = ObjectUtils.DigUnsafe(m.videoQueueNode, ["player", "content", "metadata"]) metadata = ObjectUtils.DigUnsafe(m.videoQueueNode, ["player", "content", "metadata"])
if not IsAssociativeArray(metadata) if not IsAssociativeArray(metadata)
response.Default(500, "videoQueue.player.content.metadata is invalid") response.Default(500, "videoQueue.player.content.metadata is invalid")
WriteAsciiFile("tmp:/last_generated_dash.xml", "500 videoQueue.player.content.metadata is invalid") WriteAsciiFile("cachefs:/last_generated_dash.xml", "500 videoQueue.player.content.metadata is invalid")
return true return true
end if end if
if metadata.videoId <> v if metadata.videoId <> v
response.Default(400, "videoQueue.player.content.metadata.videoId does not match the requested video id") response.Default(400, "videoQueue.player.content.metadata.videoId does not match the requested video id")
WriteAsciiFile("tmp:/last_generated_dash.xml", "400 videoQueue.player.content.metadata.videoId does not match the requested video id") WriteAsciiFile("cachefs:/last_generated_dash.xml", "400 videoQueue.player.content.metadata.videoId does not match the requested video id")
return true return true
end if end if
m.dashManifest.invidiousInstance = m.invidiousService.GetInstance() m.dashManifest.invidiousInstance = m.invidiousService.GetInstance()
qualityFilter = m.CreateQualityFilter(quality) qualityFilter = m.CreateQualityFilter(quality)
xmlContent = m.dashManifest.fromVideoMetadata(metadata, qualityFilter, ValidString(local) = "true") xmlContent = m.dashManifest.FromVideoMetadata(metadata, qualityFilter, ValidString(local) = "true")
response.http_code = 200 response.http_code = 200
response.SetBodyDataString(xmlContent) response.SetBodyDataString(xmlContent)
response.ContentType("application/dash+xml") response.ContentType("application/dash+xml")
WriteAsciiFile("tmp:/last_generated_dash.xml", xmlContent) WriteAsciiFile("cachefs:/last_generated_dash.xml", xmlContent)
return true return true
end function end function
@@ -80,6 +85,46 @@ namespace Http
return qualityFilter return qualityFilter
end function end function
function GenerateDashManifestAppendStoryboards(context as object) as boolean
request = context.request
response = context.response
url = request.query.url
storyboards = ObjectUtils.DigUnsafe(m.videoQueueNode, ["player", "content", "metadata", "storyboards"])
if not IsArray(storyboards) or storyboards.count() = 0
response.Redirect(url)
return true
end if
dashRequest = HttpClient.Get(url)
dashResponse = dashRequest.Await()
if not dashResponse.IsSuccess()
LogError("Failed to fetch DASH manifest from URL", dashResponse.ErrorMessage())
response.Redirect(url)
return true
end if
dashContent = ValidString(dashResponse.Text())
storyboardIndex = dashContent.InStr("</Period>")
if storyboardIndex = -1
response.Redirect(url)
return true
end if
xml = new XmlObject()
manifestObj = new DashManifest("")
manifestObj.GenerateImageAdaptationSets(xml, storyboards, 100)
storyboardXml = xml.ToXmlString(false)
newDashContent = dashContent.Left(storyboardIndex) + storyboardXml + dashContent.Mid(storyboardIndex)
response.http_code = 200
response.SetBodyDataString(newDashContent)
response.ContentType("application/dash+xml")
return true
end function
end class end class
end namespace end namespace
@@ -35,6 +35,8 @@ namespace Http
if not hlsResponse.IsSuccess() if not hlsResponse.IsSuccess()
LogError("Failed to fetch HLS manifest:", hlsResponse.ErrorMessage()) LogError("Failed to fetch HLS manifest:", hlsResponse.ErrorMessage())
response.Redirect(url)
return true
end if end if
hlsManifest = hlsResponse.Text() hlsManifest = hlsResponse.Text()
@@ -58,7 +60,7 @@ namespace Http
response.headers["Server"] = "HTTP server (unknown)" response.headers["Server"] = "HTTP server (unknown)"
response.SetBodyDataString(hlsManifest) response.SetBodyDataString(hlsManifest)
WriteAsciiFile("tmp:/last_generated_hls.m3u8", hlsManifest) WriteAsciiFile("cachefs:/last_generated_hls.m3u8", hlsManifest)
return true return true
end function end function
@@ -1,6 +1,7 @@
import "HttpRequestState.bs" import "HttpRequestState.bs"
import "pkg:/components/Web/WebServer/Http/HttpConnection.bs" import "pkg:/components/Web/WebServer/Http/HttpConnection.bs"
import "pkg:/components/Web/WebServer/Http/HttpUtils.bs" import "pkg:/components/Web/WebServer/Http/HttpUtils.bs"
import "pkg:/source/utils/ByteArrayUtils.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs" import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -207,7 +208,7 @@ namespace Http
return false return false
end if end if
m.body_bytes = m.buffer.Slice(m.content_index) m.body_bytes = ByteArrayUtils.Slice(m.buffer, m.content_index)
m.ready_for_response = true m.ready_for_response = true
return true return true
end function end function
+2 -2
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=43 minor_version=43
build_version=00000 build_version=00004
ui_resolutions=hd ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p uri_resolution_autosub=$$RES$$,480p,720p,1080p
@@ -13,4 +13,4 @@ hidden=1
git_commit_sha=unknown git_commit_sha=unknown
bs_const=DEBUG=false bs_const=DEBUG=false;TEST_MODE=false
@@ -1,3 +1,5 @@
import "pkg:/source/utils/ByteArrayUtils.bs"
namespace Protobuf namespace Protobuf
class BinaryReader class BinaryReader
@@ -79,7 +81,7 @@ namespace Protobuf
if endPosition > m.buffer.Count() if endPosition > m.buffer.Count()
return invalid return invalid
end if end if
value = m.buffer.Slice(m.position, endPosition) value = ByteArrayUtils.Slice(m.buffer, m.position, endPosition)
m.position += length m.position += length
return value return value
end function end function
+5 -2
View File
@@ -64,8 +64,11 @@ class XmlObject
end if end if
end function end function
function ToXmlString() as string function ToXmlString(header = true as boolean) as string
xml = `<?xml version="1.0" encoding="UTF-8"?>\n` xml = ""
if header
xml = `<?xml version="1.0" encoding="UTF-8"?>\n`
end if
for each item in m.prolog for each item in m.prolog
if item.type = "comment" if item.type = "comment"
xml += `<!-- ${item.comment} -->\n` xml += `<!-- ${item.comment} -->\n`
@@ -0,0 +1,65 @@
import "StringUtils.bs"
namespace ByteArrayUtils
function Slice(bytearray as object, start_pos = 0 as dynamic, end_pos = invalid as dynamic) as object
if FindMemberFunction(bytearray, "Slice") <> invalid
start_pos = ValidInt(start_pos)
if end_pos = invalid
return bytearray.Slice(start_pos)
end if
return bytearray.Slice(start_pos, end_pos)
end if
return SliceFallback(bytearray, start_pos, end_pos)
end function
function SliceFallback(bytearray as object, start_pos = 0 as dynamic, end_pos = invalid as dynamic) as object
copy = CreateObject("roByteArray")
arrCount = bytearray.Count()
' default end_pos is array length
if end_pos = invalid
end_pos = arrCount
end if
start_pos = ValidInt(start_pos)
' handle negative start_pos
if start_pos < 0
start_pos = arrCount + start_pos
end if
' handle negative end_pos
if end_pos < 0
end_pos = arrCount + end_pos
end if
' clamp start_pos to bounds
if start_pos < 0
start_pos = 0
else if start_pos > arrCount
start_pos = arrCount
end if
' clamp end_pos to bounds
if end_pos < 0
end_pos = 0
else if end_pos > arrCount
end_pos = arrCount
end if
count = end_pos - start_pos
if count <= 0
return copy
end if
tmp = `tmp:/${StringUtils.RandomId()}.bin`
if not bytearray.WriteFile(tmp, start_pos, count)
DeleteFile(tmp)
return copy
end if
copy.ReadFile(tmp)
DeleteFile(tmp)
return copy
end function
end namespace
@@ -0,0 +1,45 @@
namespace Tests
@suite
class ByteArrayUtilsTests extends Rooibos.BaseTestSuite
protected override function beforeEach()
m.ba = CreateObject("roByteArray")
m.ba.FromHexString("00010203040506070809")
end function
@describe("ByteArrayUtils.Slice and SliceFallback")
@it("slices a byte array correctly")
@params("positive start and end", 2, 5, "020304")
@params("to the end if end is not provided", 7, invalid, "070809")
@params("the whole array if no params provided", invalid, invalid, "00010203040506070809")
@params("with negative start", -4, invalid, "06070809")
@params("with negative end", 0, -3, "00010203040506")
@params("with negative start and negative end", -5, -2, "050607")
@params("returns empty array for start greater than end", 5, 2, "")
@params("returns empty for start out of bounds", 20, invalid, "")
@params("clamps end to array length", 8, 20, "0809")
@params("handles empty slice", 3, 3, "")
function testSlice(description as string, start_pos as dynamic, end_pos as dynamic, expectedHex as string)
resultBa = ByteArrayUtils.Slice(m.ba, start_pos, end_pos)
m.assertEqual(resultBa.ToHexString(), expectedHex, "Slice failed for: " + description)
resultBaFallback = ByteArrayUtils.SliceFallback(m.ba, start_pos, end_pos)
m.assertEqual(resultBaFallback.ToHexString(), expectedHex, "SliceFallback failed for: " + description)
end function
@it("handles empty byte array")
function handles_empty_byte_array()
emptyBa = CreateObject("roByteArray")
resultBa = ByteArrayUtils.Slice(emptyBa, 0, 0)
m.assertEqual(resultBa.ToHexString(), "")
resultBaFallback = ByteArrayUtils.SliceFallback(emptyBa, 0, 0)
m.assertEqual(resultBaFallback.ToHexString(), "")
end function
end class
end namespace
+10 -10
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.43.0", "version": "0.43.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-web", "name": "playlet-web",
"version": "0.43.0", "version": "0.43.4",
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^6.2.1", "@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tailwindcss/postcss": "^4.1.16", "@tailwindcss/postcss": "^4.1.16",
@@ -15,13 +15,13 @@
"@vitejs/plugin-legacy": "^7.2.1", "@vitejs/plugin-legacy": "^7.2.1",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"bgutils-js": "^3.2.0", "bgutils-js": "^3.2.0",
"daisyui": "^5.3.9", "daisyui": "^5.3.10",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"ip": "^2.0.1", "ip": "^2.0.1",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"rollup-plugin-visualizer": "^6.0.5", "rollup-plugin-visualizer": "^6.0.5",
"svelte": "^5.41.4", "svelte": "^5.43.2",
"svelte-check": "^4.3.3", "svelte-check": "^4.3.3",
"svelte-preprocess": "^6.0.3", "svelte-preprocess": "^6.0.3",
"tailwindcss": "^4.1.16", "tailwindcss": "^4.1.16",
@@ -3123,9 +3123,9 @@
} }
}, },
"node_modules/daisyui": { "node_modules/daisyui": {
"version": "5.3.9", "version": "5.3.10",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.3.9.tgz", "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.3.10.tgz",
"integrity": "sha512-741x1pGGSGHcrBYtdE7iKbqW1OoiijYdAZ8oJPZR9MhSKLcMBlHjKfN3YlM2/K7t5jd7O0sg4SqkVNPylalRFw==", "integrity": "sha512-vmjyPmm0hvFhA95KB6uiGmWakziB2pBv6CUcs5Ka/3iMBMn9S+C3SZYx9G9l2JrgTZ1EFn61F/HrPcwaUm2kLQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
@@ -4403,9 +4403,9 @@
} }
}, },
"node_modules/svelte": { "node_modules/svelte": {
"version": "5.41.4", "version": "5.43.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.41.4.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.43.2.tgz",
"integrity": "sha512-sBrVmskY0eij5+CSSuMK1kOk1xSiRh0BRTEhUnxnd1x3p42GbQmm4rwq4WMD23rUG3QR53Nfv8kpaER3tV5F4A==", "integrity": "sha512-ro1umEzX8rT5JpCmlf0PPv7ncD8MdVob9e18bhwqTKNoLjS8kDvhVpaoYVPc+qMwDAOfcwJtyY7ZFSDbOaNPgA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.43.0", "version": "0.43.4",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -16,13 +16,13 @@
"@vitejs/plugin-legacy": "^7.2.1", "@vitejs/plugin-legacy": "^7.2.1",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"bgutils-js": "^3.2.0", "bgutils-js": "^3.2.0",
"daisyui": "^5.3.9", "daisyui": "^5.3.10",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"ip": "^2.0.1", "ip": "^2.0.1",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"rollup-plugin-visualizer": "^6.0.5", "rollup-plugin-visualizer": "^6.0.5",
"svelte": "^5.41.4", "svelte": "^5.43.2",
"svelte-check": "^4.3.3", "svelte-check": "^4.3.3",
"svelte-preprocess": "^6.0.3", "svelte-preprocess": "^6.0.3",
"tailwindcss": "^4.1.16", "tailwindcss": "^4.1.16",
+2
View File
@@ -42,6 +42,8 @@ export class ManifestEditPlugin implements CompilerPlugin {
// Test flag // Test flag
// @ts-ignore // @ts-ignore
const testMode = !!builder.options.testMode; const testMode = !!builder.options.testMode;
builder.logger.log(`Setting bs_const TEST_MODE to ${testMode}`)
manifestContent = manifestContent.replace(/TEST_MODE=(true|false)/i, `TEST_MODE=${testMode}`);
if (testMode) { if (testMode) {
builder.logger.log(`Commenting out "sg_component_libs_provided"`) builder.logger.log(`Commenting out "sg_component_libs_provided"`)
manifestContent = manifestContent.replace(/sg_component_libs_provided=/i, `# sg_component_libs_provided=`); manifestContent = manifestContent.replace(/sg_component_libs_provided=/i, `# sg_component_libs_provided=`);