From 49a435821274dece181cf260660064482153acb5 Mon Sep 17 00:00:00 2001 From: NimBold Date: Thu, 11 Jun 2026 05:00:39 +0330 Subject: [PATCH] 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'. --- Sources/Firelink/AddDownloadsView.swift | 16 ++++++++++++---- Sources/Firelink/MediaExtractionEngine.swift | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Sources/Firelink/AddDownloadsView.swift b/Sources/Firelink/AddDownloadsView.swift index d78e700..a916ab8 100644 --- a/Sources/Firelink/AddDownloadsView.swift +++ b/Sources/Firelink/AddDownloadsView.swift @@ -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...") diff --git a/Sources/Firelink/MediaExtractionEngine.swift b/Sources/Firelink/MediaExtractionEngine.swift index a4f35ac..d61fb53 100644 --- a/Sources/Firelink/MediaExtractionEngine.swift +++ b/Sources/Firelink/MediaExtractionEngine.swift @@ -59,7 +59,7 @@ enum MediaExtractionEngine { } nonisolated(unsafe) private static let metadataCache = NSCache() - private static let metadataTimeoutSeconds: UInt64 = 30 + private static let metadataTimeoutSeconds: UInt64 = 120 enum ExtractionError: Error, LocalizedError { case processFailed(String)