diff --git a/src/Ytdlp.NET/Ytdlp.cs b/src/Ytdlp.NET/Ytdlp.cs
index 6368511..6a33ba0 100644
--- a/src/Ytdlp.NET/Ytdlp.cs
+++ b/src/Ytdlp.NET/Ytdlp.cs
@@ -290,17 +290,10 @@ public Ytdlp AddOption(string key, string value)
///
///
///
- private List BuildArguments(string url)
+ private List BuildConnectionArguments()
{
var args = new List();
- bool usingAbsoluteOutput = !string.IsNullOrWhiteSpace(_outputFolder);
-
- if (usingAbsoluteOutput && !string.IsNullOrWhiteSpace(_tempFolder))
- {
- _logger.Log(LogType.Debug, "Temp folder ignored because absolute output template is used.");
- }
-
// Authentication
if (_auth is not null)
{
@@ -324,6 +317,40 @@ private List BuildArguments(string url)
args.Add("-"); // tells yt-dlp to read from stdin
}
+ // Options
+ if (_options.Length > 0)
+ {
+ foreach (var kv in _options)
+ {
+ args.Add(kv.Key);
+ if (kv.Value != null)
+ args.Add(kv.Value);
+ }
+ }
+
+ // Special single-value options
+ if (_cookiesFile is not null) { args.Add("--cookies"); args.Add(_cookiesFile); }
+ if (_cookiesFromBrowser is not null) { args.Add("--cookies-from-browser"); args.Add(_cookiesFromBrowser); }
+ if (_proxy is not null) { args.Add("--proxy"); args.Add(_proxy); }
+ if (_ffmpegLocation is not null) { args.Add("--ffmpeg-location"); args.Add(_ffmpegLocation); }
+ if (_sponsorblockMark is not null) { args.Add("--sponsorblock-mark"); args.Add(_sponsorblockMark); }
+ if (_sponsorblockRemove is not null) { args.Add("--sponsorblock-remove"); args.Add(_sponsorblockRemove); }
+ if (_sponsorblockChapterTitle is not null) { args.Add("--sponsorblock-chapter-title"); args.Add(_sponsorblockChapterTitle); }
+
+ return args;
+ }
+
+ private List BuildArguments(string url)
+ {
+ var args = BuildConnectionArguments();
+
+ bool usingAbsoluteOutput = !string.IsNullOrWhiteSpace(_outputFolder);
+
+ if (usingAbsoluteOutput && !string.IsNullOrWhiteSpace(_tempFolder))
+ {
+ _logger.Log(LogType.Debug, "Temp folder ignored because absolute output template is used.");
+ }
+
// temp folder
if (!usingAbsoluteOutput && !string.IsNullOrWhiteSpace(_tempFolder))
{
@@ -372,26 +399,6 @@ private List BuildArguments(string url)
if (_flags.Length > 0)
args.AddRange(_flags);
- // Options
- if (_options.Length > 0)
- {
- foreach (var kv in _options)
- {
- args.Add(kv.Key);
- if (kv.Value != null)
- args.Add(kv.Value);
- }
- }
-
- // Special single-value options
- if (_cookiesFile is not null) { args.Add("--cookies"); args.Add(_cookiesFile); }
- if (_cookiesFromBrowser is not null) { args.Add("--cookies-from-browser"); args.Add(_cookiesFromBrowser); }
- if (_proxy is not null) { args.Add("--proxy"); args.Add(_proxy); }
- if (_ffmpegLocation is not null) { args.Add("--ffmpeg-location"); args.Add(_ffmpegLocation); }
- if (_sponsorblockMark is not null) { args.Add("--sponsorblock-mark"); args.Add(_sponsorblockMark); }
- if (_sponsorblockRemove is not null) { args.Add("--sponsorblock-remove"); args.Add(_sponsorblockRemove); }
- if (_sponsorblockChapterTitle is not null) { args.Add("--sponsorblock-chapter-title"); args.Add(_sponsorblockChapterTitle); }
-
// URL last
args.Add(url);
diff --git a/src/Ytdlp.NET/Ytdlp/Ytdlp.Probe.cs b/src/Ytdlp.NET/Ytdlp/Ytdlp.Probe.cs
index 9d8ea79..67af13b 100644
--- a/src/Ytdlp.NET/Ytdlp/Ytdlp.Probe.cs
+++ b/src/Ytdlp.NET/Ytdlp/Ytdlp.Probe.cs
@@ -443,6 +443,8 @@ public async Task> GetSubtitlesAsync(string url, Cancellatio
var result = await runner.ExecuteAsync(
arguments,
+ auth: _auth,
+ adobePass: _adobePass,
onLineReceived: null,
ct: ct,
tuneProcess: tuneProcess,
@@ -475,7 +477,10 @@ public async Task> GetSubtitlesAsync(string url, Cancellatio
if (string.IsNullOrWhiteSpace(url))
throw new ArgumentException("URL cannot be empty.", nameof(url));
+ var connectionArguments = string.Join(" ", BuildConnectionArguments().Select(EscapeArgument));
+
var arguments =
+ (connectionArguments.Length > 0 ? connectionArguments + " " : string.Empty) +
"--dump-single-json " +
"--simulate " +
"--skip-download " +