end
def parse_video_url(page_data)
- full_video_url_regex = /(http:\/\/.+?\.(flv|mp4))/i
+ full_video_url_regex = /(http:\/\/[^\"\']+?\.(flv|mp4))/i
matches = full_video_url_regex.match(page_data)
- if not (matches.nil? || matches.length < 2)
+ if not matches.nil? || matches.length < 2
return matches[1]
end
partial_video_url_regex = /([^\=\"\']+\.(flv|mp4))/i
matches = partial_video_url_regex.match(page_data)
- if not (matches.nil? || matches.length < 2)
+ if not matches.nil? || matches.length < 2
return base_url + matches[1]
end