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
assert_equal('v19568793XZq2SRzZ', video_id)
end
+
+ def test_parse_fifth_video_id
+ v = Veoh.new('http://www.veoh.com/collection/Keith-Anderson-Music-Videos/watch/v13890200h98YShYN')
+ video_id = v.send('parse_video_id')
+ assert_equal('v13890200h98YShYN', video_id)
+ end
+
def test_parse_redirect_url
v = Veoh.new(nil)
assert(Veoh.owns_url?('http://www.veoh.com/videos/v15795090Z6mZAbSq'))
assert(Veoh.owns_url?('http://www.veoh.com/group/suggested-anime-w1st-episodes/?source=homepageList#watch%3Dv19961527w773Qq5G'))
assert(Veoh.owns_url?('http://www.veoh.com/browse/videos/category/anime/watch/v19568793XZq2SRzZ'))
+ assert(Veoh.owns_url?('http://www.veoh.com/collection/Keith-Anderson-Music-Videos/watch/v13890200h98YShYN'))
end
end