diff --git a/Crunchyroll-Downloader/AboutWindow.xaml b/Crunchyroll-Downloader/AboutWindow.xaml
index a7e6c5c..8048f46 100644
--- a/Crunchyroll-Downloader/AboutWindow.xaml
+++ b/Crunchyroll-Downloader/AboutWindow.xaml
@@ -19,7 +19,7 @@
-
+
diff --git a/Crunchyroll-Downloader/Program.cs b/Crunchyroll-Downloader/Program.cs
index 47bcfd0..b49e773 100644
--- a/Crunchyroll-Downloader/Program.cs
+++ b/Crunchyroll-Downloader/Program.cs
@@ -13,13 +13,13 @@ public class Program
public string Format { get; set; }
public string SavePath { get; set; }
public string Quality { get; set; }
- public string MkvStatus { get; set; }
- public string DlStatus { get; set; }
+ public string MkvStatus { get; set; }
+ public string DlStatus { get; set; }
- ///
- /// Downloadings a file.
- ///
- public void Downloading()
+ ///
+ /// Downloadings a file.
+ ///
+ public void Downloading()
{
var dl_status = new Program();
var process = new Process();
@@ -28,59 +28,61 @@ public void Downloading()
process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
// process.StartInfo.RedirectStandardOutput = true;
- if (MkvStatus == "1")
- {
- if (STState == "1")
- {
- if (Quality == "best")
- process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f best --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- else
- process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- }
- else
- {
- if (Quality == "best")
- process.StartInfo.Arguments = $"-f best --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- else
- process.StartInfo.Arguments = $"-f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- }
- }
- else
- {
- if (STState == "1")
- {
- if (Quality == "best")
- process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f best --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- else
- process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- }
- else
- {
- if (Quality == "best")
- process.StartInfo.Arguments = $"-f best --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- else
- process.StartInfo.Arguments = $"-f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
- }
- }
+ SavePath = SavePath + @"\%(title)s.%(ext)s";
+
+ if (MkvStatus == "1")
+ {
+ if (STState == "1")
+ {
+ if (Quality == "best")
+ process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f best --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ else
+ process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ }
+ else
+ {
+ if (Quality == "best")
+ process.StartInfo.Arguments = $"-f best --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ else
+ process.StartInfo.Arguments = $"-f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --recode-video mkv --embed-subs --postprocessor-args \"-disposition:s:0 default\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ }
+ }
+ else
+ {
+ if (STState == "1")
+ {
+ if (Quality == "best")
+ process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f best --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ else
+ process.StartInfo.Arguments = $"--write-sub --sub-lang {Langue} --sub-format {Format} -f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ }
+ else
+ {
+ if (Quality == "best")
+ process.StartInfo.Arguments = $"-f best --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ else
+ process.StartInfo.Arguments = $"-f \"best[height={Quality}]\" --no-part -o \"{SavePath}\" --cookies C:\\ProgramData\\Crunchy-DL\\cookies.txt {Url}";
+ }
+ }
- var viewerThread = new Thread(() =>
- {
- var download_window = new DownloadWindow();
- download_window.Show();
- download_window.Activate();
- download_window.Closed += (s, e) =>
- Dispatcher.CurrentDispatcher.BeginInvokeShutdown(DispatcherPriority.Normal);
- Dispatcher.Run();
- });
- viewerThread.SetApartmentState(ApartmentState.STA); // needs to be STA or throws exception
- viewerThread.Start();
+ var viewerThread = new Thread(() =>
+ {
+ var download_window = new DownloadWindow();
+ download_window.Show();
+ download_window.Activate();
+ download_window.Closed += (s, e) =>
+ Dispatcher.CurrentDispatcher.BeginInvokeShutdown(DispatcherPriority.Normal);
+ Dispatcher.Run();
+ });
+ viewerThread.SetApartmentState(ApartmentState.STA); // needs to be STA or throws exception
+ viewerThread.Start();
- process.Start();
- process.WaitForExit();// Waits here for the process to exit.
- viewerThread.Abort();
- MessageBox.Show("Download finished !", "Success !", MessageBoxButton.OK, MessageBoxImage.Information);
+ process.Start();
+ process.WaitForExit();// Waits here for the process to exit.
+ viewerThread.Abort();
+ MessageBox.Show("Download finished !", "Success !", MessageBoxButton.OK, MessageBoxImage.Information);
- }
+ }
}
}