aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-11-12 15:36:59 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-11-12 15:36:59 +0100
commit5ccaddf5b150fc113f5b423f6d2f8b7e9a30cc83 (patch)
treeb596e19c5468cac9aff341bc12b9eccbcddc489d
parent0b201a3134e9b343e2791f2686f1a34f737007a4 (diff)
downloadyoutube-dl-5ccaddf5b150fc113f5b423f6d2f8b7e9a30cc83.tar.xz
[goldenmoustache] Simplify (#4128)
-rw-r--r--youtube_dl/extractor/goldenmoustache.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/youtube_dl/extractor/goldenmoustache.py b/youtube_dl/extractor/goldenmoustache.py
index c25d2e779..f2e231bf4 100644
--- a/youtube_dl/extractor/goldenmoustache.py
+++ b/youtube_dl/extractor/goldenmoustache.py
@@ -18,26 +18,24 @@ class GoldenMoustacheIE(InfoExtractor):
'ext': 'mp4',
'title': 'Suricate - Le Poker',
'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9',
- 'thumbnail': 'md5:fd41386bc1f932552622da4a7e9a7242',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'view_count': int,
}
}
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
-
+ video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
- video_url = self._html_search_regex(r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL')
-
- title = self._html_search_regex(r'<title>(.*?) - Golden Moustache</title>', webpage, 'title')
-
- thumbnail = self._html_search_meta('og:image', webpage, 'thumbnail')
-
- description = self._html_search_meta('og:description', webpage, 'description')
-
+ video_url = self._html_search_regex(
+ r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL')
+ title = self._html_search_regex(
+ r'<title>(.*?) - Golden Moustache</title>', webpage, 'title')
+ thumbnail = self._og_search_thumbnail(webpage)
+ description = self._og_search_description(webpage)
view_count = int_or_none(self._html_search_regex(
- r'<strong>(\d+)</strong>\s*VUES</span>', webpage, 'view count', fatal=False))
+ r'<strong>([0-9]+)</strong>\s*VUES</span>',
+ webpage, 'view count', fatal=False))
return {
'id': video_id,