diff options
author | Philipp Hagemeister <[email protected]> | 2014-10-24 15:34:19 +0200 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2014-10-24 15:34:19 +0200 |
commit | 1ede5b2481a271fcfd0e179a494ef84cca2576b7 (patch) | |
tree | 6e65d9ff725fd5130aa1e6aae17bd20a5dd9c6a4 /youtube_dl/extractor/glide.py | |
parent | 964ae0a1228c9a0853e2b9142452d66e7333bf8c (diff) | |
download | youtube-dl-1ede5b2481a271fcfd0e179a494ef84cca2576b7.tar.gz youtube-dl-1ede5b2481a271fcfd0e179a494ef84cca2576b7.zip |
[glide] Simplify
Diffstat (limited to 'youtube_dl/extractor/glide.py')
-rw-r--r-- | youtube_dl/extractor/glide.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/youtube_dl/extractor/glide.py b/youtube_dl/extractor/glide.py index 175d85197..9561ed5fb 100644 --- a/youtube_dl/extractor/glide.py +++ b/youtube_dl/extractor/glide.py @@ -14,20 +14,27 @@ class GlideIE(InfoExtractor): 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==', 'ext': 'mp4', 'title': 'Damon Timm\'s Glide message', - 'thumbnail' : 'http://dk608k4lm7m9j.cloudfront.net/3ee7da5af87065a1eeb8c6c9a864ba5b_2.jpg' + 'thumbnail': 're:^https?://.*?\.cloudfront\.net/.*\.jpg$', } } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title') - video_url = self._search_regex(r'<source src="(.*?)" type="video/mp4">', webpage, 'video_url') - thumbnail_url = self._search_regex(r'<img id="video-thumbnail" src="(.*?)" alt="Video thumbnail">', webpage, 'thumbnail_url') + title = self._html_search_regex( + r'<title>(.*?)</title>', webpage, 'title') + video_url = self.http_scheme() + self._search_regex( + r'<source src="(.*?)" type="video/mp4">', webpage, 'video URL') + thumbnail_url = self._search_regex( + r'<img id="video-thumbnail" src="(.*?)"', + webpage, 'thumbnail url', fatal=False) + thumbnail = ( + thumbnail_url if thumbnail_url is None + else self.http_scheme() + thumbnail_url) return { 'id': video_id, 'title': title, - 'url' : 'http:' + video_url, - 'thumbnail' : 'http:' + thumbnail_url + 'url': video_url, + 'thumbnail': thumbnail, } |