Change videosite-dl.pl to work with changed module naming
authorRalf Ertzinger <sun@fred.camperquake.de>
Sun, 16 Aug 2009 10:44:53 +0000 (12:44 +0200)
committerRalf Ertzinger <sun@fred.camperquake.de>
Sun, 16 Aug 2009 10:44:53 +0000 (12:44 +0200)
videosite-dl.pl

index 642b162..8b1b161 100755 (executable)
@@ -24,13 +24,13 @@ sub ploader {
 
     foreach $p (@list) {
         $p =~ s/\.pm$//;
-        eval qq{ require $p; };
+        eval qq{ require videosite::$p; };
         if ($@) {
             print("Failed to load plugin: $@");
             next;
         }
 
-        $g = eval $p.q{->new();};
+        $g = eval qq{ videosite::$p->new();};
         if ($@) {
             print("Failed to instanciate: $@");
             delete($INC{$p});
@@ -59,6 +59,7 @@ my $bp;
 # This is some dark magic to find out our real base directory,
 # where we hope to find our plugins.
 $bp = File::Spec->catdir(dirname(realpath($0)), 'videosite');
+unshift(@INC, dirname(realpath($0)));
 
 @g = ploader($bp, '.*Grabber\.pm$', 'grabber');
 ($f) = ploader($bp, '^FileGetter\.pm$', 'getter');