mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-13 13:06:52 +00:00
feat: enhance media engine settings with cookie extraction and update checks
- Added `mediaCookieSource` to `AppSettings` to let users choose the browser for cookie extraction. - Refactored `EngineSettingsPane` to display `yt-dlp` and `ffmpeg` statuses. - Added a manual 'Check for Updates' button with UI loading feedback. - Passed `--cookies-from-browser` to both metadata extraction and download engines if configured. - Added `--ignore-no-formats-error` to `yt-dlp` metadata extraction to prevent crashes on restricted videos.
This commit is contained in:
@@ -57,7 +57,19 @@ enum MediaExtractionEngine {
|
||||
|
||||
let process = Process()
|
||||
process.executableURL = URL(fileURLWithPath: ytDlpPath)
|
||||
process.arguments = ["-J", "--no-warnings", url.absoluteString]
|
||||
|
||||
var args = ["-J", "--no-warnings", "--ignore-no-formats-error"]
|
||||
|
||||
// Add cookies if configured
|
||||
if let storedData = UserDefaults.standard.data(forKey: "Firelink.AppSettings.v1"),
|
||||
let json = try? JSONSerialization.jsonObject(with: storedData) as? [String: Any],
|
||||
let cookieSourceStr = json["mediaCookieSource"] as? String,
|
||||
cookieSourceStr != "None" {
|
||||
args.append(contentsOf: ["--cookies-from-browser", cookieSourceStr.lowercased()])
|
||||
}
|
||||
|
||||
args.append(url.absoluteString)
|
||||
process.arguments = args
|
||||
|
||||
let pipe = Pipe()
|
||||
let errorPipe = Pipe()
|
||||
|
||||
Reference in New Issue
Block a user