2022-04-06 16:41:29 +00:00
|
|
|
|
using Tesses.YouTubeDownloader;
|
|
|
|
|
using Tesses.YouTubeDownloader.Server;
|
|
|
|
|
using Tesses.WebServer;
|
|
|
|
|
namespace Tesses.YouTubeDownloader.Net6
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static async Task Main(string[] args)
|
|
|
|
|
{
|
2022-05-14 01:49:10 +00:00
|
|
|
|
if(args.Contains("--docker"))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Environment.CurrentDirectory="/data";
|
|
|
|
|
}
|
2022-04-06 16:41:29 +00:00
|
|
|
|
TYTDCurrentDirectory currentDirectory=new TYTDCurrentDirectory(new HttpClient());
|
|
|
|
|
TYTDServer server=new TYTDServer(currentDirectory);
|
|
|
|
|
server.RootServer.Server=new StaticServer("WebSite");
|
2022-05-14 01:49:10 +00:00
|
|
|
|
currentDirectory.CanDownload=false;
|
2022-05-11 23:14:16 +00:00
|
|
|
|
HttpServerListener listener=new HttpServerListener(new System.Net.IPEndPoint(System.Net.IPAddress.Any,3252),server.InnerServer);
|
2022-04-06 16:41:29 +00:00
|
|
|
|
currentDirectory.StartLoop();
|
|
|
|
|
TYTDStorage.FFmpeg ="/usr/bin/ffmpeg";
|
|
|
|
|
Console.WriteLine("Almost Ready to Listen");
|
|
|
|
|
await listener.ListenAsync(CancellationToken.None);
|
2022-05-11 23:14:16 +00:00
|
|
|
|
|
2022-04-06 16:41:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|