This commit is contained in:
Demetria Lovato 2021-06-24 00:31:55 -07:00
parent 2f2c26e632
commit bf72e8f89e
6 changed files with 21 additions and 2 deletions

Binary file not shown.

View File

@ -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<DownloadVideo, DownloadPlaylist, DownloadChannel, DownloadUser, MoveQueue, Info, ExitApp>(args)
CommandLine.Parser.Default.ParseArguments<DownloadVideo, DownloadPlaylist, DownloadChannel, DownloadUser, MoveQueue, Info, DownloadAll, ExitApp>(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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.