diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-05-18 11:54:18 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-05-18 11:54:18 +0200 |
commit | 340fa21198b214d97e73c114fcb27a9d2b04012f (patch) | |
tree | 915b86787ea7f9cd17b90de73833a8d74ec0b3fe /youtube_dl | |
parent | 7bdb17d4d52121624286207489154908fd5a773f (diff) | |
download | youtube-dl-340fa21198b214d97e73c114fcb27a9d2b04012f.tar.xz |
UstreamIE: get thumbnail and uploader name
Diffstat (limited to 'youtube_dl')
-rwxr-xr-x | youtube_dl/InfoExtractors.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 6d6203a1c..112d97a86 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_id webpage = 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 info class WorldStarHipHopIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.worldstar(?:candy|hiphop)\.com/videos/video\.php\?v=(?P<id>.*)' |