]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - src/websites/veoh.rb
Fix all Ruby 1.9 errors and warnings.
[dead/whatever-dl.git] / src / websites / veoh.rb
index bbe448bc766be4431be6916a14a83b65dac33c53..951d87dabc9975dc959bd2d327f25acbd8bcd0bc 100644 (file)
@@ -21,7 +21,7 @@ require 'src/website'
 
 class Veoh < Website
 
-  VALID_VEOH_URL_REGEX = /^(http:\/\/)?(www\.)?veoh\.com\/((videos\/([[:alnum:]]+))|(group\/.*)|(browse\/.*\/[[:alnum:]]+))$/
+  VALID_VEOH_URL_REGEX = /^(http:\/\/)?(www\.)?veoh\.com\/.*?(v[[:alnum:]]+)$/
   
   def self.owns_url?(url)
     return url =~ VALID_VEOH_URL_REGEX
@@ -66,7 +66,7 @@ class Veoh < Website
   def parse_redirect_url(page_data)
     redirect_url_regex = /fullPreviewHashPath=\"(.*?)\"/
     matches = redirect_url_regex.match(page_data)
-    redirect_url = matches[1] if not (matches.nil? || matches.length < 1)
+    redirect_url = matches[1] if not matches.nil? || matches.length < 2
     
     return redirect_url
   end