Compare commits

...
5 Commits
Author SHA1 Message Date
Brahim Hadriche 55bdf2855b Release v0.48.6 (#948) 2026-10-03 17:12:05 -04:00
Brahim Hadriche 725c427eb7 [skip ci] Add telemetry fallback 2026-10-03 17:07:03 -04:00
Brahim Hadriche d453730e3b [skip ci] capture caption and manifest syslog errors separately 2026-10-02 22:09:53 -04:00
sekuso 8be85f2dd0 when invidious returns 403 on authenticated request, inspect error be… (#944)
* when invidious returns 403 on authenticated request, inspect error before determining if it's fatal for the user token

* simplifying with ibicha's !945 edits - no more followup request to subs endpoint to verify token, just pass if 403 fails for some unk reason
2026-10-02 21:51:43 -04:00
Brahim Hadriche 3dab7b5069 Fixed missing shows, seasons, courses and stations (except paid ones) 2026-10-01 08:37:14 -04:00
15 changed files with 115 additions and 122 deletions

No files matched your search

+7
View File
@@ -5,6 +5,13 @@ 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.48.6] - 2026-10-03
### Fixed
- Missing shows, seasons, courses and stations (except paid ones)
- Keep Invidious profiles signed in when a 403 does not report a known authentication error
## [0.48.5] - 2026-09-29 ## [0.48.5] - 2026-09-29
### Fixed ### Fixed
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.48.5", "version": "0.48.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.48.5", "version": "0.48.6",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.46", "@rokucommunity/bslint": "^0.8.46",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.48.5", "version": "0.48.6",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.46", "@rokucommunity/bslint": "^0.8.46",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.48.5", "version": "0.48.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.48.5" "version": "0.48.6"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.48.5", "version": "0.48.6",
"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",
+1 -1
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=48 minor_version=48
build_version=00005 build_version=00006
ui_resolutions=hd ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.48.5", "version": "0.48.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.48.5" "version": "0.48.6"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.48.5", "version": "0.48.6",
"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",
+27 -2
View File
@@ -8,6 +8,13 @@ const FILENAME = "app_logs.txt"
const FILENAME_PREVIOUS = "app_logs_previous.txt" const FILENAME_PREVIOUS = "app_logs_previous.txt"
const FILENAME_STARTUP = "cachefs:/playlet_startup_logs.txt" const FILENAME_STARTUP = "cachefs:/playlet_startup_logs.txt"
enum SysLogUrlType
Captions = "captions"
VideoPlayback = "videoplayback"
Manifest = "manifest"
Other = "other"
end enum
function Init() function Init()
m.top.functionName = "LoggerLoop" m.top.functionName = "LoggerLoop"
@@ -125,9 +132,10 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
buffer.FromAsciiString(line + `\n`) buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile) buffer.AppendFile(logsFile)
fingerprint = `SysLog${info.Status}${info.LogType}${httpCode}${info.Method}` urlType = GetSysLogUrlType(info.OrigUrl)
fingerprint = `SysLog-${urlType}-${info.Status}-${info.LogType}-${httpCode}-${info.Method}`
if ThrottleEvent("SysLogError", fingerprint, 60) if ThrottleEvent("SysLogError" + urlType, fingerprint, 60)
return return
end if end if
@@ -138,6 +146,23 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
}) })
end function end function
function GetSysLogUrlType(url as dynamic) as string
if not IsString(url)
return SysLogUrlType.Other
end if
if url.InStr("/api/timedtext") <> -1 or url.InStr("/api/v1/captions/") <> -1
return SysLogUrlType.Captions
end if
if url.InStr("/videoplayback") <> -1 or url.InStr("/api/dash/live-seg") <> -1
return SysLogUrlType.VideoPlayback
end if
if url.InStr("/api/manifest/") <> -1 or url.InStr("/api/dash") <> -1 or url.InStr("/api/hls") <> -1
return SysLogUrlType.Manifest
end if
return SysLogUrlType.Other
end function
function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
info = event.getInfo() info = event.getInfo()
message = "[WARN][AppMonitorMemory] " + ToString(info) message = "[WARN][AppMonitorMemory] " + ToString(info)
@@ -1084,18 +1084,25 @@ namespace Innertube
function ParseLockupViewModel(nodeData as object, context as object) as object function ParseLockupViewModel(nodeData as object, context as object) as object
contentType = ValidString(nodeData["contentType"]) contentType = ValidString(nodeData["contentType"])
if contentType = "LOCKUP_CONTENT_TYPE_VIDEO" if contentType = "LOCKUP_CONTENT_TYPE_VIDEO" or contentType = "LOCKUP_CONTENT_TYPE_MOVIE"
return LockupViewModelTypeVideo(nodeData, context) return LockupViewModelTypeVideo(nodeData, context)
else if contentType = "LOCKUP_CONTENT_TYPE_SHORT" else if contentType = "LOCKUP_CONTENT_TYPE_SHORT"
return LockupViewModelTypeShort(nodeData, context) return LockupViewModelTypeShort(nodeData, context)
else if contentType = "LOCKUP_CONTENT_TYPE_PLAYLIST" else if contentType = "LOCKUP_CONTENT_TYPE_PLAYLIST" or contentType = "LOCKUP_CONTENT_TYPE_PODCAST" or contentType = "LOCKUP_CONTENT_TYPE_ALBUM"
return LockupViewModelTypePlaylist(nodeData, context) return LockupViewModelTypePlaylist(nodeData, context)
else if contentType = "LOCKUP_CONTENT_TYPE_PODCAST" else if contentType = "LOCKUP_CONTENT_TYPE_SHOW" or contentType = "LOCKUP_CONTENT_TYPE_SEASON" or contentType = "LOCKUP_CONTENT_TYPE_COURSE" or contentType = "LOCKUP_CONTENT_TYPE_STATION"
return LockupViewModelTypePodcast(nodeData, context) ' For these content types the tap target, not the type, says what the item is: a show or season
else if contentType = "LOCKUP_CONTENT_TYPE_ALBUM" ' is a creator playlist or a paid Movies & TV title, a station is a live stream or a YouTube Music playlist.
return LockupViewModelTypeAlbum(nodeData, context) contentId = ValidString(nodeData["contentId"])
else if contentType = "LOCKUP_CONTENT_TYPE_MOVIE" command = ObjectUtils.Dig(nodeData, ["rendererContext", "commandContext", "onTap", "innertubeCommand"])
return LockupViewModelTypeVideo(nodeData, context) if contentId <> ""
if ValidString(ObjectUtils.Dig(command, ["watchEndpoint", "videoId"])) = contentId
return LockupViewModelTypeVideo(nodeData, context)
end if
if ValidString(ObjectUtils.Dig(command, ["watchEndpoint", "playlistId"])) = contentId or ValidString(ObjectUtils.Dig(command, ["watchPlaylistEndpoint", "playlistId"])) = contentId or ValidString(ObjectUtils.Dig(command, ["browseEndpoint", "browseId"])) = "VL" + contentId
return LockupViewModelTypePlaylist(nodeData, context)
end if
end if
end if end if
Warning(`Unknown content type: ${contentType}`, nodeData, context) Warning(`Unknown content type: ${contentType}`, nodeData, context)
@@ -1109,7 +1116,7 @@ namespace Innertube
end function end function
' The badge overlay has two shapes: thumbnailOverlayBadgeViewModel.thumbnailBadges (older, still ' The badge overlay has two shapes: thumbnailOverlayBadgeViewModel.thumbnailBadges (older, still
' used on playlist/podcast/album lockups) and thumbnailBottomOverlayViewModel.badges (video lockups) ' used on playlist lockups) and thumbnailBottomOverlayViewModel.badges (video lockups)
function ParseThumbnailBadge(thumbnailViewModel as object) as object function ParseThumbnailBadge(thumbnailViewModel as object) as object
overlays = ObjectUtils.Dig(thumbnailViewModel, ["overlays"]) overlays = ObjectUtils.Dig(thumbnailViewModel, ["overlays"])
if not IsArray(overlays) if not IsArray(overlays)
@@ -1161,7 +1168,12 @@ namespace Innertube
metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"]) metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"])
title = ObjectUtils.Dig(metadata, ["title", "content"]) title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "thumbnailViewModel"]) contentImage = nodeData["contentImage"]
thumbnailViewModel = ObjectUtils.Dig(contentImage, ["thumbnailViewModel"])
if thumbnailViewModel = invalid
' Station lockups frame their live stream as a collection
thumbnailViewModel = ObjectUtils.Dig(contentImage, ["collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
end if
if context.generateVideoThumbnails = true if context.generateVideoThumbnails = true
videoThumbnails = GenerateVideoThumbnails(videoId) videoThumbnails = GenerateVideoThumbnails(videoId)
@@ -1330,76 +1342,6 @@ namespace Innertube
return invalid return invalid
end function end function
function LockupViewModelTypePodcast(nodeData as object, context as object) as object
playlistId = nodeData["contentId"]
if not IsString(playlistId)
Warning("Invalid playlist ID in lockupViewModelTypePodcast", nodeData, context)
return invalid
end if
metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"])
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = GetThumbnailBadgeText(thumbnailViewModel)
author = invalid
authorId = invalid
if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
author = context.currentAuthor
authorId = context.currentAuthorId
end if
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": title
"author": author
"authorId": authorId
"playlistThumbnail": thumbnail
"videoCountText": videoCountText
}
PushFeedItem(playlist, context)
return invalid
end function
function LockupViewModelTypeAlbum(nodeData as object, context as object) as object
playlistId = nodeData["contentId"]
if not IsString(playlistId)
Warning("Invalid playlist ID in lockupViewModelTypeAlbum", nodeData, context)
return invalid
end if
metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"])
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = GetThumbnailBadgeText(thumbnailViewModel)
author = invalid
authorId = invalid
if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
author = context.currentAuthor
authorId = context.currentAuthorId
end if
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": title
"author": author
"authorId": authorId
"playlistThumbnail": thumbnail
"videoCountText": videoCountText
}
PushFeedItem(playlist, context)
return invalid
end function
function ParseShortsLockupViewModel(nodeData as object, context as object) as object function ParseShortsLockupViewModel(nodeData as object, context as object) as object
if context.disableShorts = true if context.disableShorts = true
LogInfo("Skipping Short based on user settings") LogInfo("Skipping Short based on user settings")
@@ -110,7 +110,7 @@ namespace Invidious
request.Headers(m.GetAuthenticationHeaders(auth.token)) request.Headers(m.GetAuthenticationHeaders(auth.token))
request.Cancellation(cancellation) request.Cancellation(cancellation)
response = request.Await() response = request.Await()
m.MarkNeedsReauthOn403(response, auth.profile) m.MarkNeedsReauthIfCredentialsRejected(response, auth.profile)
end function end function
function SearchSuggestions(q as string, cancellation = invalid as object) as object function SearchSuggestions(q as string, cancellation = invalid as object) as object
@@ -214,7 +214,7 @@ namespace Invidious
response = request.Await() response = request.Await()
if isAuthenticatedRequest if isAuthenticatedRequest
m.MarkNeedsReauthOn403(response, auth.profile) m.MarkNeedsReauthIfCredentialsRejected(response, auth.profile)
end if end if
return response return response
end function end function
@@ -612,7 +612,7 @@ namespace Invidious
function AuthFeedHandler(context as object) as object function AuthFeedHandler(context as object) as object
response = context.response response = context.response
m.MarkNeedsReauthOn403(response, context.profile) m.MarkNeedsReauthIfCredentialsRejected(response, context.profile)
if not response.IsSuccess() if not response.IsSuccess()
return invalid return invalid
@@ -647,7 +647,7 @@ namespace Invidious
function WatchHistoryHandler(context as object) as object function WatchHistoryHandler(context as object) as object
response = context.response response = context.response
m.MarkNeedsReauthOn403(response, context.profile) m.MarkNeedsReauthIfCredentialsRejected(response, context.profile)
if not response.IsSuccess() if not response.IsSuccess()
return invalid return invalid
@@ -699,14 +699,20 @@ namespace Invidious
return json return json
end function end function
' A 403 on an authenticated call is terminal — only a fresh sign-in recovers. function MarkNeedsReauthIfCredentialsRejected(response as object, profile as object) as void
function MarkNeedsReauthOn403(response as object, profile as object) as void
if response.StatusCode() <> 403 if response.StatusCode() <> 403
return return
end if end if
LogWarn(`Invidious instance responded with 403: ${response.Text()}`) body = ValidString(response.Text())
if profile <> invalid and profile.type = "invidious" LogWarn(`Invidious instance responded with 403: ${body}`)
if profile = invalid or profile.type <> "invidious"
return
end if
' Invidious answers 403 to any exception on /api/v1/auth/*, including a route failing after
' authentication succeeded. Only these errors, raised while validating the session, mean it's dead.
if body.InStr("Request must be authenticated") <> -1 or body.InStr("Invalid signature") <> -1 or body.InStr("Erroneous token") <> -1 or body.InStr("Token is expired") <> -1
profile@.MarkNeedsReauth() profile@.MarkNeedsReauth()
end if end if
end function end function
@@ -773,7 +779,7 @@ namespace Invidious
request.Cancellation(cancellation) request.Cancellation(cancellation)
response = request.Await() response = request.Await()
m.MarkNeedsReauthOn403(response, auth.profile) m.MarkNeedsReauthIfCredentialsRejected(response, auth.profile)
return response return response
end function end function
@@ -787,7 +793,7 @@ namespace Invidious
request.Cancellation(cancellation) request.Cancellation(cancellation)
response = request.Await() response = request.Await()
m.MarkNeedsReauthOn403(response, auth.profile) m.MarkNeedsReauthIfCredentialsRejected(response, auth.profile)
return response return response
end function end function
@@ -801,7 +807,7 @@ namespace Invidious
request.Cancellation(cancellation) request.Cancellation(cancellation)
response = request.Await() response = request.Await()
m.MarkNeedsReauthOn403(response, auth.profile) m.MarkNeedsReauthIfCredentialsRejected(response, auth.profile)
return response return response
end function end function
end class end class
+28 -15
View File
@@ -1,6 +1,9 @@
import "pkg:/source/services/HttpClient.bs" import "pkg:/source/services/HttpClient.bs"
const SENTRY_ENVELOPE_URL = "https://playlet-v8556.ondigitalocean.app/envelope" const SUPPORT_SERVER_ENVELOPE_URL = "https://playlet-v8556.ondigitalocean.app/envelope"
' A fallback is needed to investigate https://github.com/iBicha/playlet/issues/906
const SENTRY_FALLBACK_ENVELOPE_URL = "https://o4509923566288896.ingest.us.sentry.io/api/4512194184544256/envelope/"
const SENTRY_FALLBACK_KEY = "a16c510299b23ccc63bdc84f751c9950"
const SUPPORTS_ATTACHMENTS = false const SUPPORTS_ATTACHMENTS = false
@@ -95,24 +98,34 @@ namespace Sentry
end if end if
end for end for
request = HttpClient.Post(SENTRY_ENVELOPE_URL, payload) request = HttpClient.Post(SUPPORT_SERVER_ENVELOPE_URL, payload)
request.Header("Content-Type", "application/x-sentry-envelope") request.Header("Content-Type", "application/x-sentry-envelope")
response = request.Await() response = request.Await()
if not response.IsSuccess() ' Only when the server never answered: its own failures hit every device at once and would exhaust the fallback's quota
#if DEBUG if response.StatusCode() <= 0
LogErrorNoTelemetry("Failed to send event to Sentry:", response.ErrorMessage(), `\nHeaders:`, response.Headers()) LogWarnNoTelemetry("Support server unreachable, sending events to the Sentry fallback:", response.ErrorMessage())
#end if request = HttpClient.Post(SENTRY_FALLBACK_ENVELOPE_URL, payload)
request.Header("Content-Type", "application/x-sentry-envelope")
retryAfter = ValidString(response.Headers()["Retry-After"]).ToInt() request.QueryParam("sentry_key", SENTRY_FALLBACK_KEY)
LogErrorNoTelemetry("Rate limited by Sentry. Retry after", retryAfter, "seconds") response = request.Await()
if retryAfter = 0
retryAfter = 60
end if
return retryAfter
end if end if
LogDebug("Sent events to Sentry. Response:", response.Text()) if response.IsSuccess()
return 0 LogDebug("Sent events to", request.BuildUrl(), "Response:", response.Text())
return 0
end if
retryAfter = ValidString(response.Headers()["Retry-After"]).ToInt()
if retryAfter = 0
retryAfter = 60
end if
if response.StatusCode() = 429
LogErrorNoTelemetry("Rate limited by", request.BuildUrl(), "Retry after", retryAfter, "seconds")
else
LogErrorNoTelemetry("Failed to send events to", request.BuildUrl(), response.ErrorMessage(), `\nRetry after`, retryAfter, "seconds")
end if
return retryAfter
end function end function
function GetFingerprint(message as dynamic) as dynamic function GetFingerprint(message as dynamic) as dynamic
+1 -1
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=48 minor_version=48
build_version=00005 build_version=00006
ui_resolutions=hd ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.48.5", "version": "0.48.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-web", "name": "playlet-web",
"version": "0.48.5", "version": "0.48.6",
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.3.1", "@sveltejs/vite-plugin-svelte": "^7.3.1",
"@tailwindcss/postcss": "^4.3.3", "@tailwindcss/postcss": "^4.3.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.48.5", "version": "0.48.6",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",