From 9b4f91b4d23f20b26d3f00d299f7d37a19f9d427 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sun, 4 Sep 2011 00:02:03 +0200 Subject: [PATCH] videosite-dl: Add a connector callback which uses the http_proxy and https_proxy environment variables --- videosite-dl.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/videosite-dl.pl b/videosite-dl.pl index 15e1bca..257da2d 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; @@ -78,6 +93,7 @@ foreach (@g, $f) { if ($debug) { $_->setdebug(1); + $_->setconn(\&connectors); } } -- 1.8.3.1