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)
{
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 can create unique names for our mutex and our pipe
do
@ -149,37 +153,41 @@ namespace youtube_downloader
}
static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description)
{
//v.AuthorChannelId
//v.AuthorTitle
//v.Dislikes
//v.Duration
//v.Id
//v.Keywords
//v.Likes
//v.Title
//v.UploadDate
//v.Views
//v.Description
b.AppendLine($"Title: {v.Title}");
b.AppendLine($"AuthorName: {v.AuthorTitle}");
b.AppendLine($"AuthorID: {v.AuthorChannelId}");
b.AppendLine($"Duration: {TimeSpan.FromSeconds(v.Duration).ToString()}");
b.AppendLine($"Id: {v.Id}");
b.AppendLine($"UploadDate: {v.UploadDate}");
b.AppendLine($"Views: {v.Views}, Likes: {v.Likes}, Dislikes: {v.Dislikes}");
b.AppendLine("Keywords:");
foreach(var kw in v.Keywords)
if (v != null)
{
b.AppendLine($"\t{kw}");
}
//v.AuthorChannelId
//v.AuthorTitle
//v.Dislikes
//v.Duration
//v.Id
//v.Keywords
//v.Likes
//v.Title
//v.UploadDate
//v.Views
//v.Description
if (description)
{
b.AppendLine("Description:");
b.AppendLine(v.Description);
b.AppendLine($"Title: {v.Title}");
b.AppendLine($"AuthorName: {v.AuthorTitle}");
b.AppendLine($"AuthorID: {v.AuthorChannelId}");
b.AppendLine($"Duration: {TimeSpan.FromSeconds(v.Duration).ToString()}");
b.AppendLine($"Id: {v.Id}");
b.AppendLine($"UploadDate: {v.UploadDate}");
b.AppendLine($"Views: {v.Views}, Likes: {v.Likes}, Dislikes: {v.Dislikes}");
b.AppendLine("Keywords:");
foreach (var kw in v.Keywords)
{
b.AppendLine($"\t{kw}");
}
if (description)
{
b.AppendLine("Description:");
b.AppendLine(v.Description);
}
}
}
private static int RunInfo(Info opts)
{
//if ( != null)
@ -195,6 +203,8 @@ namespace youtube_downloader
else
{
var s=Server.Functions.Downloader.GetProgress();
if (s != null)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("=======Progress=======");
sb.AppendLine($"Progress: {s.Progress}%");
@ -203,7 +213,7 @@ namespace youtube_downloader
sb.AppendLine("=======Video Info=======");
WriteVideoInfo(sb, s.Saved, false);
Console.WriteLine(sb.ToString());
}
}
break;
case "queue":
@ -213,10 +223,12 @@ namespace youtube_downloader
Console.WriteLine(jsonData);
}
else
{
try
{
var s = Server.Functions.Downloader.GetQueueItems();
StringBuilder sb = new StringBuilder();
foreach(var item in s)
foreach (var item in s)
{
WriteVideoInfo(sb, item.Video, false);
sb.AppendLine();
@ -224,7 +236,10 @@ namespace youtube_downloader
Console.WriteLine(sb.ToString());
} catch (Exception ex)
{
}
}
break;
case "location":

View File

@ -19,6 +19,11 @@ namespace youtube_downloader.Server.Functions
{
public class Downloader
{
public Downloader()
{
// TessesYoutubeDownloader.Server.Functions.Downloader.DL.DownloadThread().GetAwaiter().GetResult();
}
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.