]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - src/websites/motherless.rb
Fix all Ruby 1.9 errors and warnings.
[dead/whatever-dl.git] / src / websites / motherless.rb
index a5b59b2d709b2aa48d88a4573167caf73ec505df..ab74fc0b07a883e065cf271e66a20cbef07faa15 100644 (file)
@@ -26,22 +26,26 @@ class Motherless < Website
     return url =~ VALID_MOTHERLESS_URL_REGEX
   end
 
+
   def get_video_url()
-    page_data = self.get_page_data(@url)    
+    page_data = self.get_page_data(@url)
     filepath = parse_video_url(page_data)
-    
-    return filepath
+
+    # Some videos 403 without this parameter.
+    get_params = "?start=0"
+    video_url = filepath + get_params
+
+    return video_url
   end
 
-  
+
   protected;
 
-  
+
   def parse_video_url(page_data)
     # If neither of the source formats are present, just grab the
     # video URL from the Flash variable and be done with it.
-    video_url_regex = /file=(.*?\.flv)&/i
+    video_url_regex = /\'file\', \'(http.*?\.flv)\'/i
     matches = video_url_regex.match(page_data)
 
     if matches.nil?