]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/glide.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
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\-=_+]+)'
11 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
12 'md5': '4466372687352851af2d131cfaa8a4c7',
14 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
16 'title': "Damon's Glide message",
17 'thumbnail': 're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
21 def _real_extract(self
, url
):
22 video_id
= self
._match
_id
(url
)
24 webpage
= self
._download
_webpage
(url
, video_id
)
26 title
= self
._html
_search
_regex
(
27 r
'<title>(.+?)</title>', webpage
,
28 'title', default
=None) or self
._og
_search
_title
(webpage
)
29 video_url
= self
._proto
_relative
_url
(self
._search
_regex
(
30 r
'<source[^>]+src=(["\'])(?P
<url
>.+?
)\
1',
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)
42 'thumbnail': thumbnail,