class Youtube < Website
- VALID_YOUTUBE_URL_REGEX = /^(http:\/\/)?(www\.)?youtube\.com\/((watch\?v=)|(v\/))[[:alnum:]]+(\&.*)?$/
+ VALID_YOUTUBE_URL_REGEX = /^(http:\/\/)?(www\.)?youtube\.com\/((watch\?v=)|(v\/))[[:alnum:]]+(\&.*)?\#?$/
def self.owns_url?(url)
return url =~ VALID_YOUTUBE_URL_REGEX
def parse_t_parameter(page_data)
t_parameter = nil
- t_parameter_regex = /\"t\"\:[[:space:]]\"([[:alnum:]]+)\"/
+ t_parameter_regex = /\"t\"\:[[:space:]]\"([^\"]+?)\"/
matches = t_parameter_regex.match(page_data)
t_parameter = matches[1] if not (matches.nil? || matches.length < 2)