]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/glide.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import unified_strdate
8 class GlideIE(InfoExtractor
):
9 IE_DESC
= 'Glide mobile video messages (glide.me)'
10 _VALID_URL
= r
'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
12 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
13 'md5': '4466372687352851af2d131cfaa8a4c7',
15 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
17 'title': 'Damon Timm\'s Glide message',
18 'thumbnail': 're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
19 'uploader': 'Damon Timm',
20 'upload_date': '20140919',
24 def _real_extract(self
, url
):
25 video_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 title
= self
._html
_search
_regex
(
30 r
'<title>(.+?)</title>', webpage
, 'title')
31 video_url
= self
._proto
_relative
_url
(self
._search
_regex
(
32 r
'<source[^>]+src=(["\'])(?P
<url
>.+?
)\
1',
33 webpage, 'video URL
', default=None,
34 group='url
')) or self._og_search_video_url(webpage)
35 thumbnail = self._proto_relative_url(self._search_regex(
36 r'<img
[^
>]+id=["\']video-thumbnail["\'][^
>]+src
=(["\'])(?P<url>.+?)\1',
37 webpage, 'thumbnail url', default=None,
38 group='url')) or self._og_search_thumbnail(webpage)
39 uploader = self._search_regex(
40 r'<div[^>]+class=["\']info
-name
["\'][^>]*>([^<]+)',
41 webpage, 'uploader', fatal=False)
42 upload_date = unified_strdate(self._search_regex(
43 r'<div[^>]+class="info
-date
"[^>]*>([^<]+)',
44 webpage, 'upload date', fatal=False))
50 'thumbnail': thumbnail,
52 'upload_date': upload_date,