- Check for existance of hash key before using
[videosite.git] / videosite / DailyMotionGrabber.pm
index 24afc7d..5e4f10e 100644 (file)
@@ -72,9 +72,11 @@ sub _parse {
 
     # Look for the download URL
     foreach $e (@text) {
-        if ($e->[0] =~ m|\.addVariable\("url", "([^\"]+)"|) {
+        if ($e->[0] =~ m|\.addVariable\("video", "([^\"]+)"|) {
             $metadata->{'DLURL'} = $1;
             $metadata->{'DLURL'} =~ s/%(..)/chr(hex($1))/ge;
+            $metadata->{'DLURL'} =~ s/\@\@spark.*//g;
+            $metadata->{'DLURL'} = 'http://www.dailymotion.com' . $metadata->{'DLURL'};
 
         }
     }