using System.Web;
using Tesses.YouTubeDownloader;
using YoutubeExplode;
using YoutubeExplode.Videos;
string[] mos = new string[]{"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
string[] Mos = new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
if(args.Length < 3)
{
Console.WriteLine("USAGE: removed_php_gen removed.txt tytddir phpdir");
Console.WriteLine("WARNING: wont automaticly edit index.php");
}
else
{
TYTDPathDirectory tYTDPathDirectory=new TYTDPathDirectory(args[1]);
DateTime dt=DateTime.Now;
Directory.CreateDirectory(args[2]);
/*
Removed as of Oct 31, 2023
Removed as of Oct 31, 2023
*/
string filename = Path.Combine(args[2],$"removed-{mos[dt.Month-1]}{dt.Day.ToString("D2")}{dt.Year.ToString("D4")}.php");
using(var sw = File.CreateText(filename))
{
await sw.WriteLineAsync("");
await sw.WriteLineAsync($"Removed as of {Mos[dt.Month-1]} {dt.Day}, {dt.Year}");
await sw.WriteLineAsync("");
await sw.WriteLineAsync($"Removed as of {Mos[dt.Month-1]} {dt.Day}, {dt.Year}
");
await sw.WriteLineAsync("");
await foreach(var id in File.ReadLinesAsync(args[0]))
{
VideoId? v = VideoId.TryParse(id);
if(v.HasValue)
{
if(await tYTDPathDirectory.VideoInfoExistsAsync(v.Value))
{
string title = (await tYTDPathDirectory.GetVideoInfoAsync(v.Value) ?? new SavedVideo{Title=""}).Title;
await sw.WriteLineAsync($"- {HttpUtility.HtmlEncode(title)}
");
Console.WriteLine($"Appended: {title} with Id: {v.Value}");
}
}
}
await sw.WriteLineAsync("
");
await sw.WriteLineAsync("");
}
Console.WriteLine($"Writen to file: {filename}");
Console.WriteLine();
Console.WriteLine("Place this within the tag under Removed Lists
right before the
");
Console.WriteLine("");
Console.WriteLine($"- {Mos[dt.Month-1]} {dt.Day}, {dt.Year}
");
Console.WriteLine("");
}