]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - src/websites/veoh.rb
Added URL/parse support for two new Veoh formats.
[dead/whatever-dl.git] / src / websites / veoh.rb
index c961d688e213b9500db2ab20726e966b2d896894..bbe448bc766be4431be6916a14a83b65dac33c53 100644 (file)
 
 require 'src/website'
 
-# Needed to download the page, which is in turn
-# needed because it contains the video (redirect) URL.
-require 'net/http'
-require 'uri'
-
 
 class Veoh < Website
 
-  VALID_VEOH_URL_REGEX = /^(http:\/\/)?(www\.)?veoh\.com\/videos\/([[:alnum:]]+)$/
+  VALID_VEOH_URL_REGEX = /^(http:\/\/)?(www\.)?veoh\.com\/((videos\/([[:alnum:]]+))|(group\/.*)|(browse\/.*\/[[:alnum:]]+))$/
   
   def self.owns_url?(url)
     return url =~ VALID_VEOH_URL_REGEX
@@ -58,7 +53,7 @@ class Veoh < Website
   protected;
 
   def parse_video_id()
-    video_id_regex = /[[:alnum:]]+$/
+    video_id_regex = /v[[:alnum:]]+$/
     matches = video_id_regex.match(@url)
     video_id = matches[0] if not matches.nil?
     
@@ -77,14 +72,4 @@ class Veoh < Website
   end
   
   
-  def get_page_data(url)
-    uri = URI.parse(url)
-
-    response = Net::HTTP.start(uri.host, uri.port) do |http|
-      http.get(uri.path)
-    end
-    
-    return response.body
-  end
-  
 end