]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/glide.py
[cleanup] Misc fixes
[yt-dlp.git] / yt_dlp / extractor / glide.py
CommitLineData
a86c73cf
DT
1# coding: utf-8
2from __future__ import unicode_literals
3
4from .common import InfoExtractor
5
6
7class GlideIE(InfoExtractor):
8 IE_DESC = 'Glide mobile video messages (glide.me)'
9 _VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
10 _TEST = {
11 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
12 'md5': '4466372687352851af2d131cfaa8a4c7',
13 'info_dict': {
14 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
15 'ext': 'mp4',
af95ee94 16 'title': "Damon's Glide message",
ec85ded8 17 'thumbnail': r're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
a86c73cf
DT
18 }
19 }
20
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
5899e988 23
a86c73cf 24 webpage = self._download_webpage(url, video_id)
5899e988 25
04f3fd2c 26 title = self._html_extract_title(webpage, default=None) or self._og_search_title(webpage)
4a121d29
S
27 video_url = self._proto_relative_url(self._search_regex(
28 r'<source[^>]+src=(["\'])(?P<url>.+?)\1',
5899e988
S
29 webpage, 'video URL', default=None,
30 group='url')) or self._og_search_video_url(webpage)
31 thumbnail = self._proto_relative_url(self._search_regex(
32 r'<img[^>]+id=["\']video-thumbnail["\'][^>]+src=(["\'])(?P<url>.+?)\1',
33 webpage, 'thumbnail url', default=None,
34 group='url')) or self._og_search_thumbnail(webpage)
a86c73cf
DT
35
36 return {
37 'id': video_id,
38 'title': title,
1ede5b24
PH
39 'url': video_url,
40 'thumbnail': thumbnail,
a86c73cf 41 }