fix: increase yt-dlp timeout for YouTube JS PoW

The latest yt-dlp release (2026.06.09) requires heavy JavaScript execution to solve YouTube's PoW challenges. This takes ~35s on most machines, which exceeded the hardcoded 30s timeout, causing 'Failed to load options'. Increased the timeout to 120s and improved the UI to show actual errors instead of hardcoding 'Failed to load options'.
This commit is contained in:
NimBold
2026-06-11 05:00:39 +03:30
parent a916ff3f92
commit 49a4358212
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -322,10 +322,18 @@ struct AddDownloadsView: View {
ProgressView().controlSize(.small)
Text("Fetching media options...")
.foregroundStyle(.secondary)
} else if case .failed(_) = firstMedia.state {
Image(systemName: "exclamationmark.triangle.fill").foregroundStyle(.red)
Text("Failed to load options.")
.foregroundStyle(.secondary)
} else if case .failed(let errorMsg) = firstMedia.state {
VStack(alignment: .leading, spacing: 4) {
HStack(spacing: 8) {
Image(systemName: "exclamationmark.triangle.fill").foregroundStyle(.red)
Text("Failed to load options.")
.foregroundStyle(.secondary)
}
Text(errorMsg)
.font(.caption)
.foregroundStyle(.red)
.lineLimit(3)
}
} else {
ProgressView().controlSize(.small)
Text("Waiting for metadata...")
+1 -1
View File
@@ -59,7 +59,7 @@ enum MediaExtractionEngine {
}
nonisolated(unsafe) private static let metadataCache = NSCache<NSURL, CacheEntry>()
private static let metadataTimeoutSeconds: UInt64 = 30
private static let metadataTimeoutSeconds: UInt64 = 120
enum ExtractionError: Error, LocalizedError {
case processFailed(String)