added done

This commit is contained in:
Michael Nolan 2021-09-27 00:52:31 -05:00
parent 81da4967f5
commit cd418bfd01
7 changed files with 35 additions and 11 deletions

View File

@ -1,27 +1,28 @@
<Properties StartupConfiguration="{E26F8159-6B4B-4660-A7A4-D0333DFEF0DD}|Default" NuGet.AddPackagesDialog.IncludePrerelease="True"> <Properties StartupConfiguration="{E26F8159-6B4B-4660-A7A4-D0333DFEF0DD}|Default" NuGet.AddPackagesDialog.IncludePrerelease="True">
<MonoDevelop.Ide.Workbench ActiveDocument="Program.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="../../../usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets">
<Files> <Files>
<File FileName="Program.cs" Line="253" Column="7" /> <File FileName="Program.cs" Line="312" Column="24" />
<File FileName="Server/Models/InfoType.cs" Line="45" Column="39" /> <File FileName="Server/Models/InfoType.cs" Line="45" Column="39" />
<File FileName="Server/Models/YoutubeDownloaderResponse.cs" Line="1" Column="1" /> <File FileName="Server/Models/YoutubeDownloaderResponse.cs" Line="1" Column="1" />
<File FileName="Server/Functions/Downloader.cs" Line="642" Column="24" /> <File FileName="Server/Functions/Downloader.cs" Line="487" Column="41" />
<File FileName="Server/Functions/SavedMedia.cs" Line="1" Column="1" /> <File FileName="Server/Functions/SavedMedia.cs" Line="1" Column="1" />
<File FileName="Server/Models/SavedVideo.cs" Line="7" Column="29" /> <File FileName="Server/Models/SavedVideo.cs" Line="35" Column="10" />
<File FileName="Server/Models/InfomationQueueItem.cs" Line="25" Column="27" /> <File FileName="Server/Models/InfomationQueueItem.cs" Line="25" Column="27" />
<File FileName="Server/Functions/ffmpeg.cs" Line="1" Column="1" /> <File FileName="Server/Functions/ffmpeg.cs" Line="19" Column="15" />
<File FileName="../Projects/tytdtool/tytdtool/Program.cs" Line="1" Column="1" />
<File FileName="../../../usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets" Line="2101" Column="5" />
</Files> </Files>
<Pads> <Pads>
<Pad Id="ProjectPad"> <Pad Id="ProjectPad">
<State name="__root__"> <State name="__root__">
<Node name="youtube-downloader" expanded="True"> <Node name="youtube-downloader" expanded="True">
<Node name="youtube-downloader" expanded="True"> <Node name="youtube-downloader" expanded="True">
<Node name="References" expanded="True" />
<Node name="Properties" expanded="True" />
<Node name="Server" expanded="True"> <Node name="Server" expanded="True">
<Node name="Functions" expanded="True" /> <Node name="Functions" expanded="True">
<Node name="Downloader.cs" selected="True" />
</Node>
<Node name="Models" expanded="True" /> <Node name="Models" expanded="True" />
</Node> </Node>
<Node name="Program.cs" selected="True" />
</Node> </Node>
</Node> </Node>
</State> </State>

View File

@ -309,7 +309,7 @@ namespace youtube_downloader
} }
public static void StorageFile(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args) public static void StorageFile(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{ {
if (args["path"].StartsWith("config/")) if (args["Path"].StartsWith("config/"))
{ {
rp.AsText("Access denied"); rp.AsText("Access denied");
} }

View File

@ -673,6 +673,7 @@ namespace youtube_downloader.Server.Functions
} }
break; break;
} }
ffmpeg.on_video_done(v.Video.Id, (int)v.Resolution);
} }
} catch (Exception ex) } catch (Exception ex)
{ {

View File

@ -16,7 +16,29 @@ namespace youtube_downloader.Server.Functions
} }
return "ffmpeg"; 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) internal static void mux(string mypath, string mypathCompleteAudio, string mypathIncompleteConverting)
{ {
using (var p = new Process()) using (var p = new Process())

Binary file not shown.