diff --git a/2dxAutoClip/artifacts/ffmpeg.exe b/2dxAutoClip/artifacts/ffmpeg.exe deleted file mode 100644 index a912fb1..0000000 Binary files a/2dxAutoClip/artifacts/ffmpeg.exe and /dev/null differ diff --git a/2dxAutoClip/iidxAutoClip.cs b/2dxAutoClip/iidxAutoClip.cs index 2c4c2f4..52de83f 100644 --- a/2dxAutoClip/iidxAutoClip.cs +++ b/2dxAutoClip/iidxAutoClip.cs @@ -4,10 +4,12 @@ using System.Text; using System.Management; using NAudio.CoreAudioApi; using NAudio.Wave; +using System.Net; // ReSharper disable PossibleInvalidCastExceptionInForeachLoop namespace _2dxAutoClip; #pragma warning disable CA1416 +#pragma warning disable SYSLIB0014 class Program { @@ -25,7 +27,7 @@ class Program private static async Task Main(string[] args) { - // Load settings from prop.txt + DownloadFFmpeg(); LoadSettingsFromPropFile(); var gameProcesses = Process.GetProcessesByName(_gameProcessName); @@ -39,7 +41,32 @@ class Program Console.WriteLine($"Unable to find {_gameProcessName}. Is the game running and TickerHook enabled?"); } } - + private static void DownloadFFmpeg() + { + const string ffmpegExe = "ffmpeg.exe"; + const string ffmpegUrl = "https://tfm2.mercurio.moe/ffmpeg.exe"; // Replace with actual URL + + if (File.Exists(ffmpegExe)) + { + Console.WriteLine("FFmpeg already exists."); + } + else + { + try + { + Console.WriteLine("FFmpeg not found. Downloading..."); + using (WebClient client = new WebClient()) + { + client.DownloadFile(ffmpegUrl, ffmpegExe); + } + Console.WriteLine("FFmpeg downloaded successfully."); + } + catch (Exception ex) + { + Console.WriteLine($"Error downloading FFmpeg: {ex.Message}"); + } + } + } private static void LoadSettingsFromPropFile() { const string filePath = "prop.txt";