]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/glide.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / glide.py
CommitLineData
a86c73cf
DT
1from .common import InfoExtractor
2
3
4class 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',
af95ee94 13 'title': "Damon's Glide message",
ec85ded8 14 'thumbnail': r're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
add96eb9 15 },
a86c73cf
DT
16 }
17
18 def _real_extract(self, url):
19 video_id = self._match_id(url)
5899e988 20
a86c73cf 21 webpage = self._download_webpage(url, video_id)
5899e988 22
62b8dac4 23 title = self._generic_title('', webpage)
4a121d29
S
24 video_url = self._proto_relative_url(self._search_regex(
25 r'<source[^>]+src=(["\'])(?P<url>.+?)\1',
5899e988
S
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)
a86c73cf
DT
32
33 return {
34 'id': video_id,
35 'title': title,
1ede5b24
PH
36 'url': video_url,
37 'thumbnail': thumbnail,
a86c73cf 38 }