Skip to content

Commit b605137

Browse files
committed
Remove UseWindowsEncodingWorkaround
1 parent b2f7968 commit b605137

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

YoutubeDLSharp/YoutubeDL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ protected virtual OptionSet GetDownloadOptions()
391391
NoOverwrites = !this.OverwriteFiles,
392392
NoPart = true,
393393
FfmpegLocation = Utils.GetFullPath(this.FFmpegPath),
394-
Exec = "echo outfile: {}"
394+
Print = "after_move:outfile: %(filepath)s"
395395
};
396396
}
397397

YoutubeDLSharp/YoutubeDLProcess.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ public class YoutubeDLProcess
3838
/// </summary>
3939
public string ExecutablePath { get; set; }
4040

41-
/// <summary>
42-
/// Windows only. If set to true, start process via cmd.exe to support Unicode chars.
43-
/// </summary>
44-
public bool UseWindowsEncodingWorkaround { get; set; } = true;
45-
4641
/// <summary>
4742
/// Occurs each time yt-dlp writes to the standard output.
4843
/// </summary>
@@ -98,17 +93,7 @@ public async Task<int> RunAsync(string[] urls, OptionSet options,
9893
StandardOutputEncoding = Encoding.UTF8,
9994
StandardErrorEncoding = Encoding.UTF8,
10095
};
101-
if (OSHelper.IsWindows && UseWindowsEncodingWorkaround)
102-
{
103-
startInfo.FileName = "cmd.exe";
104-
string runCommand;
105-
if (!String.IsNullOrEmpty(PythonPath))
106-
runCommand = $"\"{PythonPath}\" \"{ExecutablePath}\" {ConvertToArgs(urls, options)}";
107-
else
108-
runCommand = $"\"{ExecutablePath}\" {ConvertToArgs(urls, options)}";
109-
startInfo.Arguments = $"/C chcp 65001 >nul 2>&1 && {runCommand}";
110-
}
111-
else if (!String.IsNullOrEmpty(PythonPath))
96+
if (!String.IsNullOrEmpty(PythonPath))
11297
{
11398
startInfo.FileName = PythonPath;
11499
startInfo.Arguments = $"\"{ExecutablePath}\" {ConvertToArgs(urls, options)}";

0 commit comments

Comments
 (0)