From f1a3df81b2a4b6a268e8deaf8d5627d9bb6211b9 Mon Sep 17 00:00:00 2001 From: Dave Wickham Date: Sat, 8 Nov 2025 19:25:57 +0000 Subject: [PATCH] Add code to prioritise human-made subtitles (#786) --- .../Services/Innertube/PlayerEndpoint.bs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 8202d72f..a9bb54c7 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -316,6 +316,7 @@ namespace Innertube end if captions = [] + autoCaptions = [] for each track in tracks if not IsAssociativeArray(track) continue for @@ -341,13 +342,22 @@ namespace Innertube label = ParseText(track["name"]) - captions.Push({ + thisCaption = { "label": label "language_code": languageCode "url": baseUrl - }) + } + + if track["kind"] = "asr" + autoCaptions.Push(thisCaption) + continue for + end if + + captions.Push(thisCaption) end for + ' Put automatically generated captions at the end so human-generated ones take priority + captions.Append(autoCaptions) return captions end function