You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB

10 years ago
10 years ago
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class GlideIE(InfoExtractor):
  5. IE_DESC = 'Glide mobile video messages (glide.me)'
  6. _VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
  7. _TEST = {
  8. 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dCiQ0w==',
  9. 'md5': '4466372687352851af2d131cfaa8a4c7',
  10. 'info_dict': {
  11. 'id': 'UZF8zlmuQbe4mr+7dCiQ0w==',
  12. 'ext': 'mp4',
  13. 'title': "Damon's Glide message",
  14. 'thumbnail': r're:^https?://.*?\.cloudfront\.net/.*\.jpg$',
  15. }
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. title = self._html_search_regex(
  21. r'<title>(.+?)</title>', webpage,
  22. 'title', default=None) or self._og_search_title(webpage)
  23. video_url = self._proto_relative_url(self._search_regex(
  24. r'<source[^>]+src=(["\'])(?P<url>.+?)\1',
  25. webpage, 'video URL', default=None,
  26. group='url')) or self._og_search_video_url(webpage)
  27. thumbnail = self._proto_relative_url(self._search_regex(
  28. r'<img[^>]+id=["\']video-thumbnail["\'][^>]+src=(["\'])(?P<url>.+?)\1',
  29. webpage, 'thumbnail url', default=None,
  30. group='url')) or self._og_search_thumbnail(webpage)
  31. return {
  32. 'id': video_id,
  33. 'title': title,
  34. 'url': video_url,
  35. 'thumbnail': thumbnail,
  36. }