- # Parse out the "t" parameter from the video's page. I'm not sure
- # what "t" stands for, but it's required for the final video URL to
- # work. It can be stored in either JSON or URL parameters.
- def parse_t_parameter(page_data)
- t_parameter = nil
-
- t_parameter_regexes = [ /\"t\"\:[[:space:]]\"([^\"]+?)\"/,
- /&t=([^&\"\\]+)/ ]
- matches = t_parameter_regexes.map { |tpr| tpr.match(page_data) }
-
- if matches.nitems == 0
- raise StandardError.new("Could not parse the 't' parameter.")
- end