]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/glide.py
[exfm] Remove extractor (Closes #10482)
[yt-dlp.git] / youtube_dl / extractor / glide.py
CommitLineData
a86c73cf
DT
1# coding: utf-8
2from __future__ import unicode_literals
3
4from .common import InfoExtractor
5899e988 5from ..utils import unified_strdate
a86c73cf
DT
6
7
8class 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\-=_+]+)'
11 _TEST = {
12 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
13 'md5': '4466372687352851af2d131cfaa8a4c7',
14 'info_dict': {
15 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
16 'ext': 'mp4',
17 'title': 'Damon Timm\'s Glide message',
1ede5b24 18 'thumbnail': 're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
5899e988
S
19 'uploader': 'Damon Timm',
20 'upload_date': '20140919',
a86c73cf
DT
21 }
22 }
23
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
5899e988 26
a86c73cf 27 webpage = self._download_webpage(url, video_id)
5899e988 28
1ede5b24 29 title = self._html_search_regex(
5899e988 30 r'<title>(.+?)</title>', webpage, 'title')
4a121d29
S
31 video_url = self._proto_relative_url(self._search_regex(
32 r'<source[^>]+src=(["\'])(?P<url>.+?)\1',
5899e988
S
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))
a86c73cf
DT
45
46 return {
47 'id': video_id,
48 'title': title,
1ede5b24
PH
49 'url': video_url,
50 'thumbnail': thumbnail,
5899e988
S
51 'uploader': uploader,
52 'upload_date': upload_date,
a86c73cf 53 }