diff --git a/.vs/youtube-downloader/v16/.suo b/.vs/youtube-downloader/v16/.suo index 648ab3f..30514f2 100644 Binary files a/.vs/youtube-downloader/v16/.suo and b/.vs/youtube-downloader/v16/.suo differ diff --git a/Program.cs b/Program.cs index 0723f82..546c420 100644 --- a/Program.cs +++ b/Program.cs @@ -104,6 +104,13 @@ namespace youtube_downloader [Option('f', "format", Default = Resolution.NoConvert, HelpText = "possible values are (NoConvert,Convert,Audio)")] public Resolution Format { get; set; } } + [Verb("redownload",HelpText = "Redownload all incomplete videos")] + public class DownloadAll + { + [Option('f', "format", Default = Resolution.NoConvert, HelpText = "possible values are (NoConvert,Convert,Audio)")] + + public Resolution Resolution { get; set; } + } [Verb("user", HelpText = "Download entire Channel (using username)")] public class DownloadUser @@ -139,7 +146,7 @@ namespace youtube_downloader static void _ProcessCommandLine(string[] args) { - CommandLine.Parser.Default.ParseArguments(args) + CommandLine.Parser.Default.ParseArguments(args) .MapResult( (DownloadVideo opts) => RunDownloadVideo(opts), (DownloadPlaylist opts) => RunDownloadPlaylist(opts), @@ -147,10 +154,22 @@ namespace youtube_downloader (DownloadUser opts) => RunDownloadUser(opts), (MoveQueue opts) => RunMoveQueue(opts), (Info opts) => RunInfo(opts), + (DownloadAll opts) => RunDownloadAll(opts), (ExitApp opts) => RunExitApp(opts), - errs => 1); + errs => 1); ; } + + private static int RunDownloadAll(DownloadAll opts) + { + foreach(var item in Directory.GetFiles(Server.Functions.Downloader.DL.GetPath(true, "Info"),"*.json")) + { + string id = System.IO.Path.GetFileNameWithoutExtension(item); + Server.Functions.Downloader.DownloadVideo(id, opts.Resolution); + } + return 1; + } + static void WriteVideoInfo(StringBuilder b,SavedVideo v,bool description) { if (v != null) diff --git a/bin/Debug/youtube-downloader.exe b/bin/Debug/youtube-downloader.exe index b7f8008..0d3cb26 100644 Binary files a/bin/Debug/youtube-downloader.exe and b/bin/Debug/youtube-downloader.exe differ diff --git a/bin/Debug/youtube-downloader.pdb b/bin/Debug/youtube-downloader.pdb index 82e9884..b97007c 100644 Binary files a/bin/Debug/youtube-downloader.pdb and b/bin/Debug/youtube-downloader.pdb differ diff --git a/obj/Debug/youtube-downloader.exe b/obj/Debug/youtube-downloader.exe index b7f8008..0d3cb26 100644 Binary files a/obj/Debug/youtube-downloader.exe and b/obj/Debug/youtube-downloader.exe differ diff --git a/obj/Debug/youtube-downloader.pdb b/obj/Debug/youtube-downloader.pdb index 82e9884..b97007c 100644 Binary files a/obj/Debug/youtube-downloader.pdb and b/obj/Debug/youtube-downloader.pdb differ