feat: support YouTube VTT subtitle selection

This commit is contained in:
2026-10-27 13:05:56 +01:00
parent a2c8cc8e4d
commit 0641859d95
12 changed files with 449 additions and 25 deletions
+4 -1
View File
@@ -7,6 +7,8 @@ struct ResolvedSubtitle: Decodable, Sendable {
let language: String
let label: String
let isDefault: Bool
// Extractor identity survives expiring URLs and distinguishes manual from automatic captions.
var selectionID: String? = nil
private let headerFields: [String: String]
var proxy: MiruroProxy? = nil
var headers: String {
@@ -15,7 +17,7 @@ struct ResolvedSubtitle: Decodable, Sendable {
fileprivate var validatedHeaders: [String: String] { headerFields }
init(url: String, format: String, language: String, label: String, isDefault: Bool,
headers: [String: String], proxy: MiruroProxy? = nil) {
headers: [String: String], proxy: MiruroProxy? = nil, selectionID: String? = nil) {
self.url = url
self.format = format
self.language = language
@@ -23,6 +25,7 @@ struct ResolvedSubtitle: Decodable, Sendable {
self.isDefault = isDefault
self.headerFields = headers
self.proxy = proxy
self.selectionID = selectionID
}
private enum CodingKeys: String, CodingKey {
case url, format, language, label