This commit is contained in:
parent
8086045bc5
commit
6bb10ef57e
Binary file not shown.
73
Program.cs
73
Program.cs
|
@ -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
|
||||||
|
@ -149,37 +153,41 @@ namespace youtube_downloader
|
||||||
}
|
}
|
||||||
static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description)
|
static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description)
|
||||||
{
|
{
|
||||||
//v.AuthorChannelId
|
if (v != null)
|
||||||
//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)
|
|
||||||
{
|
{
|
||||||
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($"Title: {v.Title}");
|
||||||
{
|
b.AppendLine($"AuthorName: {v.AuthorTitle}");
|
||||||
b.AppendLine("Description:");
|
b.AppendLine($"AuthorID: {v.AuthorChannelId}");
|
||||||
b.AppendLine(v.Description);
|
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)
|
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":
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -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.
Loading…
Reference in New Issue