Skip to content

Commit

Permalink
[feature/ISSUE-14] Add flag to display video URL without downloading …
Browse files Browse the repository at this point in the history
…it (#15)
  • Loading branch information
azihassan authored Jun 8, 2023
1 parent 3f920b3 commit bc5b32a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ import downloaders;

void main(string[] args)
{
int itag;
int itag = 18;
bool displayFormats;
bool parallel;
bool outputURL;

auto help = args.getopt(
std.getopt.config.passThrough,
std.getopt.config.caseSensitive,
"f", "Format to download (see -F for available formats)", &itag,
"F", "List available formats", &displayFormats,
"o|output-url", "Display extracted video URL without downloading it", &outputURL,
"p|parallel", "Download in 4 parallel connections", &parallel
);

Expand Down Expand Up @@ -56,7 +58,6 @@ void main(string[] args)
string destination = buildPath(getcwd(), filename);
destination.writeln();
string link = parser.getURL(itag);
link.writeln();

debug
{
Expand All @@ -70,6 +71,11 @@ void main(string[] args)
writeln("Failed to parse video URL");
continue;
}
if(outputURL)
{
link.writeln();
continue;
}

writeln("Downloading ", url, " to ", filename);

Expand Down

0 comments on commit bc5b32a

Please sign in to comment.