Completely Eliminated Downloader.DL.GetPath, Auth Basic Support, and extension provided Home Pages (TYTD Frontend)

This commit is contained in:
Michael Nolan 2022-03-31 05:00:04 -05:00
parent 4bf5797ed0
commit 991236eafe
17 changed files with 709 additions and 115 deletions

View File

@ -1,22 +1,23 @@
<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>
<File FileName="TYTD.Api/Server/Models/InfoType.cs" Line="155" Column="47" />
<File FileName="TYTD.Api/Server/Functions/Downloader.cs" Line="69" Column="28" />
<File FileName="TYTD.Api/Server/Functions/Downloader.cs" Line="1141" Column="18" />
<File FileName="TYTD.Api/Server/Models/SavedMedia.cs" Line="1" Column="1" />
<File FileName="TYTD.Api/Server/Models/SavedVideo.cs" Line="8" Column="1" />
<File FileName="TYTD.Api/Server/Models/InfomationQueueItem.cs" Line="280" Column="42" />
<File FileName="TYTD.Api/Server/Functions/ffmpeg.cs" Line="5" Column="15" />
<File FileName="Program.cs" Line="1561" Column="1" />
<File FileName="TYTD.Api/MyClass.cs" Line="225" Column="46" />
<File FileName="TYTD.Api/Server/Models/InfomationQueueItem.cs" Line="269" Column="74" />
<File FileName="TYTD.Api/Server/Functions/ffmpeg.cs" Line="1" Column="1" />
<File FileName="Program.cs" Line="217" Column="117" />
<File FileName="TYTD.Api/MyClass.cs" Line="287" Column="37" />
<File FileName="TYTD.Api/Server/Models/SavedChannel.cs" Line="6" Column="10" />
<File FileName="TYTD.Api/Server/Models/SavedPlaylist.cs" Line="7" Column="1" />
<File FileName="TYTD.Api/Server/Models/VideoDownloadProgress.cs" Line="13" Column="1" />
<File FileName="youtube-downloader.csproj" Line="1" Column="1" />
<File FileName="../../../usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets" Line="2101" Column="5" />
<File FileName="TYTD.Api/Server/Models/IEnumerator.cs" Line="1" Column="1" />
<File FileName="TYTD.Api/SimpleHttpExtensions.cs" Line="17" Column="19" />
<File FileName="Broadcast.cs" Line="3" Column="15" />
<File FileName="Broadcast.cs" Line="23" Column="38" />
<File FileName="packages.config" Line="1" Column="1" />
<File FileName="../../../../usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets" Line="2101" Column="5" />
</Files>
<Pads>
<Pad Id="ProjectPad">
@ -24,13 +25,14 @@
<Node name="youtube-downloader" expanded="True">
<Node name="TYTD.Api" 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>
</Node>
<Node name="youtube-downloader" expanded="True">
<Node name="Properties" expanded="True" />
<Node name="Program.cs" selected="True" />
</Node>
</Node>
</State>
@ -42,7 +44,7 @@
<MonoDevelop.Ide.ItemProperties.youtube-downloader PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<Breakpoint file="/home/mike/tytd-server/TYTD.Api/Server/Models/YoutubeDownloaderResponse.cs" relfile="TYTD.Api/Server/Models/YoutubeDownloaderResponse.cs" line="10" column="1" />
<Breakpoint file="/home/ddlovato/git/tytd-server/TYTD.Api/Server/Models/YoutubeDownloaderResponse.cs" relfile="TYTD.Api/Server/Models/YoutubeDownloaderResponse.cs" line="10" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />

View File

