add connector support to AsyncFileGetter
authorChristian Garbs <mitch@cgarbs.de>
Wed, 7 Sep 2011 16:23:09 +0000 (18:23 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Tue, 18 Oct 2011 18:49:18 +0000 (20:49 +0200)
videosite/AsyncFileGetter.pm
videosite/AsyncWgetFileGetter.pm

index 7a67b43..70fa613 100644 (file)
@@ -54,6 +54,14 @@ sub get {
 
     my (undef, $tmpfile) = tempfile('videosite.tmp.XXXXXXXXXXXX', DIR => $dirname);
 
+    if (exists($video->{'CONNECTOR'})) {
+       my $schemas = $video->{'CONNECTOR'}->{'schemas'};
+       foreach (keys(%{$schemas})) {
+           $self->debug("Setting %s_proxy to %s", $_, $schemas->{$_});
+           $ENV{ $_.'_proxy'} = $schemas->{$_};
+       }
+    }
+
     $cookie = "-H \"Cookie: $video->{'COOKIE'}\"" if (defined $video->{'COOKIE'});
     my $cmdline = "( GET $cookie \"$video->{'DLURL'}\" > \"$tmpfile\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" || rm -f \"$tmpfile\" ) &";
     $self->debug(encode_base64($cmdline));
index ef54e92..8f04656 100644 (file)
@@ -53,6 +53,14 @@ sub get {
 
     my (undef, $tmpfile) = tempfile('videosite.tmp.XXXXXXXXXXXX', DIR => $dirname);
 
+    if (exists($video->{'CONNECTOR'})) {
+       my $schemas = $video->{'CONNECTOR'}->{'schemas'};
+       foreach (keys(%{$schemas})) {
+           $self->debug("Setting %s_proxy to %s", $_, $schemas->{$_});
+           $ENV{ $_.'_proxy'} = $schemas->{$_};
+       }
+    }
+
     $cookie = "--header=\"Cookie: $video->{'COOKIE'}\"" if (defined $video->{'COOKIE'});
     my $cmdline = "( wget -q -O\"$tmpfile\" $cookie \"$video->{'DLURL'}\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" && touch \"$dlfile\" || rm -f \"$tmpfile\" ) &";
     $self->debug("Going to execute: %s", $cmdline);