def google_metadata_lookup(url): """Retrieve metadata information regarding a google video url.""" data = VideoMetadata() rss = remote_content(_rss_url(url)) _populate_google_data(rss, data) return data
def viddler_metadata_lookup(url): """Retrieve metadata information regarding a viddler video url.""" data = VideoMetadata() oembed = remote_content(_oembed_url(url)) _populate_viddler_data(oembed, data) return data
def youtube_generator(url, width): """ A quick check for the right url >>> print youtube_generator('http://www.youtube.com/watch?v=1111', ... width=400) <object width="400" height="330"><param name="movie" value="http://www.youtube.com/v/1111"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/1111" type="application/x-shockwave-flash" wmode="transparent" width="400" height="330"></embed></object> """ host, path, query, fragment = break_url(url) oembed = remote_content(_oembed_url(url)) oembed = json.loads(oembed) return oembed['html']
def viddler_generator(url, width): """ A quick check for the right url >>> html = viddler_generator('http://viddler.com/explorer/user/4', ... width=400) >>> 'showplayer.swf?file=http%3A//blip.tv/file/get/random.flv' in html True """ host, path, query, fragment = break_url(url) oembed = remote_content(_oembed_url(url)) oembed = eval(oembed) return oembed["html"].replace("\\", "")
def youtube_metadata_lookup(url): """Retrieve metadata information regarding a youtube video url.""" data = VideoMetadata() oembed = remote_content(_oembed_url(url)) _populate_youtube_data(oembed, data)