@ -40,9 +40,17 @@ namespace TYTD
}
}
static string webSitePath;
static ApiHomePageInfo info;
//static string webSitePath;
static void Main(string[] arg)
{
foreach (var dir in new[] {"Info", "PersonalPlaylist", "NotConverted","Converted","Audio","Download","Channel","Playlist","WebSite","ClosedCaptions","config/apidll","config/apistore", "Thumbnails/120x90", "Thumbnails/168x94", "Thumbnails/196x110", "Thumbnails/320x180", "Thumbnails/360x202", "Thumbnails/480x360", "Thumbnails/900x900", "Thumbnails/1280x720", "Thumbnails/1920x1080", "Thumbnails/246x138", "Thumbnails/336x188", "Thumbnails/480x270", "Thumbnails/720x404" })
{
Directory.CreateDirectory(dir);
}
info = new ApiHomePageInfo();
Directory.CreateDirectory(Path.Combine("config", "apidll"));
Downloader.GetManifest = GetManifest;
@ -108,7 +116,8 @@ namespace TYTD
// we need to get our app name so that
// we can create unique names for our mutex and our pipe
webSitePath = Downloader.DL.GetPath(true, "WebSite");
//webSitePath = Downloader.DL.GetPath(true, "WebSite");
Directory.CreateDirectory("WebSite");
Route.Before += Route_Before;
@ -184,10 +193,30 @@ namespace TYTD
Downloader.RouteAdd("/api/Storage/Video/{Id}","Storage","",(HttpAction)Video);
Downloader.RouteAdd("/api/Storage/VideoRes/{Res}/{Id}","Storage","Download Video to Computer from Downloader\nParams:\n{Res}: 0=HD (Muxed using ffmpeg), 1=SD (Premuxed Video), 2=Audio only\n{Id}: Video Id to Download",(HttpAction)VideoRes);
Downloader.RouteAdd("/api/upload/","Storage","Upload file via POST", (HttpAction)UploadFiles, "POST");
Downloader.RouteAdd("/api/upload/","Admin","Upload file via POST", (HttpAction)UploadFiles, "POST");
Downloader.RouteAdd("/api/endpoint","Generic","POST endpoint for many functions\n<a href=\"https://tesses.cf/markdown.php#apps/tytd/api_endpoint.md\">Documentation</a>", (HttpAction)Endpoint,"POST");
Downloader.RouteAdd("/api/endpoints.html","Other","This Page", (HttpAction)Endpoints);
Downloader.RouteAdd("/api/RestartServer", "Admin", "Restart server", (req, resp, args) =>
{
if (AuthorizedAdmin(req, resp, args))
{
ApiLoader.RestartApp();
}
});
Downloader.RouteAdd("/api/KillServer", "Admin", "Stop server", (req, resp, args) =>
{
if (AuthorizedAdmin(req, resp, args))
{
ApiLoader.StopApp();
}
});
Downloader.RouteAdd("/api/HomePageChanger.html", "Admin", "Change Home Page", (HttpAction)ChangeFrontEnd);
Downloader.RouteAdd("/api/SetHomePage", "Admin", "Used by /api/HomePageChanger.html to actually change home page", (HttpAction)SetFrontEnd, "POST");
Route.Add("/api/example_tripple_structure.json", (req, resp, args) =>
{
List<IDResolutionTypeTriplet> v = new List<IDResolutionTypeTriplet>();
@ -200,7 +229,38 @@ namespace TYTD
resp.AsJson(v);
});
ApiLoader.Init();
var cancel= ApiLoader.Init(info);
if (string.IsNullOrWhiteSpace(Config.HomePageExtension))
{
info.Change(null);
}
else
{
foreach(var ext in ApiLoader.EnumerateExtensions())
{
if(ext.CanProvideHomePage)
{
if(ext.Name.Equals(Config.HomePageExtension))
{
info.Change(ext);
}
}
}
}
info.Changed += (sender, e) =>
{
if(info.HasHomePage)
{
Config.HomePageExtension = info.HomePage.Name;
Config.Save();
}
else
{
Config.HomePageExtension = "";
Config.Save();
}
};
Downloader.RouteAdd("/api{p}","Other","Just a redirect to /api/endpoints.html", (request, response, action) =>
{
request.RedirectIt(response, "/api/endpoints.html");
@ -213,8 +273,8 @@ namespace TYTD
Downloader.RouteAdd("/", "Other", "Home page", (HttpAction)Index, "GET");
Downloader.RouteAdd("/extensions.html","Other","Extensions URL", (HttpAction)Extensions);
Downloader.RouteAdd("/{Path}","Other","Website Files", (HttpAction)RootPath);
Downloader.RouteAdd("/{Path}","Other","Upload file over put",(HttpAction)UploadFilePut,"PUT");
Console.CancelKeyPress += (sender, e) => { ApiLoader.Dispose();var date = DateTime.Now.ToString("yyyyMMdd_HHmmss");Directory.CreateDirectory(Path.Combine("config","queues-close")); File.WriteAllText(Path.Combine("config", "queues-close", $"{date}.json"), Downloader.GetQueue()); Console.WriteLine("TYTD has Closed"); Environment.Exit(0); };
Downloader.RouteAdd("/{Path}","Admin","Upload file over put",(HttpAction)UploadFilePut,"PUT");
Console.CancelKeyPress += (sender, e) => { ApiLoader.Dispose();var date = DateTime.Now.ToString("yyyyMMdd_HHmmss");Directory.CreateDirectory(Path.Combine("config","queues-close")); File.WriteAllText(Path.Combine("config", "queues-close", $"{date}.json"), Downloader.GetQueue()); Console.WriteLine("TYTD has Closed"); ApiLoader.StopApp(); };
Console.WriteLine("Almost Ready To Listen");
@ -222,17 +282,126 @@ namespace TYTD
if (arg.Length > 0)
{
HttpServer.ListenAsync(arg[0], CancellationToken.None, Route.OnHttpRequestAsync).Wait();
HttpServer.ListenAsync(arg[0],cancel, Route.OnHttpRequestAsync).Wait();
}
else
{
HttpServer.ListenAsync(3250, CancellationToken.None, Route.OnHttpRequestAsync).Wait();
HttpServer.ListenAsync(3250,cancel, Route.OnHttpRequestAsync).Wait();
}
if(ApiLoader.Restart)
{
var fileName = Assembly.GetExecutingAssembly().Location;
StringBuilder args = new StringBuilder();
foreach(var arg0 in arg)
{
args.Append($"\"{arg0}\"");
}
System.Diagnostics.Process.Start(fileName,args.ToString());
}
}
public class Configuration
{
public string AdminUserName { get; set; }
public string AdminPassword { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string HomePageExtension { get; set; }
public static void AddEscapedHtml<T>(this Dictionary<T,string> dict,T key,string value)
public void Save()
{
File.WriteAllText("config/configuration.json", JsonConvert.SerializeObject(this));
}
}
public static Configuration OpenConfig()
{
Directory.CreateDirectory("config");
if (File.Exists("config/configuration.json"))
{
return JsonConvert.DeserializeObject<Configuration>(File.ReadAllText("config/configuration.json"));
}
return new Configuration();
}
public static bool EmptyAuthorization(this Configuration config)
{
return string.IsNullOrWhiteSpace(config.UserName) && string.IsNullOrWhiteSpace(config.Password);
}
public static bool EmptyAuthorizationAdmin(this Configuration config)
{
return string.IsNullOrWhiteSpace(config.AdminUserName) && string.IsNullOrWhiteSpace(config.AdminPassword);
}
public static bool ValidAuthAdmin(this Configuration config, HttpListenerRequest req)
{
if (req.Headers.AllKeys.Contains("Authorization"))
{
string[] authorization = req.Headers["Authorization"].Split(' ');
//authorization_basic
if (authorization[0] == "Basic")
{
string userPass = Encoding.UTF8.GetString(Convert.FromBase64String(authorization[1]));
return userPass.Equals($"{config.AdminUserName}:{config.AdminPassword}", StringComparison.Ordinal);
}
}
return false;
}
public static bool ValidAuth(this Configuration config,HttpListenerRequest req)
{
if (req.Headers.AllKeys.Contains("Authorization"))
{
string[] authorization=req.Headers["Authorization"].Split(' ');
//authorization_basic
if(authorization[0]=="Basic")
{
string userPass=Encoding.UTF8.GetString(Convert.FromBase64String(authorization[1]));
return userPass.Equals($"{config.UserName}:{config.Password}",StringComparison.Ordinal);
}
}
return false;
}
internal static Configuration Config=OpenConfig();
internal static bool AuthorizedAdmin(HttpListenerRequest req, HttpListenerResponse resp, Dictionary<string, string> args)
{
if(Config.EmptyAuthorizationAdmin())
{
return true;
}
if(Config.ValidAuthAdmin(req))
{
return true;
}
resp.WithHeader("WWW-Authenticate", "Basic realm=\"TYTD_ADMIN\"").WithCode(HttpStatusCode.Unauthorized).AsText("Unauthorized");
return false;
}
internal static bool Authorized(HttpListenerRequest req, HttpListenerResponse resp, Dictionary<string, string> args)
{
if (Config.EmptyAuthorization())
{
return true;
}
if (Config.ValidAuth(req))
{
return true;
}
if(!Config.EmptyAuthorizationAdmin())
{
if(Config.ValidAuthAdmin(req))
{
return true;
}
}
resp.WithHeader("WWW-Authenticate", "Basic realm=\"TYTD_APP\"").WithCode(HttpStatusCode.Unauthorized).AsText("Unauthorized");
return false;
}
public static void AddEscapedHtml<T>(this Dictionary<T,string> dict,T key,string value)
{
dict.Add(key, WebUtility.HtmlEncode(value));
}
@ -341,7 +510,7 @@ namespace TYTD
}
public static void Redownload(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
foreach (var item in Directory.GetFiles(Downloader.DL.GetPath(true, "Info"), "*.json"))
foreach (var item in Directory.GetFiles("Info", "*.json"))
{
string id =Path.GetFileNameWithoutExtension(item);
if(!File.Exists(Path.Combine("NotConverted",$"{id}.mp4")))
@ -363,7 +532,7 @@ namespace TYTD
return;
}
string res_str = new[]{"Converted","NotConverted","Audio"}[res];
foreach (var item in Directory.GetFiles(Downloader.DL.GetPath(true, "Info"), "*.json"))
foreach (var item in Directory.GetFiles( "Info", "*.json"))
{
string id = Path.GetFileNameWithoutExtension(item);
if (!File.Exists(Path.Combine(res_str, $"{id}.mp4")))
@ -376,7 +545,7 @@ namespace TYTD
}
public static void Watch(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
var txt = Templating.RenderFile(Path.Combine(webSitePath, "watch_page.thtml"), args); //populate template
var txt = Templating.RenderFile(Path.Combine("WebSite", "watch_page.thtml"), args); //populate template
rp.AsText(txt);
}
#endregion
@ -963,7 +1132,7 @@ namespace TYTD
#region Storage
public static void StorageGetDirectories(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string path = Downloader.DL.GetPath(true, System.Web.HttpUtility.UrlDecode(args["Path"]));
string path = System.Web.HttpUtility.UrlDecode(args["Path"]);
if (Directory.Exists(path))
{
@ -977,7 +1146,7 @@ namespace TYTD
}
public static void StorageGetFiles(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string path = Downloader.DL.GetPath(true, System.Web.HttpUtility.UrlDecode(args["Path"]));
string path = System.Web.HttpUtility.UrlDecode(args["Path"]);
if (Directory.Exists(path))
{
@ -991,14 +1160,14 @@ namespace TYTD
}
public static void StorageDirectoryExists(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string path = Downloader.DL.GetPath(true, System.Web.HttpUtility.UrlDecode(args["Path"]));
string path =System.Web.HttpUtility.UrlDecode(args["Path"]);
string json = Directory.Exists(path) ? "true" : "false";
rp.AsText(json, "text/plain");
}
public static void StorageFileExists(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string path = Downloader.DL.GetPath(true, System.Web.HttpUtility.UrlDecode(args["Path"]));
string path =System.Web.HttpUtility.UrlDecode(args["Path"]);
string json = File.Exists(path) ? "true" : "false";
rp.AsText(json, "text/plain");
@ -1011,7 +1180,7 @@ namespace TYTD
}
else
{
string path = Downloader.DL.GetPath(true, System.Web.HttpUtility.UrlDecode(args["Path"]));
string path = System.Web.HttpUtility.UrlDecode(args["Path"]);
if (Directory.Exists(path))
{
string indexHtml = Path.Combine(path, "index.html");
@ -1021,7 +1190,7 @@ namespace TYTD
}
else
{
string dir = Path.Combine(webSitePath, "err", "dir.html");
string dir = Path.Combine("WebSite", "err", "dir.html");
StringBuilder b = new StringBuilder();
var f = Directory.GetLastWriteTime(Path.GetDirectoryName(path));
string parentModified = $"{f.ToShortDateString()} {f.ToShortTimeString()}";
@ -1061,7 +1230,7 @@ namespace TYTD
VideoId? vid = VideoId.TryParse(System.Web.HttpUtility.UrlDecode(args["Id"]));
if (vid.HasValue)
{
string path = Downloader.DL.GetPath(true, "NotConverted",vid.Value +".mp4");
string path = $"NotConverted/{vid.Value}.mp4";
rp.AddHeader("Content-Disposition", GetVideoContentDisposition(vid.Value).ToString());
rp.AsFile(rq, path);
}
@ -1087,7 +1256,7 @@ namespace TYTD
else
{
string[] m = new string[] { "Converted", "NotConverted", "Audio" };
string path = Downloader.DL.GetPath(true, m[res], vid.Value + ".mp4");
string path = $"{m[res]}/{vid.Value}.mp4";
rp.AddHeader("Content-Disposition", GetVideoContentDisposition(vid.Value).ToString());
rp.AsFile(rq, path);
}
@ -1117,7 +1286,7 @@ namespace TYTD
public static string GetVideoName(string id)
{
string name = id + ".mp4";
string path = Downloader.DL.GetPath(true, "Info", id + ".json");
string path = $"Info/{id}.json";
if (File.Exists(path))
{
string info=File.ReadAllText(path);
@ -1141,14 +1310,74 @@ namespace TYTD
{
var files = rq.ParseBody(args);
foreach (var f in files.Values)
f.Save(Path.Combine(webSitePath, f.FileName));
f.Save(Path.Combine("WebSite", f.FileName));
rp.AsText("uploaded", "text/plain");
}
#endregion
#region Other
public static void SetFrontEnd(HttpListenerRequest req,HttpListenerResponse resp,Dictionary<string,string> args)
{
if(AuthorizedAdmin(req,resp,args))
{
req.ParseBody(args);
if(args.ContainsKey("frontend"))
{
string value=args["frontend"];
if (string.IsNullOrWhiteSpace(value))
{
info.Change(null);
}
else {
foreach (var ext in ApiLoader.EnumerateExtensions())
{
if(ext.CanProvideHomePage)
{
if(value.Equals(ext.Name))
{
info.Change(ext);
}
}
}
}
}
resp.AsRedirect("../");
}
}
public static void ChangeFrontEnd(HttpListenerRequest req,HttpListenerResponse resp,Dictionary<string,string> args)
{
if (AuthorizedAdmin(req, resp, args))
{
Dictionary<string, string> arg_ = new Dictionary<string, string>();
if (info.HasHomePage)
{
arg_.Add("DefaultSelected", "");
}
else
{
arg_.Add("DefaultSelected", "selected");
}
StringBuilder b = new StringBuilder();
foreach (var ext in ApiLoader.EnumerateExtensions())
{
if (ext.CanProvideHomePage)
{
string selected = ext == info.HomePage ? " selected" : "";
string htmlCode = $"<option value=\"{ext.Name}\"{selected}>{ext.Name}</option>";
b.Append(htmlCode);
}
}
arg_.Add("Frontends", b.ToString());
string r=ApiLoader.RenderFileOrDefault("WebPage/err/change_frontend_ui.html", "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Select Home Page</title></head><body><h1>Select Home Page</h1><form action=\"../api/SetHomePage\" method=\"POST\"><select name=\"frontend\"><option value=\"\" {DefaultSelected}>Default</option>{Frontends}</select><input type=\"submit\" value=\"Set\"></form></body></html>", arg_);
resp.AsText(r);
}
// /err/change_frontend_ui.html
}
public static void Index(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string r = ApiLoader.ReadAllTextOrDefault(Path.Combine(webSitePath, "index.html"), "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>TYTD</title></head><body><h1>TYTD</h1><form action=\"./api/endpoint\" method=\"POST\"><input type=\"text\" name=\"url\"><select name=\"resolution\"><option value=\"1\" selected>SD</option><option value=\"0\">HD</option><option value=\"2\">Audio</option></select><input type=\"submit\" value=\"Add To Downloader\"></form>Existing Videos: <form action=\"./api/SearchVideos/\" method=\"POST\"><input type=\"search\" name=\"query\"><input type=\"submit\" value=\"Search\"></form><br><a href=\"./api/Progress.html\">Get Progress</a><br><a href=\"./api/QueueListPage/\">List Queue</a><br><a href=\"./api/ListPlaylists/\">List Playlists</a><br></body></html>");
string r = ApiLoader.ReadAllTextOrDefault( "WebSite/index.html", "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>TYTD</title></head><body><h1>TYTD</h1><form action=\"./api/endpoint\" method=\"POST\"><input type=\"text\" name=\"url\"><select name=\"resolution\"><option value=\"1\" selected>SD</option><option value=\"0\">HD</option><option value=\"2\">Audio</option></select><input type=\"submit\" value=\"Add To Downloader\"></form>Existing Videos: <form action=\"./api/SearchVideos/\" method=\"POST\"><input type=\"search\" name=\"query\"><input type=\"submit\" value=\"Search\"></form><br><a href=\"./api/Progress.html\">Get Progress</a><br><a href=\"./api/QueueListPage/\">List Queue</a><br><a href=\"./api/ListPlaylists/\">List Playlists</a><br></body></html>");
rp.AsText( r);
}
@ -1180,7 +1409,7 @@ namespace TYTD
private static void UploadFilePut(HttpListenerRequest request, HttpListenerResponse response, Dictionary<string, string> arguments)
{
string p = System.Web.HttpUtility.UrlDecode(arguments["Path"]).Split(new char[] { '?' }, StringSplitOptions.RemoveEmptyEntries)[0];
string path = Path.Combine(webSitePath, p);
string path = Path.Combine("WebSite", p);
bool exists = File.Exists(path);
using (var instr = request.InputStream)
{
@ -1246,7 +1475,7 @@ namespace TYTD
if (arguments["operation"] == "create_personal_playlist")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path = $"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = new List<(string Id, Resolution Resolution)>();
@ -1257,7 +1486,7 @@ namespace TYTD
else if (arguments["operation"] == "create_personal_playlist_res")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path=$"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = new List<(string Id, Resolution Resolution)>();
@ -1275,7 +1504,7 @@ namespace TYTD
else if (arguments["operation"] == "add_to_personal_playlist")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path = $"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = JsonConvert.DeserializeObject<List<(string Id, Resolution Resolution)>>(File.ReadAllText(path));
@ -1287,7 +1516,7 @@ namespace TYTD
else if (arguments["operation"] == "add_to_personal_playlist_res")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path = $"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = JsonConvert.DeserializeObject<List<(string Id, Resolution Resolution)>>(File.ReadAllText(path));
@ -1304,7 +1533,7 @@ namespace TYTD
else if (arguments["operation"] == "insert_to_personal_playlist")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path =$"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = JsonConvert.DeserializeObject<List<(string Id, Resolution Resolution)>>(File.ReadAllText(path));
@ -1322,7 +1551,7 @@ namespace TYTD
else if (arguments["operation"] == "remove_from_personal_playlist")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path =$"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = JsonConvert.DeserializeObject<List<(string Id, Resolution Resolution)>>(File.ReadAllText(path));
@ -1340,7 +1569,7 @@ namespace TYTD
else if (arguments["operation"] == "insert_to_personal_playlist_res")
{
string myName = arguments["name"];
string path = Downloader.DL.GetPath(true, "PersonalPlaylist", $"{myName}.json");
string path =$"PersonalPlaylist/{myName}.json";
string[] ids = System.Web.HttpUtility.UrlDecode(arguments["ids"]).Split(',');
var list = JsonConvert.DeserializeObject<List<(string Id, Resolution Resolution)>>(File.ReadAllText(path));
@ -1405,7 +1634,7 @@ namespace TYTD
else
{
string[] m = new string[] { "Converted", "NotConverted", "Audio" };
string path = Downloader.DL.GetPath(true, m[res], vid.Value + ".mp4");
string path = $"{m[res]}/{vid.Value}.mp4";
response.AddHeader("Content-Disposition", GetVideoContentDisposition(vid.Value).ToString());
response.AsFile(request, path);
hasOtherResponse = true;
@ -1421,7 +1650,7 @@ namespace TYTD
else
{
string path = Downloader.DL.GetPath(true, "NotConverted", vid.Value + ".mp4");
string path = $"NotConverted/{vid.Value}.mp4";
response.AddHeader("Content-Disposition", GetVideoContentDisposition(vid.Value).ToString());
response.AsFile(request, path);
hasOtherResponse = true;
@ -1501,17 +1730,27 @@ namespace TYTD
public static void RootPath(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
{
string p = System.Web.HttpUtility.UrlDecode(args["Path"]).Split(new char[] { '?' }, StringSplitOptions.RemoveEmptyEntries)[0];
string path = Path.Combine(webSitePath, p);
string path = "WebSite/{p}";
if (Directory.Exists(path))
{
string indexHtml = Path.Combine(path, "index.html");
if(File.Exists(indexHtml))
//bool j=false;
if(info.HasHomePage)
{
if(info.HomePage.OnHomePage(indexHtml,rq,rp,args))
{
return;
}
}
if (File.Exists(indexHtml))
{
path = indexHtml;
}
else
{
string dir = Path.Combine(webSitePath,"err", "dir.html");
string dir = "WebSite/err/dir.html";
StringBuilder b = new StringBuilder();
var f= Directory.GetLastWriteTime(Path.GetDirectoryName(path));
string parentModified = $"{f.ToShortDateString()} {f.ToShortTimeString()}";
@ -1542,6 +1781,14 @@ namespace TYTD
return;
}
}
if (info.HasHomePage)
{
if (info.HomePage.OnHomePage(p, rq, rp, args))
{
return;
}
}
@ -1551,8 +1798,9 @@ namespace TYTD
public static bool Route_Before(HttpListenerRequest request, HttpListenerResponse response)
{
Dictionary<string, string> args = new Dictionary<string, string>();
response.WithCORS();
return false;
return !Authorized(request, response,args);
}
public static void RedirectIt(this HttpListenerRequest req,HttpListenerResponse resp,string path="/")
{

View File

@ -1,18 +1,28 @@
using System;
using TYTD.Server.Models;
using TYTD.Server.Functions;
using System.Threading;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.Linq;
using System.Text;
using System.Threading;
using SimpleHttp;
using TYTD.Server.Functions;
using TYTD.Server.Models;
namespace TYTD
{
public abstract class Api : IDisposable
{
public virtual bool OnHomePage(string path,HttpListenerRequest req,HttpListenerResponse resp,Dictionary<string,string> args)
{
return false;
}
public virtual bool OnTemplatePage(string path,out string template_string)
{
template_string = "";
return false;
}
public bool CanProvideHomePage { get; protected set; }
public virtual void OnStart()
{
Console.WriteLine("Extension Loaded");
@ -113,14 +123,66 @@ namespace TYTD
public bool Cancel { get; set; }
}
public class ApiHomePageInfo
{
public event EventHandler Changed;
public ApiHomePageInfo()
{
HasHomePage = false;
HomePage = null;
}
public ApiHomePageInfo(Api api)
{
HasHomePage = api != null;
HomePage = api;
}
public void Change(Api api)
{
HasHomePage = api != null;
HomePage = api;
if(Changed != null)
{
Changed.Invoke(this, EventArgs.Empty);
}
}
public bool HasHomePage { get; private set; }
public Api HomePage { get; private set; }
}
public static class ApiLoader
{
static bool start_term=false;
public static bool StartTermination { get { return start_term; } set { start_term = value; if (start_term) { _cancel.Cancel(); } } }
public static bool Restart { get; set; }
public static void StopApp()
{
Restart = false;
StartTermination = true;
}
public static void RestartApp()
{
Restart = true;
StartTermination = true;
}
public static string RenderFileOrDefault(string file,string defaultData,Dictionary<string,string> arg)
{
return Templating.RenderString(ReadAllTextOrDefault(file, defaultData), arg);
}
public static string ReadAllTextOrDefault(string file,string defaultData)
{
if(_info.HasHomePage)
{
//starts with website so remove WebSite\
string path = file.Substring(7);
string data;
if(_info.HomePage.OnTemplatePage(path,out data))
{
return data;
}
}
if (File.Exists(file))
{
return File.ReadAllText(file);
@ -206,8 +268,17 @@ namespace TYTD
}
}
public static void Init()
public static IEnumerable<Api> EnumerateExtensions()
{
return apis;
}
static CancellationTokenSource _cancel;
private static ApiHomePageInfo _info;
public static CancellationToken Init(ApiHomePageInfo info)
{
_cancel = new CancellationTokenSource();
_info = info;
StringBuilder b = new StringBuilder();
string root = Path.Combine(Environment.CurrentDirectory,"config", "apidll");
string appconfroot = Path.Combine(Environment.CurrentDirectory,"config", "apistore");
@ -224,10 +295,20 @@ namespace TYTD
}
Dictionary<string, string> templating = new Dictionary<string, string>();
templating.Add("Items", b.ToString());
string combined= Path.Combine("WebSite", "extensions.html");
string template = "<!DOCTYPE html><head><title>Extensions</title></head><body><h1>Extensions</h1><table><thead><tr><th>Name</th><th>Urls</th></tr></thead><tbody>{Items}</tbody></table></body></html>";
template=ReadAllTextOrDefault(combined, template);
Page = Templating.RenderString(template, templating);
string combined= "WebSite/extensions.html";
info.Changed += (sender, e) => {
//it will change immediately
string template = "<!DOCTYPE html><head><title>Extensions</title></head><body><h1>Extensions</h1><table><thead><tr><th>Name</th><th>Urls</th></tr></thead><tbody>{Items}</tbody></table></body></html>";
template = ReadAllTextOrDefault(combined, template);
Page = Templating.RenderString(template, templating);
};
return _cancel.Token;
}
}
}

View File

@ -487,28 +487,7 @@ namespace TYTD.Server.Functions
}
return true;
}
private string gStorageLocation()
{
if (File.Exists("loc.txt"))
{
string loc = File.ReadAllText("loc.txt");
try
{
Directory.CreateDirectory(loc);
if (Directory.Exists(loc))
{
return loc;
}
} catch (Exception ex)
{
Console.WriteLine(ex.Message);
_ = ex;
}
}
return Environment.CurrentDirectory;
}
public string StorageLocation { get { return gStorageLocation(); } }
// public string StorageLocation { get { return gStorageLocation(); } }
private void _DownloadVideos(SavedVideoObject[] items)
{
@ -536,11 +515,11 @@ namespace TYTD.Server.Functions
public static Func<YoutubeClient,VideoId, Task<StreamManifest>> GetManifest;
private async Task DownloadHDVideo(SavedVideoObject v,CancellationToken token)
{
string mypath = GetPath(true, "Converted", v.Video.Id + "-vidonly.bkp");
string mypathaudio = GetPath(true, "Audio", v.Video.Id + "incomplete.mp4");
string mypathCompleteAudio = GetPath(true, "Audio", v.Video.Id + ".mp4");
string mypathComplete = GetPath(true, "Converted", v.Video.Id + ".mp4");
string mypathIncompleteConverting = GetPath(true, "Converted", "conv.mkv");
string mypath = Path.Combine("Converted", v.Video.Id + "-vidonly.bkp");
string mypathaudio = Path.Combine( "Audio", v.Video.Id + "incomplete.mp4");
string mypathCompleteAudio = Path.Combine( "Audio", v.Video.Id + ".mp4");
string mypathComplete = Path.Combine("Converted", v.Video.Id + ".mp4");
string mypathIncompleteConverting = Path.Combine( "Converted", "conv.mkv");
if (Continue(mypathComplete))
{
@ -596,6 +575,10 @@ namespace TYTD.Server.Functions
do
{
read = await srcStrm.ReadAsync(buffer, 0, buffer.Length,token);
if(ApiLoader.StartTermination)
{
return;
}
if (token.IsCancellationRequested)
{
cancelSrc.Item.Dispose();
@ -746,8 +729,8 @@ namespace TYTD.Server.Functions
}
private async Task DownloadSDVideo(SavedVideoObject v, CancellationToken token)
{
string mypath2 = GetPath(true, "NotConverted", v.Video.Id + "incomplete.mp4");
string mypath2Complete = GetPath(true, "NotConverted", v.Video.Id + ".mp4");
string mypath2 = Path.Combine("NotConverted", v.Video.Id + "incomplete.mp4");
string mypath2Complete = Path.Combine( "NotConverted", v.Video.Id + ".mp4");
if (Continue(mypath2Complete))
{
@ -794,6 +777,10 @@ namespace TYTD.Server.Functions
do
{
read = await srcStrm.ReadAsync(buffer, 0, buffer.Length, token);
if(ApiLoader.StartTermination)
{
return;
}
if (token.IsCancellationRequested)
{
cancelSrc.Item.Dispose();
@ -848,8 +835,8 @@ namespace TYTD.Server.Functions
}
private async Task DownloadAudio(SavedVideoObject v, CancellationToken token)
{
string mypath3 = GetPath(true, "Audio", v.Video.Id + "incomplete.mp4");
string mypath3Complete = GetPath(true, "Audio", v.Video.Id + ".mp4");
string mypath3 = Path.Combine( "Audio", v.Video.Id + "incomplete.mp4");
string mypath3Complete = Path.Combine("Audio", v.Video.Id + ".mp4");
if (Continue(mypath3Complete))
{
var s2 = await GetManifest(ytc, v.Video.Id);
@ -896,6 +883,10 @@ namespace TYTD.Server.Functions
do
{
read = await srcStrm.ReadAsync(buffer, 0, buffer.Length,token);
if (ApiLoader.StartTermination)
{
return;
}
if (token.IsCancellationRequested)
{
cancelSrc.Item.Dispose();
@ -978,7 +969,7 @@ namespace TYTD.Server.Functions
}
int fileI = 1;
P.Saved.Title = name;
name = GetPath(true, "Download", name);
name = Path.Combine("Download", name);
string filename = name;
while (FileExists(name, ref filename, ref fileI)) { }
long Len2 = long.MaxValue;
@ -1144,7 +1135,10 @@ namespace TYTD.Server.Functions
{
do
{
if (ApiLoader.StartTermination)
{
return;
}
await DownloadItem(cancelSrc.Item.Token);
}
@ -1154,7 +1148,7 @@ namespace TYTD.Server.Functions
{
try
{
string p = GetPath(true, "Thumbnails", w.ToString() + 'x' + h.ToString(), id + ".jpg");
string p = Path.Combine( "Thumbnails", w.ToString() + 'x' + h.ToString(), id + ".jpg");
if (!File.Exists(p))
{
ffmpeg.download_thumbnail(tnail, p);
@ -1171,7 +1165,7 @@ namespace TYTD.Server.Functions
{
try
{
string p = GetPath(true, "Thumbnails", w.ToString() + 'x' + h.ToString(), id + ".jpg");
string p = Path.Combine("Thumbnails", w.ToString() + 'x' + h.ToString(), id + ".jpg");
if (!File.Exists(p))
{
using (var f = File.Create(p))
@ -1385,7 +1379,7 @@ namespace TYTD.Server.Functions
{
DownloadUser(name, Resolution.NoConvert);
}
public string GetPath(bool createParent,params string[] _path)
/*public string GetPath(bool createParent,params string[] _path)
{
if (createParent)
@ -1413,7 +1407,7 @@ namespace TYTD.Server.Functions
array2[0] = StorageLocation;
Array.Copy(_path, 0, array2, 1,_path.Length);
return Path.Combine(array2);
}
}*/
public static Downloader DL = new Downloader();
}

View File

@ -23,7 +23,7 @@ namespace TYTD.Server.Functions
public static void on_video_done(string id,int res)
{
string path_to_video_id = Path.Combine(Downloader.DL.StorageLocation,"Info",$"{id}.json");
string path_to_video_id = Path.Combine("Info",$"{id}.json");
Directory.CreateDirectory("config");
string vdone= Path.Combine(Environment.CurrentDirectory, "config", "done");
@ -60,13 +60,13 @@ namespace TYTD.Server.Functions
}
}
}
//internal static async Task download_thumb2(string )
internal static void download_thumbnail(string tnail, string p2)
{
using (var p = new Process())
{
p.StartInfo.FileName = "/bin/bash";
p.StartInfo.Arguments = $"\"{Downloader.DL.GetPath(true, "thumbs")}\" \"{tnail}\" \"{p2}\"";
p.StartInfo.Arguments = $"\"config/thumbs\" \"{tnail}\" \"{p2}\"";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

View File

@ -86,18 +86,19 @@ namespace TYTD.Server.Models
case InfoType.FileDownload:
return new SavedVideoObject[] { new SavedVideoObject(Data) };
case InfoType.ClosedCaptions:
string path = Functions.Downloader.DL.GetPath(true, "ClosedCaptions", Data);
string path = $"ClosedCaptions/{Data}";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
var cc0 = await Functions.Downloader.DL.ytc.Videos.ClosedCaptions.GetManifestAsync(Data);
string trackInfo = Functions.Downloader.DL.GetPath(true, "ClosedCaptions", Data,"track_info.json");
string trackInfo = $"ClosedCaptions/{Data}/track_info.json";
File.WriteAllText(trackInfo, JsonConvert.SerializeObject(cc0.Tracks));
foreach (var track in cc0.Tracks)
{
string trackType = track.IsAutoGenerated ? "auto" : "manu";
string langFileName = $"{trackType}_{track.Language.Code}.srt";
string track2 = Functions.Downloader.DL.GetPath(true, "ClosedCaptions", Data,langFileName);
string track2 = $"ClosedCaptions/{Data}/{langFileName}";
await Functions.Downloader.DL.ytc.Videos.ClosedCaptions.DownloadAsync(track, track2);
await Task.Delay(10);
}
@ -106,7 +107,7 @@ namespace TYTD.Server.Models
break;
case InfoType.Video:
{
string infPath = Functions.Downloader.DL.GetPath(true, "Info", Data + ".json");
string infPath = $"Info/{Data}.json";
SavedVideoObject sv;
bool exist = File.Exists(infPath);
if (exist)
@ -140,12 +141,12 @@ namespace TYTD.Server.Models
{ List<SavedVideoObject> video2 = new List<SavedVideoObject>();
List<string> vo = new List<string>();
SavedPlaylist pl = await SavedPlaylist.FromPlaylistId(res, Functions.Downloader.DL.ytc, Data, (e,f) => { vo.Add(e); }, Functions.Downloader.DL._DownloadThumbnail);
string infpath = Functions.Downloader.DL.GetPath(true, "Playlist", Data + ".json");
SavedPlaylist pl = await SavedPlaylist.FromPlaylistId(res, Functions.Downloader.DL.ytc, Data, (e, f) => { vo.Add(e); }, Functions.Downloader.DL._DownloadThumbnail);
string infpath = $"Playlist/{Data}.json";
File.WriteAllText(infpath, JsonConvert.SerializeObject(pl));
foreach(var str in vo)
{
string infPath = Functions.Downloader.DL.GetPath(true, "Info", str + ".json");
string infPath = $"Info/{str}.json";
SavedVideoObject sv;
bool exist = File.Exists(infPath);
if (exist)
@ -195,14 +196,14 @@ namespace TYTD.Server.Models
{
var c = Functions.Downloader.DL.ytc.Channels.GetAsync(Data).GetAwaiter().GetResult();
SavedChannel c2 = SavedChannel.FromChannel(c, Functions.Downloader.DL._DownloadThumbnail);
string infpath = Functions.Downloader.DL.GetPath(true, "Channel", Data + ".json");
string infpath = $"Channel/{Data}.json";
File.WriteAllText(infpath, JsonConvert.SerializeObject(c2));
try
{
Functions.Downloader.DL.ytc.Channels.GetUploadsAsync(c.Id).ForEachAsync(async (v) =>
{
string infPath = Functions.Downloader.DL.GetPath(true, "Info", v.Id + ".json");
string infPath = $"Info/{v.Id}.json";
bool exist = File.Exists(infPath);
if (exist)
@ -258,14 +259,14 @@ namespace TYTD.Server.Models
{
var c = Functions.Downloader.DL.ytc.Channels.GetByUserAsync(Data).GetAwaiter().GetResult();
SavedChannel c2 = SavedChannel.FromChannel(c, Functions.Downloader.DL._DownloadThumbnail);
string infpath = Functions.Downloader.DL.GetPath(true, "Channel", Data + ".json");
string infpath = $"Channel/{Data}.json";
File.WriteAllText(infpath, JsonConvert.SerializeObject(c2));
try
{
Functions.Downloader.DL.ytc.Channels.GetUploadsAsync(c.Id).ForEachAsync(async (v) =>
{
string infPath = Functions.Downloader.DL.GetPath(true, "Info", v.Id + ".json");
string infPath = $"Info/{v.Id}.json";
bool exist = File.Exists(infPath);
if (exist)

Binary file not shown.

View File

@ -1 +1 @@
4109925d72e51f8e54758eee44e6f087ed4fc279
2b6dff7469b08f0770687859f1e70f9debc18804

View File

@ -392,3 +392,135 @@
/home/mike/tytd-server/TYTD.Api/obj/Release/TYTD.Api.csproj.CopyComplete
/home/mike/tytd-server/TYTD.Api/obj/Release/TYTD.Api.dll
/home/mike/tytd-server/TYTD.Api/bin/Release/Hyperlinq.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/TYTD.Api.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.InteropServices.RuntimeInformation.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Cryptography.Algorithms.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ValueTuple.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Microsoft.Win32.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/netstandard.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.AppContext.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Collections.Concurrent.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Collections.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Collections.NonGeneric.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Collections.Specialized.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ComponentModel.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ComponentModel.EventBasedAsync.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ComponentModel.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ComponentModel.TypeConverter.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Console.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Data.Common.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.Contracts.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.Debug.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.FileVersionInfo.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.Process.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.StackTrace.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.TextWriterTraceListener.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.Tools.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.TraceSource.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Diagnostics.Tracing.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Drawing.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Dynamic.Runtime.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Globalization.Calendars.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Globalization.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Globalization.Extensions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.Compression.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.Compression.ZipFile.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.FileSystem.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.FileSystem.DriveInfo.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.FileSystem.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.FileSystem.Watcher.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.IsolatedStorage.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.MemoryMappedFiles.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.Pipes.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.IO.UnmanagedMemoryStream.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Linq.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Linq.Expressions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Linq.Parallel.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Linq.Queryable.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Http.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.NameResolution.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.NetworkInformation.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Ping.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Requests.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Security.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.Sockets.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.WebHeaderCollection.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.WebSockets.Client.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Net.WebSockets.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.ObjectModel.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Reflection.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Reflection.Extensions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Reflection.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Resources.Reader.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Resources.ResourceManager.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Resources.Writer.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.CompilerServices.VisualC.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Extensions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Handles.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.InteropServices.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Numerics.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Serialization.Formatters.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Serialization.Json.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Serialization.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.Serialization.Xml.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Claims.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Cryptography.Csp.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Cryptography.Encoding.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Cryptography.Primitives.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Cryptography.X509Certificates.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.Principal.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Security.SecureString.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encoding.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encoding.Extensions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.RegularExpressions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Overlapped.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Tasks.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Tasks.Parallel.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Thread.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.ThreadPool.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Timer.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.ReaderWriter.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.XDocument.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.XmlDocument.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.XmlSerializer.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.XPath.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Xml.XPath.XDocument.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/AngleSharp.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/AsyncEnumerable.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/CookiesTxtParser.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Hyperlinq.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Microsoft.Bcl.AsyncInterfaces.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/MimeTypesMap.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Newtonsoft.Json.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/SimpleHTTP.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Buffers.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Memory.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Numerics.Vectors.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.CompilerServices.Unsafe.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encoding.CodePages.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encodings.Web.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Json.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Tasks.Extensions.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/YoutubeExplode.dll
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Newtonsoft.Json.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Buffers.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Numerics.Vectors.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Runtime.CompilerServices.Unsafe.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Memory.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encoding.CodePages.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/AngleSharp.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Encodings.Web.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Threading.Tasks.Extensions.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/Microsoft.Bcl.AsyncInterfaces.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/System.Text.Json.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/YoutubeExplode.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/AsyncEnumerable.xml
/home/ddlovato/git/tytd-server/TYTD.Api/bin/Release/SimpleHTTP.xml
/home/ddlovato/git/tytd-server/TYTD.Api/obj/Release/TYTD.Api.csproj.CoreCompileInputs.cache
/home/ddlovato/git/tytd-server/TYTD.Api/obj/Release/TYTD.Api.csproj.CopyComplete
/home/ddlovato/git/tytd-server/TYTD.Api/obj/Release/TYTD.Api.dll
/home/ddlovato/git/tytd-server/TYTD.Api/obj/Release/TYTD.Api.csprojAssemblyReference.cache

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
511bd001c80deda115b5110ee10fd30363c84ec1
7dbe06743fabd9c4c1020515efeec8905e352f88

View File

@ -707,3 +707,139 @@
/home/mike/tytd-server/bin/Release/System.Text.Encoding.CodePages.xml
/home/mike/tytd-server/bin/Release/PlaylistsNET.dll
/home/mike/tytd-server/bin/Release/Hyperlinq.dll
/home/ddlovato/git/tytd-server/bin/Release/youtube-downloader.exe
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.InteropServices.RuntimeInformation.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Cryptography.Algorithms.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ValueTuple.dll
/home/ddlovato/git/tytd-server/bin/Release/Microsoft.Win32.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/netstandard.dll
/home/ddlovato/git/tytd-server/bin/Release/System.AppContext.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Collections.Concurrent.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Collections.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Collections.NonGeneric.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Collections.Specialized.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ComponentModel.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ComponentModel.EventBasedAsync.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ComponentModel.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ComponentModel.TypeConverter.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Console.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Data.Common.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.Contracts.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.Debug.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.FileVersionInfo.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.Process.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.StackTrace.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.TextWriterTraceListener.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.Tools.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.TraceSource.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Diagnostics.Tracing.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Drawing.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Dynamic.Runtime.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Globalization.Calendars.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Globalization.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Globalization.Extensions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.Compression.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.Compression.ZipFile.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.FileSystem.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.FileSystem.DriveInfo.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.FileSystem.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.FileSystem.Watcher.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.IsolatedStorage.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.MemoryMappedFiles.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.Pipes.dll
/home/ddlovato/git/tytd-server/bin/Release/System.IO.UnmanagedMemoryStream.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Linq.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Linq.Expressions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Linq.Parallel.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Linq.Queryable.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Http.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.NameResolution.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.NetworkInformation.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Ping.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Requests.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Security.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.Sockets.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.WebHeaderCollection.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.WebSockets.Client.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Net.WebSockets.dll
/home/ddlovato/git/tytd-server/bin/Release/System.ObjectModel.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Reflection.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Reflection.Extensions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Reflection.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Resources.Reader.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Resources.ResourceManager.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Resources.Writer.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.CompilerServices.VisualC.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Extensions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Handles.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.InteropServices.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Numerics.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Serialization.Formatters.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Serialization.Json.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Serialization.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.Serialization.Xml.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Claims.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Cryptography.Csp.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Cryptography.Encoding.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Cryptography.Primitives.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Cryptography.X509Certificates.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.Principal.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Security.SecureString.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encoding.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encoding.Extensions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.RegularExpressions.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Overlapped.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Tasks.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Tasks.Parallel.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Thread.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.ThreadPool.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Timer.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.ReaderWriter.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.XDocument.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.XmlDocument.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.XmlSerializer.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.XPath.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Xml.XPath.XDocument.dll
/home/ddlovato/git/tytd-server/bin/Release/AngleSharp.dll
/home/ddlovato/git/tytd-server/bin/Release/AsyncEnumerable.dll
/home/ddlovato/git/tytd-server/bin/Release/CookiesTxtParser.dll
/home/ddlovato/git/tytd-server/bin/Release/Hyperlinq.dll
/home/ddlovato/git/tytd-server/bin/Release/Microsoft.Bcl.AsyncInterfaces.dll
/home/ddlovato/git/tytd-server/bin/Release/MimeTypesMap.dll
/home/ddlovato/git/tytd-server/bin/Release/Newtonsoft.Json.dll
/home/ddlovato/git/tytd-server/bin/Release/PlaylistsNET.dll
/home/ddlovato/git/tytd-server/bin/Release/SimpleBase.dll
/home/ddlovato/git/tytd-server/bin/Release/SimpleHTTP.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Buffers.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Memory.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Numerics.Vectors.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.CompilerServices.Unsafe.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encoding.CodePages.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encodings.Web.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Json.dll
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Tasks.Extensions.dll
/home/ddlovato/git/tytd-server/bin/Release/TYTD.Api.dll
/home/ddlovato/git/tytd-server/bin/Release/YoutubeExplode.dll
/home/ddlovato/git/tytd-server/bin/Release/Newtonsoft.Json.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Buffers.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Numerics.Vectors.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Runtime.CompilerServices.Unsafe.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Memory.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encoding.CodePages.xml
/home/ddlovato/git/tytd-server/bin/Release/AngleSharp.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Encodings.Web.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Threading.Tasks.Extensions.xml
/home/ddlovato/git/tytd-server/bin/Release/Microsoft.Bcl.AsyncInterfaces.xml
/home/ddlovato/git/tytd-server/bin/Release/System.Text.Json.xml
/home/ddlovato/git/tytd-server/bin/Release/YoutubeExplode.xml
/home/ddlovato/git/tytd-server/bin/Release/SimpleHTTP.xml
/home/ddlovato/git/tytd-server/bin/Release/AsyncEnumerable.xml
/home/ddlovato/git/tytd-server/bin/Release/SimpleBase.pdb
/home/ddlovato/git/tytd-server/obj/x86/Release/youtube-downloader.csprojAssemblyReference.cache
/home/ddlovato/git/tytd-server/obj/x86/Release/youtube-downloader.csproj.CoreCompileInputs.cache
/home/ddlovato/git/tytd-server/obj/x86/Release/youtube-downloader.csproj.CopyComplete
/home/ddlovato/git/tytd-server/obj/x86/Release/youtube-downloader.exe