]>
Commit | Line | Data |
---|---|---|
a86c73cf DT |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | from .common import InfoExtractor | |
5 | ||
6 | ||
7 | class 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", |
1ede5b24 | 17 | 'thumbnail': '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 | |
1ede5b24 | 26 | title = self._html_search_regex( |
af95ee94 S |
27 | r'<title>(.+?)</title>', webpage, |
28 | 'title', default=None) or self._og_search_title(webpage) | |
4a121d29 S |
29 | video_url = self._proto_relative_url(self._search_regex( |
30 | r'<source[^>]+src=(["\'])(?P<url>.+?)\1', | |
5899e988 S |
31 | webpage, 'video URL', default=None, |
32 | group='url')) or self._og_search_video_url(webpage) | |
33 | thumbnail = self._proto_relative_url(self._search_regex( | |
34 | r'<img[^>]+id=["\']video-thumbnail["\'][^>]+src=(["\'])(?P<url>.+?)\1', | |
35 | webpage, 'thumbnail url', default=None, | |
36 | group='url')) or self._og_search_thumbnail(webpage) | |
a86c73cf DT |
37 | |
38 | return { | |
39 | 'id': video_id, | |
40 | 'title': title, | |
1ede5b24 PH |
41 | 'url': video_url, |
42 | 'thumbnail': thumbnail, | |
a86c73cf | 43 | } |