Compare commits

..
23 Commits
Author SHA1 Message Date
Brahim Hadriche 807c528086 Release v0.41.18 (#741) 2025-09-20 08:52:23 -04:00
Brahim Hadriche 2c22e97dbe Fix crash due to bad type casting 2025-09-20 08:52:01 -04:00
Brahim Hadriche 840866ce06 [skip ci] Ignore compactRadioRenderer 2025-09-19 22:38:55 -04:00
Brahim Hadriche 007607e21c [skip ci] req id tripping 2025-09-19 21:20:47 -04:00
Brahim Hadriche b4a4a688ca [skip ci] do not log STS_MISMATCH errors 2025-09-19 16:38:04 -04:00
Brahim Hadriche 688206ef91 Release v0.41.17 (#738) 2025-09-19 16:14:51 -04:00
Brahim Hadriche 3acc1bf9c9 syslog events tweak 2025-09-19 16:08:31 -04:00
Brahim Hadriche 21b1a9ea81 Release v0.41.16 (#735) 2025-09-19 13:32:33 -04:00
Brahim Hadriche 3f252a9b11 Small tweak 2025-09-19 13:30:11 -04:00
Brahim Hadriche c5146017a8 [skip ci] tweak player response parsing 2025-09-19 13:07:40 -04:00
Brahim Hadriche 7f58809737 Release v0.41.15 (#734) 2025-09-19 09:20:50 -04:00
Brahim Hadriche 6748390ac4 Comment 2025-09-19 09:17:45 -04:00
Brahim Hadriche d2fac255ed Improve session data error handling 2025-09-19 09:17:19 -04:00
Brahim Hadriche dbcfc46dad Improve fingerprinting for requests 2025-09-19 09:04:05 -04:00
Brahim Hadriche 671719905b keep last dash/hls in tracking 2025-09-19 08:56:07 -04:00
Brahim Hadriche 5417f5d61d Add retry on getting session data 2025-09-19 08:55:40 -04:00
Brahim Hadriche ee0abc9891 refactor 2025-09-19 08:55:24 -04:00
Brahim Hadriche bb7407f75f [skip ci] Fix rare crash when loading video feed 2025-09-18 21:37:09 -04:00
Brahim Hadriche b101872906 Release v0.41.14 (#733) 2025-09-18 19:00:29 -04:00
Brahim Hadriche 8f42bfa675 [skip ci] Better handling for lounge lost sessions 2025-09-18 18:59:47 -04:00
Brahim Hadriche b8d2008b98 Regression for Attempt to play the next video when errors occur 2025-09-18 18:51:05 -04:00
Brahim Hadriche 36910ab5cf Try fetching multiple pages in the search, in case results are filtered out (e.g. shorts) 2025-09-18 18:38:38 -04:00
Brahim Hadriche ae09f711df [skip ci] small tweak 2025-09-18 17:45:54 -04:00
45 changed files with 272 additions and 126 deletions

No files matched your search

+34
View File
@@ -5,6 +5,40 @@ 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.18] - 2025-09-20
### Fixed
- Various fixes and improvements
- Crash due to bad type casting
## [0.41.17] - 2025-09-19
### Fixed
- Various fixes and improvements
## [0.41.16] - 2025-09-19
### Fixed
- Various fixes and improvements
## [0.41.15] - 2025-09-19
### Fixed
- Rare crash when loading video feed
- Improve session data error handling
## [0.41.14] - 2025-09-18
### Fixed
- Try fetching multiple pages in the search, in case results are filtered out (e.g. shorts)
- Regression for `Attempt to play the next video when errors occur`
- Better handling for lounge lost sessions
## [0.41.13] - 2025-09-18
### Fixed
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet",
"version": "0.41.13",
"version": "0.41.18",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.41.13",
"version": "0.41.18",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.35",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet",
"version": "0.41.13",
"version": "0.41.18",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.35",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.41.13",
"version": "0.41.18",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.41.13"
"version": "0.41.18"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.41.13",
"version": "0.41.18",
"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=00013
build_version=00018
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.41.13",
"version": "0.41.18",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.41.13"
"version": "0.41.18"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.41.13",
"version": "0.41.18",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-lib",
@@ -16,7 +16,7 @@ function ExecuteJob() as void
return
end if
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
isInnertubeProfile = authToken.profileNode.type = "youtube"
if isInnertubeProfile
subscriptionStatus = InnertubeService.GetSubscriptionStatusForChannel(ucid, {
@@ -14,7 +14,7 @@ function ExecuteJob() as void
return
end if
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
service = new Invidious.InvidiousService(invidiousNode)
if subscribe
@@ -14,7 +14,7 @@ function ExecuteJob() as void
end if
service = new Invidious.InvidiousService(invidiousNode)
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
response = service.GetChannel(contentNode.authorId, cancellation)
if JobIsCancelled()
@@ -17,7 +17,7 @@ function ExecuteJob() as void
service = new Invidious.InvidiousService(invidiousNode)
instance = service.GetInstance()
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
while true
playlistId = contentNode.playlistId
@@ -8,7 +8,7 @@ function ExecuteJob() as void
accessTokenObject = input.accessTokenObject
profilesService = input.profilesService
try
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
if InnertubeService.AuthRefreshAccessToken(accessTokenObject, cancellation)
profileNode.expiresIn = accessTokenObject.expiresIn
profileNode.expiresTimestamp = accessTokenObject.expiresTimestamp
@@ -11,7 +11,7 @@ function ExecuteJob() as void
profilesNode = input.profilesService
dialogNode = input.dialog
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
' TODO:P2 cache client identity
authCode = InnertubeService.AuthGetCode(cancellation)
@@ -1,4 +1,5 @@
import "pkg:/source/utils/AssertUtils.bs"
import "pkg:/source/utils/CancellationUtils.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MessagePortUtils.bs"
@@ -22,6 +23,10 @@ function JobGetCallbackNode() as dynamic
return m._callback
end function
function JobGetCancellation() as dynamic
return CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
end function
function JobSuccess() as void
callbackNode = JobGetCallbackNode()
if callbackNode = invalid
+20 -7
View File
@@ -25,7 +25,6 @@ function Init()
scene.enableSystemLogType = "http.complete"
scene.enableSystemLogType = "bandwidth.minute"
#end if
m.sysLogEventDropCounter = 0
end if
end if
@@ -114,17 +113,31 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
' Only report 1 in 10 system log errors
' They're usually repetitive, one is reported for each stream in a DASH
' when a video is blocked
if m.sysLogEventDropCounter = 0
fingerprint = `SysLog${info.Status}${info.LogType}${info.HttpCode}${info.Method}`
if m.sysLogEventTimer = invalid
m.sysLogEventTimer = CreateObject("roTimespan")
m.sysLogFingerprint = fingerprint
LogTelemetryEvent({
level: "error"
message: line
fingerprint: ["SysLog", info.Status, info.LogType, info.HttpCode, info.Method]
fingerprint: [fingerprint]
})
return
end if
m.sysLogEventDropCounter = (m.sysLogEventDropCounter + 1) mod 10
' Only log one syslog error per minute (or if the fingerprint changes) to avoid spamming
if m.sysLogEventTimer.TotalSeconds() < 60 and m.sysLogFingerprint = fingerprint
return
end if
m.sysLogEventTimer.Mark()
m.sysLogFingerprint = fingerprint
LogTelemetryEvent({
level: "error"
message: line
fingerprint: [fingerprint]
})
end function
function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
@@ -20,7 +20,7 @@ function ExecuteJob() as void
content = PrepareTests()
listNode.content = content
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
RunTests(instance, content, cancellation)
end function
@@ -15,7 +15,7 @@ function ExecuteJob() as void
return
end if
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
response = HttpClient.Get(Invidious.INSTANCES_API).Cancellation(cancellation).Await()
if response.IsCancelled()
JobCancel()
@@ -3,7 +3,7 @@ import "pkg:/source/utils/CancellationUtils.bs"
@job("LatestLibVersionJob")
function ExecuteJob() as void
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
latest = GetLatestPlayletLibVersionFromGithubReleases(cancellation)
JobSuccessData({
latest: latest
@@ -153,6 +153,10 @@ namespace InnertubeService
nextResponse = nextRequest.Await()
if not nextResponse.IsSuccess()
if nextResponse.IsCancelled()
return parsedResponse
end if
error = nextResponse.ErrorMessage()
LogWarn(error)
@@ -6,10 +6,10 @@ function ExecuteJob() as void
innertubeNode = input.innertube
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
sessionData = Innertube.GetSessionData(cancellation)
if sessionData = invalid
JobError("Failed to fetch session data")
if sessionData.error <> invalid
JobError(sessionData.error)
return
end if
@@ -46,6 +46,23 @@ namespace Innertube
return parsedResponse
end if
endscreen = playerOverlayRenderer["endScreen"]
feeds = Innertube.ParseResponseDataForFeeds(endscreen, {
response: httpResponse
noContainers: true
})
if feeds.Count() > 0
parsedResponse["recommendedVideos"] = ValidArray(feeds[0].items)
end if
' Sometimes the title and author are missing in /player respnonse, so we get them here.
' But if we have an error, we don't need them, recommendedVideos is enough to play the
' next video, after showing the error dialog.
if parsedResponse.error <> invalid
return parsedResponse
end if
if StringUtils.IsNullOrEmpty(parsedResponse.title)
title = ParseText(ObjectUtils.Dig(playerOverlayRenderer, ["videoDetails", "playerOverlayVideoDetailsRenderer", "title"]))
if not StringUtils.IsNullOrEmpty(title)
@@ -60,21 +77,6 @@ namespace Innertube
end if
end if
if not IsArray(parsedResponse.recommendedVideos)
LogWarn("Invalid recommended videos", parsedResponse.recommendedVideos)
return parsedResponse
end if
endscreen = playerOverlayRenderer["endScreen"]
feeds = Innertube.ParseResponseDataForFeeds(endscreen, {
response: httpResponse
noContainers: true
})
if feeds.Count() > 0
parsedResponse.recommendedVideos.Append(ValidArray(feeds[0].items))
end if
return parsedResponse
end function
@@ -93,6 +93,7 @@ namespace Innertube
' Ignored nodes:
' TODO:P2 radioRenderer seems like a Mix https://github.com/iBicha/playlet/issues/709
"radioRenderer": ParseNotImplemented
"compactRadioRenderer": ParseNotImplemented
' TODO:P2 A carousel of videos, found on the home tab of a channel.
' Should probably be parsed.
"carouselItemRenderer": ParseNotImplemented
@@ -32,9 +32,14 @@ namespace Innertube
Innertube.ParseNode(containers, context)
if context.currentFeed <> invalid and (context.currentFeed.items.Count() > 0 or context.currentFeed.title <> "")
context.feeds.Push(context.currentFeed)
context.currentFeed = invalid
if context.currentFeed <> invalid
hasTitle = context.currentFeed.title <> ""
hasItems = context.currentFeed.items.Count() > 0
hasContinuation = context.currentFeed.DoesExist("continuation")
if hasTitle or hasItems or hasContinuation
context.feeds.Push(context.currentFeed)
context.currentFeed = invalid
end if
end if
return context.feeds
end function
@@ -119,10 +119,6 @@ namespace Innertube
parsedResponse["formatStreams"] = formats
parsedResponse["captions"] = ParseCaptions(payload)
if not IsArray(parsedResponse["recommendedVideos"])
parsedResponse["recommendedVideos"] = []
end if
if not StringUtils.IsNullOrEmpty(videoDetails["title"])
parsedResponse["title"] = videoDetails["title"]
end if
@@ -438,11 +434,6 @@ namespace Innertube
response = request.Await()
if not response.IsSuccess()
if response.IsCancelled()
LogErrorNoTelemetry(response.ErrorMessage())
else
LogError(response.ErrorMessage())
end if
errorCode = ""
if response.StatusCode() = 400
json = response.Json()
@@ -460,6 +451,13 @@ namespace Innertube
if errorCode <> ""
exception.errorCode = errorCode
end if
if response.IsCancelled() or errorCode = "STS_MISMATCH"
LogErrorNoTelemetry(response.ErrorMessage())
else
LogError(response.ErrorMessage())
end if
return exception
end if
@@ -18,6 +18,9 @@ namespace Innertube
end if
sessionData = RequestSessionData(cancellation)
if sessionData.error <> invalid
return sessionData
end if
SaveSessionDataToRegistry(sessionData)
return sessionData
end function
@@ -31,11 +34,13 @@ namespace Innertube
"Referer": "https://www.youtube.com/sw.js"
})
request.Cancellation(cancellation)
request.TryCount(2)
response = request.Await()
if not response.IsSuccess()
LogError("Failed to fetch session data", response.ErrorMessage())
return invalid
return {
"error": "Failed to fetch session data: " + response.ErrorMessage()
}
end if
text = response.Text()
@@ -43,14 +48,16 @@ namespace Innertube
json = ParseJson(text)
if json = invalid
LogError("Failed to parse session data", text)
return invalid
return {
"error": "Failed to parse session data: " + text
}
end if
visitorData = ObjectUtils.Dig(json, [0, 2, 0, 0, 13])
if StringUtils.IsNullOrEmpty(visitorData)
LogError("Visitor data not found", text)
return invalid
return {
"error": "Failed to find visitorData in session data: " + text
}
end if
return {
@@ -60,10 +67,6 @@ namespace Innertube
end function
function SaveSessionDataToRegistry(sessionData as object) as void
if sessionData = invalid
return
end if
sessionData.__version = SESSION_DATA_VERSION
RegistryUtils.Write(RegistryUtils.INNERTUBE_SESSION_DATA, FormatJson(sessionData))
@@ -198,7 +198,7 @@ class LongPoller
m.status_code = Val(statusCode)
m.status_text = status.Mid(spaceIndex + 1)
if m.status_code <> 200
if m.status_code = 400 and m.status_text = "Unknown SID"
if m.status_code = 410 or (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)
@@ -41,7 +41,7 @@ function ExecuteJob() as void
form["access_type"] = "permanent"
form["app"] = "Playlet"
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
request = HttpClient.Post("https://www.youtube.com/api/lounge/pairing/get_pairing_code?ctx=pair", "")
request.UrlEncodedForm(form)
request.Cancellation(cancellation)
@@ -123,14 +123,14 @@ function LoungeServiceLoop() as void
unknownSid = false
' TODO:P2 move this check somewhere else
if api.poller.status_code = 400 and ValidString(api.poller.status_text) = "Unknown SID"
if (api.poller.status_code = 410) or (api.poller.status_code = 400 and ValidString(api.poller.status_text) = "Unknown SID")
api.poller.status_code = 0
unknownSid = true
end if
if not unknownSid
for each result in outgoingLoungeMessagesResults
if result.status = 400 and result.error.InStr("Unknown SID") <> -1
if result.status = 410 or (result.status = 400 and result.error.InStr("Unknown SID") <> -1)
unknownSid = true
exit for
end if
@@ -12,7 +12,7 @@ function ExecuteJob() as void
categories = input.categories
service = new SponsorBlock.SponsorBlockService()
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
skipSegments = service.GetSkipSegmentsForVideo(videoId, cancellation)
skipSegments = ProcessSkipSegments(skipSegments, showNotifications, categories, service)
+66 -15
View File
@@ -28,18 +28,6 @@ namespace Sentry
event.timestamp = timestamp
end if
message = event.message
hasAttachments = IsArray(event.attachments) and event.attachments.Count() > 0
if (not SUPPORTS_ATTACHMENTS) and hasAttachments
message += `\nAttachments: (${event.attachments.Count()} files)`
for each attachment in event.attachments
message += `\nAttachment: ${attachment.filename} (${attachment.content_type})\n${attachment.data}`
end for
message += `\nEnd of attachments.`
end if
eventPayload = {
event_id: event.event_id
timestamp: event.timestamp
@@ -52,14 +40,17 @@ namespace Sentry
release: event.release
tags: event.tags
level: event.level
logentry: {
formatted: message
}
user: {
id: event.userId
}
}
message = event.message
if event.fingerprint = invalid
event.fingerprint = GetFingerprint(message)
end if
if event.fingerprint <> invalid
fingerprint = event.fingerprint
if not IsArray(fingerprint)
@@ -73,6 +64,20 @@ namespace Sentry
eventPayload.fingerprint = fingerprint
end if
hasAttachments = IsArray(event.attachments) and event.attachments.Count() > 0
if (not SUPPORTS_ATTACHMENTS) and hasAttachments
message += `\nAttachments: (${event.attachments.Count()} files)`
for each attachment in event.attachments
message += `\nAttachment: ${attachment.filename} (${attachment.content_type})\n${attachment.data}`
end for
message += `\nEnd of attachments.`
end if
eventPayload.logentry = {
formatted: message
}
payload += FormatJson(eventPayload) + `\n`
if SUPPORTS_ATTACHMENTS and hasAttachments
@@ -119,4 +124,50 @@ namespace Sentry
return eventId
end function
function GetFingerprint(message as dynamic) as dynamic
if StringUtils.IsNullOrEmpty(message)
return invalid
end if
' Replaces `\nRequestId: 12345678\n` with `\nRequestId: <REQUEST_ID>\n`
fingerprint = ReplaceRequestId(message)
if fingerprint = invalid
return invalid
end if
return [fingerprint]
end function
function ReplaceRequestId(message as string) as dynamic
reqIdStart = `\nRequestId: `
reqIdPlaceholder = "<REQUEST_ID>"
result = message
replaced = false
searchIndex = 0
while true
requestIdIndex = result.InStr(searchIndex, reqIdStart)
if requestIdIndex = -1
exit while
end if
reqIdStartIndex = requestIdIndex + reqIdStart.Len()
newLineIndex = result.InStr(reqIdStartIndex, `\n`)
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
end if
return result
end function
end namespace
@@ -68,7 +68,9 @@ function ExecuteJob() as void
if response.error = Invidious.ERROR_NOT_AUTHENTICATED
if feedSources.Count() = 1
parent = feedContentNode.getParent()
parent.removeChild(feedContentNode)
if parent <> invalid
parent.removeChild(feedContentNode)
end if
JobSuccess()
return
end if
@@ -80,7 +82,9 @@ function ExecuteJob() as void
LogWarnNoTelemetry(feedSource.endpoint, "feedSource not available:", response.error)
if feedSources.Count() = 1
parent = feedContentNode.getParent()
parent.removeChild(feedContentNode)
if parent <> invalid
parent.removeChild(feedContentNode)
end if
JobSuccess()
return
end if
@@ -12,7 +12,7 @@ function ExecuteJob() as void
profileType = input.profileType
playbackTrackingUrls = input.playbackTrackingUrls
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
if profileType = "invidious"
service = new Invidious.InvidiousService(invidiousNode)
@@ -30,7 +30,7 @@ function ExecuteJob() as void
metadata = contentNode.metadata
if not IsAssociativeArray(metadata)
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
if backend = "playlet"
visitorData = innertubeNode.visitorData
if StringUtils.IsNullOrEmpty(visitorData)
@@ -566,7 +566,6 @@ function ReportVideoError(errorData as object, url as string) as void
content_type: "plain/text"
data: lastGeneratedDash
}]
DeleteFile("tmp:/last_generated_dash.xml")
else
lastGeneratedHls = ReadAsciiFile("tmp:/last_generated_hls.m3u8")
if not StringUtils.IsNullOrEmpty(lastGeneratedHls)
@@ -575,7 +574,6 @@ function ReportVideoError(errorData as object, url as string) as void
content_type: "plain/text"
data: lastGeneratedHls
}]
DeleteFile("tmp:/last_generated_hls.m3u8")
end if
end if
end if
@@ -28,7 +28,7 @@ function ExecuteJob() as void
backgroundPoster.uri = `${instance}/vi/${videoId}/maxresdefault.jpg`
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
backend = preferencesNode["backend.selected"]
if backend = "playlet"
metadata = InnertubeService.GetVideoMetadata(videoId, { cancellation: cancellation })
@@ -128,11 +128,7 @@ namespace VideoQueueUtils
end if
recommendedVideos = metadata.recommendedVideos
if recommendedVideos = invalid
return false
end if
if recommendedVideos = invalid or recommendedVideos.Count() = 0
if not IsArray(recommendedVideos) or recommendedVideos.Count() = 0
return false
end if
@@ -15,7 +15,7 @@ function ExecuteJob() as void
preferencesNode = input.preferences
service = new Invidious.InvidiousService(invidiousNode)
instance = service.GetInstance()
cancellation = CancellationUtils.CreateCancellation(JobGetCallbackNode(), "cancel", true)
cancellation = JobGetCancellation()
index = MathUtils.Clamp(input.index - 2, 0, videoNodes.Count() - 1)
@@ -420,31 +420,59 @@ namespace Http
options.continuation = continuation
end if
result = InnertubeService.Search(query, options)
fetchedPages = 0
while true
' Content can be filtered (for example, shorts removed)
' so we could be fetching multiple pages.
if fetchedPages > 3
response.Json({
"error": "Failed to search: no results found"
})
response.http_code = 500
return true
end if
result = InnertubeService.Search(query, options)
fetchedPages += 1
if raw
response.Json(result)
return true
end if
if raw
response.Json(result)
return true
end if
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if result.error <> invalid
response.Json(result)
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
response.Json({
"error": "Failed to search: no results found"
})
response.http_code = 500
return true
end if
if not IsArray(result.feeds) or result.feeds.Count() = 0
response.Json({
"error": "Failed to search: no results found"
})
response.http_code = 500
return true
end if
response.Json(result.feeds[0])
if result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
feed = result.feeds[0]
if feed.items.Count() > 0
response.Json(feed)
if fetchedPages = 1 and result.DoesExist("cache-control")
response.headers["cache-control"] = result["cache-control"]
end if
return true
end if
if StringUtils.IsNullOrEmpty(feed.continuation)
response.Json({
"error": "Failed to search: no results found"
})
response.http_code = 500
return true
end if
LogDebug("Search returned no results, fetching next page with continuation")
options.continuation = feed.continuation
end while
return true
end function
+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=00013
build_version=00018
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
@@ -440,7 +440,8 @@ namespace HttpClient
while triesLeft > 0
backoffMs = 1000 + Rnd(2000)
tryNumber = m._tryCount - triesLeft + 1
LogWarn("Request failed ID:", m.urlTransfer.GetIdentity(), "ErrorMessage:", response.ErrorMessage(), `\nRetrying: (`, tryNumber, "/", m._tryCount, ") in", backoffMs, "ms")
LogWarnNoTelemetry("Request failed ID:", m.urlTransfer.GetIdentity(), "ErrorMessage:", response.ErrorMessage(), `\nRetrying: (`, tryNumber, "/", m._tryCount, ") in", backoffMs, "ms")
LogWarnTelemetry(response.ErrorMessage())
if IsFunction(m._retryCallback)
try
+4
View File
@@ -33,6 +33,10 @@ function LogTelemetryEvent(event as object)
m.global.telemetry.LogEvent = event
end function
function LogWarnTelemetry(message as string)
m.global.telemetry.LogWarn = message
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.13",
"version": "0.41.18",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.41.13",
"version": "0.41.18",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^6.2.0",
"@tailwindcss/postcss": "^4.1.13",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.41.13",
"version": "0.41.18",
"type": "module",
"scripts": {
"dev": "vite",
-1
View File
@@ -280,7 +280,6 @@ export class YoutubeJs {
adaptiveFormats: YoutubeJs.getAdaptiveFormats(info),
formatStreams: [],
captions: YoutubeJs.getCaptions(info),
recommendedVideos: [],
}
}