[cleanup] Misc (#8968)
[yt-dlp.git] / yt_dlp / extractor / glide.py
blobd114f3494cc5c6cb3b672a65977b7a19c09c08c6
1 from .common import InfoExtractor
4 class GlideIE(InfoExtractor):
5 IE_DESC = 'Glide mobile video messages (glide.me)'
6 _VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
7 _TEST = {
8 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
9 'md5': '4466372687352851af2d131cfaa8a4c7',
10 'info_dict': {
11 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
12 'ext': 'mp4',
13 'title': "Damon's Glide message",
14 'thumbnail': r're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
18 def _real_extract(self, url):
19 video_id = self._match_id(url)
21 webpage = self._download_webpage(url, video_id)
23 title = self._generic_title('', webpage)
24 video_url = self._proto_relative_url(self._search_regex(
25 r'<source[^>]+src=(["\'])(?P<url>.+?)\1',
26 webpage, 'video URL', default=None,
27 group='url')) or self._og_search_video_url(webpage)
28 thumbnail = self._proto_relative_url(self._search_regex(
29 r'<img[^>]+id=["\']video-thumbnail["\'][^>]+src=(["\'])(?P<url>.+?)\1',
30 webpage, 'thumbnail url', default=None,
31 group='url')) or self._og_search_thumbnail(webpage)
33 return {
34 'id': video_id,
35 'title': title,
36 'url': video_url,
37 'thumbnail': thumbnail,