X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite-dl.pl;h=1b0079ca0b478e3aa2765f49c36bb553a3d16279;hb=1cfec45c0c1cac8fdebca4313c3bcfb3a9f1ab07;hp=7313bf5ea158bb7932c8224ab2b375f00e39e366;hpb=7719c5d829dc238d2e71b15247541f5d9287f948;p=videosite.git diff --git a/videosite-dl.pl b/videosite-dl.pl index 7313bf5..1b0079c 100755 --- a/videosite-dl.pl +++ b/videosite-dl.pl @@ -48,6 +48,21 @@ sub ploader { return @g; } +sub connectors { + my $c = {name => 'environment', schemas => {}}; + + if (exists($ENV{'http_proxy'})) { + $c->{schemas}->{'http'} = $ENV{'http_proxy'} + } + + if (exists($ENV{'https_proxy'})) { + $c->{schemas}->{'https'} = $ENV{'https_proxy'} + } + + return ( $c ); +} + + my $hq = 0; my $ext = '.flv'; my $y; @@ -56,8 +71,9 @@ my $m; my @g; my $bp; my $info = 0; +my $debug = 0; -GetOptions("i" => \$info); +GetOptions("i" => \$info, "d" => \$debug); # This is some dark magic to find out our real base directory, # where we hope to find our plugins. @@ -72,6 +88,15 @@ unless(@g and defined($f)) { exit 1; } +foreach (@g, $f) { + $_->setio(sub { printf(@_); print("\n"); } ); + $_->setconn(\&connectors); + + if ($debug) { + $_->setdebug(1); + } +} + $f->setval('FILEPATTERN', './%3$s' . $ext); foreach (@ARGV) {