videosite-dl: Add a connector callback which uses the http_proxy and https_proxy...
authorRalf Ertzinger <ralf@skytale.net>
Sat, 3 Sep 2011 22:02:03 +0000 (00:02 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Sat, 3 Sep 2011 22:02:03 +0000 (00:02 +0200)
videosite-dl.pl

index 15e1bca..257da2d 100755 (executable)
@@ -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);
     }
 }