git://git.camperquake.de
/
videosite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2ffeb5
)
videosite-dl: Add -i command line option to print information instead of downloading
author
Ralf Ertzinger
<ralf@skytale.net>
Sat, 3 Sep 2011 19:44:14 +0000
(21:44 +0200)
committer
Ralf Ertzinger
<ralf@skytale.net>
Sat, 3 Sep 2011 19:44:14 +0000
(21:44 +0200)
videosite-dl.pl
patch
|
blob
|
history
diff --git
a/videosite-dl.pl
b/videosite-dl.pl
index
8b1b161
..
7313bf5
100755
(executable)
--- a/
videosite-dl.pl
+++ b/
videosite-dl.pl
@@
-55,6
+55,9
@@
my $f;
my $m;
my @g;
my $bp;
my $m;
my @g;
my $bp;
+my $info = 0;
+
+GetOptions("i" => \$info);
# This is some dark magic to find out our real base directory,
# where we hope to find our plugins.
# This is some dark magic to find out our real base directory,
# where we hope to find our plugins.
@@
-75,8
+78,14
@@
foreach (@ARGV) {
foreach $y (@g) {
($m, undef) = $y->get($_);
if (defined($m)) {
foreach $y (@g) {
($m, undef) = $y->get($_);
if (defined($m)) {
- print("Downloading $m->{'TITLE'}\n");
- $f->get($m);
+ if ($info) {
+ foreach (keys(%{$m})) {
+ printf("%s: %s\n", $_, defined($m->{$_})?$m->{$_}:'(undef)');
+ }
+ } else {
+ print("Downloading $m->{'TITLE'}\n");
+ $f->get($m);
+ }
}
}
}
}
}
}