diff --git a/.vs/youtube-downloader/xs/UserPrefs.xml b/.vs/youtube-downloader/xs/UserPrefs.xml index 4330388..e9f79ce 100644 --- a/.vs/youtube-downloader/xs/UserPrefs.xml +++ b/.vs/youtube-downloader/xs/UserPrefs.xml @@ -1,27 +1,28 @@  - + - + - + - + - + + + - - - + + + - diff --git a/Program.cs b/Program.cs index 1a60151..46a9acd 100644 --- a/Program.cs +++ b/Program.cs @@ -309,7 +309,7 @@ namespace youtube_downloader } public static void StorageFile(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary args) { - if (args["path"].StartsWith("config/")) + if (args["Path"].StartsWith("config/")) { rp.AsText("Access denied"); } diff --git a/Server/Functions/Downloader.cs b/Server/Functions/Downloader.cs index c34c07a..38491cd 100644 --- a/Server/Functions/Downloader.cs +++ b/Server/Functions/Downloader.cs @@ -673,6 +673,7 @@ namespace youtube_downloader.Server.Functions } break; } + ffmpeg.on_video_done(v.Video.Id, (int)v.Resolution); } } catch (Exception ex) { diff --git a/Server/Functions/ffmpeg.cs b/Server/Functions/ffmpeg.cs index 5192176..237543e 100644 --- a/Server/Functions/ffmpeg.cs +++ b/Server/Functions/ffmpeg.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; @@ -16,7 +16,29 @@ namespace youtube_downloader.Server.Functions } return "ffmpeg"; } + public static void on_video_done(string id,int res) + { + string path_to_video_id = Path.Combine(Downloader.DL.StorageLocation,"Info",$"{id}.json"); + Directory.CreateDirectory("config"); + string vdone= Path.Combine(Environment.CurrentDirectory, "config", "done"); + try + { + using (var p = new Process()) + { + p.StartInfo.FileName = vdone; + p.StartInfo.Arguments = $"\"{id}\" \"{path_to_video_id}\" {res}"; + p.StartInfo.UseShellExecute = false; + p.StartInfo.CreateNoWindow = true; + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.Start(); + } + } + catch (Exception ex) + { + _ = ex; + } + } internal static void mux(string mypath, string mypathCompleteAudio, string mypathIncompleteConverting) { using (var p = new Process()) diff --git a/bin/Release/youtube-downloader.exe b/bin/Release/youtube-downloader.exe index 1e98e63..b7233ec 100644 Binary files a/bin/Release/youtube-downloader.exe and b/bin/Release/youtube-downloader.exe differ diff --git a/obj/x86/Release/youtube-downloader.csprojAssemblyReference.cache b/obj/x86/Release/youtube-downloader.csprojAssemblyReference.cache index a54278b..1bd9c12 100644 Binary files a/obj/x86/Release/youtube-downloader.csprojAssemblyReference.cache and b/obj/x86/Release/youtube-downloader.csprojAssemblyReference.cache differ diff --git a/obj/x86/Release/youtube-downloader.exe b/obj/x86/Release/youtube-downloader.exe index 1e98e63..b7233ec 100644 Binary files a/obj/x86/Release/youtube-downloader.exe and b/obj/x86/Release/youtube-downloader.exe differ