return url =~ VALID_HOWCAST_URL_REGEX
end
-
- def get_video_url(url)
+
+ def parse_video_id()
# This regex just pulls out the video id
id_regex = /\/(\d+)-/
- matches = id_regex.match(url)
+ matches = id_regex.match(@url)
if matches.nil?
raise StandardError.new('The URL is a valid Howcast URL, but does not match on the digit portion of the regex. Since the digit portion is a subset of the "valid" regex, this should never occur.')
end
+
+ return matches[1]
+ end
- video_id = matches[1]
+
+ def get_video_url()
+ video_id = parse_video_id()
+
return "http://media.howcast.com/system/videos/#{video_id}/#{video_id}.flv"
end
-
+
end