Compare commits

...
20 Commits
Author SHA1 Message Date
Brahim Hadriche 232af471f4 Release v0.41.8 (#723) 2025-09-07 10:59:03 -04:00
Brahim Hadriche f9844d9d4d [skip ci] Ignore "sendDebugCommand" - [13, [sendDebugCommand, {debugCommand: stats4nerds }]] 2025-09-07 10:40:39 -04:00
Brahim Hadriche fb811a6240 [skip ci] Improve reading http message header 2025-09-07 09:59:41 -04:00
Brahim Hadriche daf7966f4b Small tweak 2025-09-06 23:25:38 -04:00
Brahim Hadriche 4363c068d6 Dash: null check on urls (can be empty from Invidious for example) 2025-09-06 21:16:14 -04:00
Brahim Hadriche 714147a477 Ignore carouselItemRenderer 2025-09-06 20:59:59 -04:00
Brahim Hadriche f505d01785 Ignore tile 2025-09-06 20:57:06 -04:00
Brahim Hadriche 5f5b0bb8fd Ignore radioRenderer for now 2025-09-06 20:53:18 -04:00
Brahim Hadriche f5e715a782 Dash gen fix 2025-09-06 20:48:31 -04:00
Brahim Hadriche edb9ae1135 [skip ci] small tweak 2025-09-06 20:11:09 -04:00
Brahim Hadriche d0e7a01512 Release v0.41.7 (#722) 2025-09-06 19:59:16 -04:00
Brahim Hadriche 777a5b7311 Fix playback error when playing post live dvr videos 2025-09-06 19:51:11 -04:00
Brahim Hadriche 8a458fb38b [skip ci] dash missing warnings/errors 2025-09-06 16:48:55 -04:00
Brahim Hadriche 47a7ea21e6 Refactor custom events 2025-09-06 13:58:42 -04:00
Brahim Hadriche c9a0e96905 Revert "Fix bug in httprequest class when calling m.global"
This reverts commit 087c1c011a.
2025-09-06 13:46:36 -04:00
Brahim Hadriche 087c1c011a Fix bug in httprequest class when calling m.global 2025-09-06 13:33:19 -04:00
Brahim Hadriche a9219f0ef9 [skip ci] Silence "Unknown SID" longpoller errors 2025-09-06 13:08:03 -04:00
Brahim Hadriche ce43e5fca5 Update client versions 2025-09-06 12:19:42 -04:00
Brahim Hadriche 0ddd3cf0e2 [skip ci] Add url to error report 2025-09-06 11:56:30 -04:00
Brahim Hadriche e1c8b5284f Ignore "Open YouTube Kids" tile 2025-09-06 11:52:13 -04:00
25 changed files with 117 additions and 53 deletions

No files matched your search

+13
View File
@@ -5,6 +5,19 @@ 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.41.8] - 2025-09-07
### Fixed
- Bug in dash generation
- Bug in http server
## [0.41.7] - 2025-09-06
### Fixed
- Playback error when playing post live dvr videos
## [0.41.6] - 2025-09-06
### Fixed
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet",
"version": "0.41.6",
"version": "0.41.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.41.6",
"version": "0.41.8",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.34",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet",
"version": "0.41.6",
"version": "0.41.8",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.34",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.41.6",
"version": "0.41.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.41.6"
"version": "0.41.8"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.41.6",
"version": "0.41.8",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-app",
+1 -1
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=41
build_version=00006
build_version=00008
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.41.6",
"version": "0.41.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.41.6"
"version": "0.41.8"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.41.6",
"version": "0.41.8",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-lib",
+2 -2
View File
@@ -118,11 +118,11 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
' They're usually repetitive, one is reported for each stream in a DASH
' when a video is blocked
if m.sysLogEventDropCounter = 0
m.global.telemetry.LogEvent = {
LogTelemetryEvent({
level: "error"
message: line
fingerprint: ["SysLog", info.Status, info.LogType, info.HttpCode, info.Method]
}
})
end if
m.sysLogEventDropCounter = (m.sysLogEventDropCounter + 1) mod 10
end function
@@ -39,6 +39,9 @@ class DashManifest
if local and m.invidiousInstance <> Invidious.PLAYLET_BUILT_IN_INSTANCE
parsedInvidiousUrl = UrlUtils.ParseUrl(m.invidiousInstance)
for i = 0 to adaptiveFormats.Count() - 1
if StringUtils.IsNullOrEmpty(adaptiveFormats[i].url)
continue for
end if
parsedUrl = UrlUtils.ParseUrl(adaptiveFormats[i].url)
parsedInvidiousUrl.path = UrlUtils.AppendQueryParams(parsedUrl.path, { host: parsedUrl.host })
adaptiveFormats[i].url = UrlUtils.BuildUrlFromParts(parsedInvidiousUrl)
@@ -113,9 +116,9 @@ class DashManifest
"value": `${stream.audioChannels}`
})
if stream.url = invalid
xml.Comment(`[ERROR] Stream.url is invalid for itag: ${stream.itag}`)
else stream.url.InStr("source=yt_live_broadcast")
if StringUtils.IsNullOrEmpty(stream.url)
xml.Comment(`[ERROR] Stream.url is null or empty for itag: ${stream.itag}`)
else if stream.url.InStr("source=yt_live_broadcast") <> -1
xml.Comment(`[WARN] Stream URL indicates a live broadcast for itag: ${stream.itag}`)
end if
xml.TextNode("BaseURL", ValidString(stream.url))
@@ -181,11 +184,17 @@ class DashManifest
if xml.Node("Representation", representationAttributes)
m.AddColorInfo(stream, xml)
if xml.Node("BaseURL")
xml.Text(stream.url)
xml.End()
end if
if stream.url = invalid
xml.Comment(`[ERROR] Stream.url is invalid for itag: ${stream.itag}`)
else if stream.url.InStr("source=yt_live_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 })
@@ -9,15 +9,15 @@ const INNERTUBE_IOS_OS_VERSION = "18.1"
const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/20.20.5 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X)"
const INNERTUBE_WEB_BROWSER_NAME = "Chrome"
const INNERTUBE_WEB_BROWSER_VERSION = "136.0.0.0"
const INNERTUBE_WEB_BROWSER_VERSION = "140.0.0.0"
const INNERTUBE_WEB_CLIENT_NAME = "1"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250520.05.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20250905.01.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0"
const INNERTUBE_TV_BROWSER_NAME = "SamsungBrowser"
const INNERTUBE_TV_BROWSER_VERSION = "9.2"
const INNERTUBE_TV_CLIENT_NAME = "2"
const INNERTUBE_TV_CLIENT_VERSION = "7.20250519.12.01"
const INNERTUBE_TV_CLIENT_VERSION = "7.20250902.08.00"
const INNERTUBE_TV_DEVICE_MAKE = "Samsung"
const INNERTUBE_TV_DEVICE_MODEL = "SmartTV"
const INNERTUBE_TV_OS_NAME = "Tizen"
@@ -64,7 +64,7 @@ namespace InnertubeService
' # Start of iOS fallback
playbackTrackingUrls = invalid
responseJson = playerResponse.Json()
if ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLive"]))
if ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLive"])) or ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLiveContent"]))
LogDebug("Live video detected, falling back to iOS for HLS streams.")
isLoggedIn = Innertube.ParseIsLoggedIn(responseJson)
playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(responseJson, isLoggedIn)
@@ -112,7 +112,7 @@ namespace InnertubeService
return GetVideoMetadata(videoId, options)
end if
if code = "MISSING_FORMAT_FIELD"
m.global.telemetry.LogEvent = {
LogTelemetryEvent({
level: "error"
message: code
fingerprint: code
@@ -125,7 +125,7 @@ namespace InnertubeService
content_type: "application/json"
data: playerResponse.Text()
}]
}
})
end if
throw exception
end try
@@ -91,6 +91,11 @@ namespace Innertube
"gridContinuation": ParseGridContinuation
"tvSurfaceContentContinuation": ParseTvSurfaceContentContinuation
' Ignored nodes:
' radioRenderer seems like a Mix https://github.com/iBicha/playlet/issues/709
"radioRenderer": ParseNotImplemented
' A carousel of videos, found on the home tab of a channel.
' Should probably be parsed.
"carouselItemRenderer": ParseNotImplemented
' Movies are not supported.
"movieRenderer": ParseNotImplemented
"compactMovieRenderer": ParseNotImplemented
@@ -1251,6 +1256,20 @@ namespace Innertube
' A tileRenderer can be without a contentType, such as a
' button that says "Open YouTube Kids" or similar CTAs
if contentType = ""
' "Open YouTube Kids" tileRenderer
eventTrigger = ValidString(ObjectUtils.Dig(nodeData, ["onSelectCommand", "authDeterminedCommand", "authenticatedCommand", "authRequiredCommand", "identityActionContext", "eventTrigger"]))
if eventTrigger = "ACCOUNT_EVENT_TRIGGER_YTK_WORMHOLE"
LogWarnNoTelemetry("Skipping tileRenderer without contentType for YouTube Kids")
return invalid
end if
' "More news" tileRenderer
browseId = ValidString(ObjectUtils.Dig(nodeData, ["onSelectCommand", "browseEndpoint", "browseId"]))
if browseId = "FEtopics_news"
LogWarnNoTelemetry("Skipping tileRenderer without contentType for FEtopics_news")
return invalid
end if
Warning("TileRenderer without contentType", nodeData, context)
return invalid
end if
@@ -1739,8 +1758,7 @@ namespace Innertube
nodeDataString = FormatJson(nodeData)
LogWarnNoTelemetry(message + `\n` + nodeDataString)
m.global.telemetry.LogEvent = {
LogTelemetryEvent ({
level: "warning"
message: message
fingerprint: message
@@ -1753,6 +1771,6 @@ namespace Innertube
content_type: "text/plain"
data: context.response.request.ToCurlCommand()
}]
}
})
end function
end namespace
@@ -86,6 +86,7 @@ namespace Innertube
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
isLive = ValidBool(videoDetails["isLive"])
isLiveContent = ValidBool(videoDetails["isLiveContent"])
videoInfo = {
"type": "video"
@@ -97,9 +98,10 @@ namespace Innertube
"authorId": videoDetails["channelId"]
"lengthSeconds": lengthSeconds
"liveNow": isLive
"isLiveContent": isLiveContent
"hlsUrl": streamingData["hlsManifestUrl"]
"dashUrl": streamingData["dashManifestUrl"]
"adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive, cancellation)
"adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive or isLiveContent, cancellation)
"formatStreams": []
"captions": ParseCaptions(payload)
"recommendedVideos": []
@@ -198,8 +198,11 @@ class LongPoller
m.status_code = Val(statusCode)
m.status_text = status.Mid(spaceIndex + 1)
if m.status_code <> 200
LogError("Invalid status code:", m.status_code, m.status_text)
LogError("Response data:", m.socket_buffer)
if m.status_code = 400 and m.status_text = "Unknown SID"
LogErrorNoTelemetry("Invalid status code:", m.status_code, m.status_text, `\nResponse data:`, m.socket_buffer)
else
LogError("Invalid status code:", m.status_code, m.status_text, `\nResponse data:`, m.socket_buffer)
end if
m.CloseSocket()
return false
end if
@@ -66,6 +66,7 @@ class LoungeApi
commandHandlers[COMMAND_TYPE_GET_DISCOVERT_DEVICE_ID] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_GRACEFUL_RECONNECT] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_GET_RECEIVER_STATUS] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_SEND_DEBUG_COMMAND] = m.HandleIgnoreCommand
commandHandlers[COMMAND_TYPE_GET_NOW_PLAYING] = m.HandleGetPlayingNow
commandHandlers[COMMAND_TYPE_SESSION_ID] = m.HandleSessionId
@@ -323,6 +324,9 @@ class LoungeApi
m[handler](commandIndex, commandType, commandArgs, messagesToSend)
else
LogWarn("Unknown command type:", commandType, "command:", command)
#if DEBUG
throw `Unknown command type: ${commandType} command: ${ToString(command)}`
#end if
end if
end for
end function
@@ -28,6 +28,7 @@ const COMMAND_TYPE_ON_USER_ACTIVITY = "onUserActivity"
const COMMAND_TYPE_GET_DISCOVERT_DEVICE_ID = "getDiscoveryDeviceId"
const COMMAND_TYPE_GRACEFUL_RECONNECT = "gracefulReconnect"
const COMMAND_TYPE_GET_RECEIVER_STATUS = "getReceiverStatus"
const COMMAND_TYPE_SEND_DEBUG_COMMAND = "sendDebugCommand"
' Special commands
const COMMAND_TYPE_SESSION_ID = "c"
const COMMAND_TYPE_G_SESSION_ID = "S"
@@ -126,7 +126,7 @@ function CreateStreamUrls(metadata as object, service as Invidious.InvidiousServ
streamUrls = []
if metadata.hlsUrl <> invalid
if not StringUtils.IsNullOrEmpty(metadata.hlsUrl)
metadata.hlsUrl = AddInstanceToUrlIfNeeded(metadata.hlsUrl, instance)
AddHlsUrls(streamUrls, metadata, preferredQuality, backend, proxyVideos, playletServerPort)
else
@@ -248,7 +248,6 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
return
end if
' TODO:P2 we don't need to read and parse this every time
isoLanguageList = ParseJson(ReadAsciiFile("libpkg:/config/ISO-639-1-to-ISO-639-2T.json5"))
instance = service.GetInstance()
@@ -447,7 +447,7 @@ function OnVideoPlayerStateChange() as void
errorData = GetPlayerErrorData(content.videoId, errorInfo)
LogErrorNoTelemetry(errorData.title, errorData.body)
ReportVideoError(errorData)
ReportVideoError(errorData, content.url)
errorReported = true
if m.videoPlayingSuccess <> true
@@ -462,6 +462,10 @@ function OnVideoPlayerStateChange() as void
nextUrl = playletStreamUrls[playletStreamUrlIndex]
LogError(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`)
if StringUtils.IsNullOrEmpty(nextUrl)
LogError("Next stream URL is empty, cannot try next stream")
end if
content.url = nextUrl
SeekToInitialPosition(content)
@@ -499,7 +503,7 @@ function OnVideoPlayerStateChange() as void
LogErrorNoTelemetry(errorData.title, errorData.body)
if not errorReported
ReportVideoError(errorData)
ReportVideoError(errorData, content.url)
end if
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]
@@ -547,7 +551,7 @@ function GetPlayerErrorData(videoId as string, errorInfo as object) as object
}
end function
function ReportVideoError(errorData as object) as void
function ReportVideoError(errorData as object, url as string) as void
attachments = invalid
if errorData.body.Instr("malformed data") <> -1 or errorData.body.Instr("invalid pathname") <> -1
lastGeneratedDash = ReadAsciiFile("tmp:/last_generated_dash.xml")
@@ -571,12 +575,12 @@ function ReportVideoError(errorData as object) as void
end if
end if
m.global.telemetry.LogEvent = {
LogTelemetryEvent({
level: "error"
message: errorData.title + " " + errorData.body
message: errorData.title + " " + errorData.body + `\nurl: ${url}`
fingerprint: errorData.fingerprint
attachments: attachments
}
})
end function
function OnVideoFinished() as void
@@ -122,7 +122,7 @@ namespace Http
end if
' TODO:P2: handle live videos
if ValidBool(metadata.liveNow)
if ValidBool(metadata.liveNow) or ValidBool(metadata.isLiveContent)
return hlsManifest
end if
@@ -96,15 +96,22 @@ namespace Http
return false
end if
operation = m.ReadHeaderLine()
firstChar = m.buffer.Mid(0, 1)
if Asc(firstChar) = &h16
LogErrorNoTelemetry("TLS handshake detected. HTTPS is not supported.")
m.ready_for_response = true
return false
end if
if operation = invalid or operation = ""
LogErrorNoTelemetry("empty request")
m.global.telemetry.LogEvent = {
level: "error"
message: "empty request: " + FormatJson({ "m.buffer": m.buffer, "m.buffer_index": m.buffer_index })
fingerprint: ["HttpRequest: empty request"]
}
operation = m.ReadHeaderLine()
' Sometimes the first line is long enough that it doesn't fit in one read
' (e.g. very long URL). In that case, we just wait for more
if operation = invalid
return false
end if
if operation = ""
LogError("empty request")
m.ready_for_response = true
return false
end if
+1 -1
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=41
build_version=00006
build_version=00008
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+4
View File
@@ -29,6 +29,10 @@ function LogDebug(_arg1 = invalid as dynamic, _arg2 = invalid as dynamic, _arg3
throw "FATAL: Calling LogDebug() which is a stub function"
end function
function LogTelemetryEvent(event as object)
m.global.telemetry.LogEvent = event
end function
function ToString(value as dynamic) as string
if getInterface(value, "ifString") <> invalid
return value
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-web",
"version": "0.41.6",
"version": "0.41.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.41.6",
"version": "0.41.8",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^6.1.4",
"@tailwindcss/typography": "^0.5.16",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.41.6",
"version": "0.41.8",
"type": "module",
"scripts": {
"dev": "vite",