This commit is contained in:
Demetria Lovato 2021-06-23 20:41:34 -07:00
parent 8086045bc5
commit 6bb10ef57e
8 changed files with 50 additions and 29 deletions

Binary file not shown.

View File

@ -52,6 +52,10 @@ namespace youtube_downloader
} }
static void Main(string[] args) static void Main(string[] args)
{ {
Thread t = new Thread(new ThreadStart(() => {
Server.Functions.Downloader.DL.DownloadThread().GetAwaiter().GetResult();
}));
t.Start();
// we need to get our app name so that // we need to get our app name so that
// we can create unique names for our mutex and our pipe // we can create unique names for our mutex and our pipe
do do
@ -148,6 +152,8 @@ namespace youtube_downloader
errs => 1); errs => 1);
} }
static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description) static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description)
{
if (v != null)
{ {
//v.AuthorChannelId //v.AuthorChannelId
//v.AuthorTitle //v.AuthorTitle
@ -169,7 +175,7 @@ namespace youtube_downloader
b.AppendLine($"UploadDate: {v.UploadDate}"); b.AppendLine($"UploadDate: {v.UploadDate}");
b.AppendLine($"Views: {v.Views}, Likes: {v.Likes}, Dislikes: {v.Dislikes}"); b.AppendLine($"Views: {v.Views}, Likes: {v.Likes}, Dislikes: {v.Dislikes}");
b.AppendLine("Keywords:"); b.AppendLine("Keywords:");
foreach(var kw in v.Keywords) foreach (var kw in v.Keywords)
{ {
b.AppendLine($"\t{kw}"); b.AppendLine($"\t{kw}");
} }
@ -180,6 +186,8 @@ namespace youtube_downloader
b.AppendLine(v.Description); b.AppendLine(v.Description);
} }
} }
}
private static int RunInfo(Info opts) private static int RunInfo(Info opts)
{ {
//if ( != null) //if ( != null)
@ -195,6 +203,8 @@ namespace youtube_downloader
else else
{ {
var s=Server.Functions.Downloader.GetProgress(); var s=Server.Functions.Downloader.GetProgress();
if (s != null)
{
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.AppendLine("=======Progress======="); sb.AppendLine("=======Progress=======");
sb.AppendLine($"Progress: {s.Progress}%"); sb.AppendLine($"Progress: {s.Progress}%");
@ -203,7 +213,7 @@ namespace youtube_downloader
sb.AppendLine("=======Video Info======="); sb.AppendLine("=======Video Info=======");
WriteVideoInfo(sb, s.Saved, false); WriteVideoInfo(sb, s.Saved, false);
Console.WriteLine(sb.ToString()); Console.WriteLine(sb.ToString());
}
} }
break; break;
case "queue": case "queue":
@ -213,10 +223,12 @@ namespace youtube_downloader
Console.WriteLine(jsonData); Console.WriteLine(jsonData);
} }
else else
{
try
{ {
var s = Server.Functions.Downloader.GetQueueItems(); var s = Server.Functions.Downloader.GetQueueItems();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
foreach(var item in s) foreach (var item in s)
{ {
WriteVideoInfo(sb, item.Video, false); WriteVideoInfo(sb, item.Video, false);
sb.AppendLine(); sb.AppendLine();
@ -224,7 +236,10 @@ namespace youtube_downloader
Console.WriteLine(sb.ToString()); Console.WriteLine(sb.ToString());
} catch (Exception ex)
{
}
} }
break; break;
case "location": case "location":

View File

@ -19,6 +19,11 @@ namespace youtube_downloader.Server.Functions
{ {
public class Downloader public class Downloader
{ {
public Downloader()
{
// TessesYoutubeDownloader.Server.Functions.Downloader.DL.DownloadThread().GetAwaiter().GetResult();
}
public static YoutubeClient CreateYoutubeClient() public static YoutubeClient CreateYoutubeClient()
{ {

View File

@ -0,0 +1 @@
{"Title":"Demi Lovato - Cool for the Summer (Official Video)","UploadDate":"7/23/2015 12:00:00 AM -07:00","Keywords":["demi lovato","cool for the summer","demi lovato cool for the summer","summer","demi lovato summer","demi lovato songs","demi","summer demi lovato","cool for the summer demi lovato","cool summer"],"Id":"il9nqWw9W3Y","AuthorTitle":"DemiLovatoVEVO","AuthorChannelId":"UCnyB9MYKRkSFK3IIB32CoVw","Description":"'Dancing With The Devil... The Art Of Starting Over': https://demilovato.lnk.to/DWTDTAOSO\nShop: shop.demilovato.com \nWatch the Demi Lovato: Dancing With The Devil documentary: http://yt.be/DemiDWTD\n\nConnect with Demi: \nSubscribe https://www.youtube.com/channel/UCZkURf9tDolFOeuw_4RD7XQ\nInstagram http://instagram.com/ddlovato\nTwitter http://twitter.com/ddlovato\nFacebook http://facebook.com/demilovato\nOfficial site http://demilovato.com\nJoin their mailing list to stay up to date http://www.demilovato.com/#mailing-list\n\nhttp://vevo.ly/b4JQfI","Duration":228.0,"Views":377251090,"Likes":2624522,"Dislikes":108978}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.