-class Bliptv < Website
-
- VALID_BLIPTV_URL_REGEX = /^(http:\/\/)?([[:alnum:]\-]+\.)?blip\.tv\/file\/(\d+)(.*)?$/
- VALID_BLIPTV_REDIR_URL_REGEX = /^(http:\/\/)?([[:alnum:]\-]+\.)?blip\.tv\/play\/[[:alnum:]_]+$/
-
- def self.owns_url?(url)
- return (url =~ VALID_BLIPTV_URL_REGEX ||
- url =~ VALID_BLIPTV_REDIR_URL_REGEX)
- end
-
-
- def get_video_url()
- page_data = ''
-
- if (@url =~ VALID_BLIPTV_URL_REGEX)
- page_data = self.get_page_data(@url)
- else
- # It's a redirect. Figure out the RSS page URL from the redirect.
- redir_url = get_redirect_url
- rss_page_url = parse_rss_url(redir_url)
- rss_data = get_page_data(rss_page_url)
-
- # The "real" page URL is embedded in the RSS feed. Once we get the
- # real URL, we can proceed as if we were given that URL in the first
- # place.
- real_page_url = parse_page_url(rss_data)
- page_data = self.get_page_data(real_page_url)
+class BliptvMediaFormat
+ # This is just a convenience class for parsing two parameters out of
+ # an RSS feed: 'url' and 'blip:role'.
+ def initialize(line)
+ @url = nil
+ @role = nil
+
+ url_regex = /url=\"([^\"]+)\"/
+ role_regex = /blip:role=\"([^\"]+)\"/
+ url_matches = url_regex.match(line)
+ role_matches = role_regex.match(line)
+
+ if not url_matches.nil? and (url_matches.length) > 1
+ @url = url_matches[1]