/* TYTD Lite: A YouTube Downloader website that archives videos when people download videos using it. Copyright (C) 2024 Mike Nolan This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web; using Humanizer; using LiteDB; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Scriban; using Tesses.WebServer; using YoutubeExplode; using YoutubeExplode.Exceptions; using YoutubeExplode.Videos; using YoutubeExplode.Videos.Streams; namespace TYTDLite { public class TYTDLiteServer { public ILiteDatabase Database {get;} public ILiteCollection Videos => Database.GetCollection("Videos"); List Jobs {get;set;}=new List(); public string ServerPath {get;} public RouteServer Server {get;} public YoutubeClient YoutubeClient {get;} public HttpClient HttpClient {get;} Lazy