feat: resolve HTTP video URLs with bundled yt-dlp

This commit is contained in:
2026-10-22 17:05:29 +02:00
parent 6a4afc9f0e
commit b132bab393
14 changed files with 121 additions and 79 deletions
+4 -4
View File
@@ -572,7 +572,7 @@ final class PlayerModel: ObservableObject {
cancelStreamResolution()
if !change.automatic { automaticQuality = AutomaticQuality() }
if !change.automatic && !player_pause(handle) {
commandError = "Could not pause the current media to open YouTube. Please try again."
commandError = "Could not pause the current media to open the stream. Please try again."
revealControls()
return
}
@@ -620,10 +620,10 @@ final class PlayerModel: ObservableObject {
automaticQuality.extractionFailed(at: qualityNow)
return
}
commandError = error?.localizedDescription ?? "Could not queue the YouTube video to open. Please try again."
commandError = error?.localizedDescription ?? "Could not queue the video to open. Please try again."
if change.isQuality && change.playing, let handle, !player_play(handle) {
commandError = error.map { $0.localizedDescription + "\nCould not resume the previous playback." } ??
"Could not queue the YouTube video or resume the previous playback. Please try again."
"Could not queue the video or resume the previous playback. Please try again."
}
revealControls()
}
@@ -3450,7 +3450,7 @@ private struct PlayerContent: View {
model.openFiles(urls)
} else {
guard urls.count == 1, let url = urls.first,
(try? YouTubeResolver.validateURL(url.absoluteString)) != nil else { return false }
(try? StreamURL.parse(url.absoluteString)) != nil else { return false }
model.open(url)
}
return true