- video_id = second_form_matches[1] if not (second_form_matches.nil? ||
- second_form_matches.length < 2)
-
- return video_id
+ return second_form_matches[1] if not (second_form_matches.nil? ||
+ second_form_matches.length < 2)
+
+ # ...and the third.
+ third_form_video_id_regex = /\/([[:alnum:]]+)$/i
+ third_form_matches = third_form_video_id_regex.match(@url)
+ return third_form_matches[1] if not (third_form_matches.nil? ||
+ third_form_matches.length < 2)
+
+ # If we made it here, we couldn't figure out the video id. Yes,
+ # this is fatal, since we don't know where the video file is
+ # located.
+ raise StandardError.new("Could not parse the video id.")