mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[goldenmoustache] Simplify (#4128)
This commit is contained in:
parent
0b201a3134
commit
5ccaddf5b1
|
@ -18,26 +18,24 @@ class GoldenMoustacheIE(InfoExtractor):
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Suricate - Le Poker',
|
'title': 'Suricate - Le Poker',
|
||||||
'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9',
|
'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9',
|
||||||
'thumbnail': 'md5:fd41386bc1f932552622da4a7e9a7242',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
'view_count': int,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
video_id = mobj.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
video_url = self._html_search_regex(r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL')
|
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')
|
title = self._html_search_regex(
|
||||||
|
r'<title>(.*?) - Golden Moustache</title>', webpage, 'title')
|
||||||
thumbnail = self._html_search_meta('og:image', webpage, 'thumbnail')
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
description = self._og_search_description(webpage)
|
||||||
description = self._html_search_meta('og:description', webpage, 'description')
|
|
||||||
|
|
||||||
view_count = int_or_none(self._html_search_regex(
|
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 {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue