A feature-rich command-line audio/video downloader
UstreamIE: get thumbnail and uploader name
Jaime Marquínez Ferrándiz340fa21198b2
diff --git a/test/tests.json b/test/tests.jsonindex f0e5cd8bf9..0a9052f9dd 100644--- a/test/tests.json+++ b/test/tests.json@@ -152,7 +152,8 @@"file": "20274954.flv","md5": "088f151799e8f572f84eb62f17d73e5c","info_dict": {- "title": "Young Americans for Liberty February 7, 2012 2:28 AM"+ "title": "Young Americans for Liberty February 7, 2012 2:28 AM",+ "uploader": "Young Americans for Liberty"}},{diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.pyindex 6d6203a1cd..112d97a869 100755--- a/youtube_dl/InfoExtractors.py+++ b/youtube_dl/InfoExtractors.py@@ -3301,18 +3301,26 @@ class UstreamIE(InfoExtractor):video_id = m.group('videoID')video_url = u'http://tcdn.ustream.tv/video/%s' % video_idwebpage = self._download_webpage(url, video_id)- m = re.search(r'data-title="(?P<title>.+)"',webpage)- title = m.group('title')- m = re.search(r'<a class="state" data-content-type="channel" data-content-id="(?P<uploader>\d+)"',webpage)- uploader = m.group('uploader')+ self.report_extraction(video_id)+ try:+ m = re.search(r'data-title="(?P<title>.+)"',webpage)+ title = m.group('title')+ m = re.search(r'data-content-type="channel".*?>(?P<uploader>.*?)</a>',+ webpage, re.DOTALL)+ uploader = unescapeHTML(m.group('uploader').strip())+ m = re.search(r'<link rel="image_src" href="(?P<thumb>.*?)"', webpage)+ thumb = m.group('thumb')+ except AttributeError:+ raise ExtractorError(u'Unable to extract info')info = {'id':video_id,'url':video_url,'ext': 'flv','title': title,- 'uploader': uploader+ 'uploader': uploader,+ 'thumbnail': thumb,}- return [info]+ return infoclass WorldStarHipHopIE(InfoExtractor):_VALID_URL = r'https?://(?:www|m)\.worldstar(?:candy|hiphop)\.com/videos/video\.php\?v=(?P<id>.*)'