GrabberBase; make use of new connector infrastructure
authorRalf Ertzinger <ralf@skytale.net>
Sat, 3 Sep 2011 22:01:10 +0000 (00:01 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Sat, 3 Sep 2011 22:01:10 +0000 (00:01 +0200)
videosite/GrabberBase.pm

index b0bf480..8ff32b4 100644 (file)
@@ -23,6 +23,7 @@ sub get($$) {
     my $self = shift;
     my $url = shift;
     my $pattern;
+    my $res;
 
     return undef unless $self->_getval('enabled');
 
@@ -30,7 +31,16 @@ sub get($$) {
         $self->debug("Matching %s against %s", $pattern, $url);
         if ($url =~ m|$pattern|) {
             $self->debug("Match");
-            return wantarray?($self->_parse($url, $pattern), $pattern):$self->_parse($url, $pattern);
+            foreach ($self->connectors()) {
+                $self->debug("Using connector %s", $_->{-name});
+                $self->selectconn($_);
+                $res = $self->_parse($url, $pattern);
+                if (defined($res)) {
+                    $res->{'CONNECTOR'} = $_;
+                    last;
+                }
+            }
+            return wantarray?($res, $pattern):$res;
         }
     }