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.

32 lines
1.1 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class MakerTVIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:(?:www\.)?maker\.tv/(?:[^/]+/)*video|makerplayer.com/embed/maker)/(?P<id>[a-zA-Z0-9]{12})'
  6. _TEST = {
  7. 'url': 'http://www.maker.tv/video/Fh3QgymL9gsc',
  8. 'md5': 'ca237a53a8eb20b6dc5bd60564d4ab3e',
  9. 'info_dict': {
  10. 'id': 'Fh3QgymL9gsc',
  11. 'ext': 'mp4',
  12. 'title': 'Maze Runner: The Scorch Trials Official Movie Review',
  13. 'description': 'md5:11ff3362d7ef1d679fdb649f6413975a',
  14. 'upload_date': '20150918',
  15. 'timestamp': 1442549540,
  16. }
  17. }
  18. def _real_extract(self, url):
  19. video_id = self._match_id(url)
  20. webpage = self._download_webpage(url, video_id)
  21. jwplatform_id = self._search_regex(r'jw_?id="([^"]+)"', webpage, 'jwplatform id')
  22. return {
  23. '_type': 'url_transparent',
  24. 'id': video_id,
  25. 'url': 'jwplatform:%s' % jwplatform_id,
  26. 'ie_key': 'JWPlatform',
  27. }