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.

46 lines
1.6 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class MwaveIE(InfoExtractor):
  4. IE_NAME = 'mwave'
  5. _VALID_URL = r'https?://mwave\.interest\.me/mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)'
  6. _TESTS = [{
  7. 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859',
  8. 'info_dict': {
  9. 'id': '168859',
  10. 'ext': 'flv',
  11. 'title': '[M COUNTDOWN] SISTAR - SHAKE IT',
  12. 'creator': 'M COUNTDOWN',
  13. }
  14. }, {
  15. 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168860',
  16. 'info_dict': {
  17. 'id': '168860',
  18. 'ext': 'flv',
  19. 'title': '[Full Ver.] M GIGS Ep. 59 - IDIOTAPE Live Part 1',
  20. 'creator': 'M-GIGS',
  21. }
  22. }]
  23. def _real_extract(self, url):
  24. video_id = self._match_id(url)
  25. stream_info = self._download_json(
  26. 'http://mwave.interest.me/onair/vod_info.m?vodtype=CL&sectorid=&endinfo=Y&id=%s' % video_id,
  27. 'Download stream info')
  28. formats = []
  29. for info in stream_info['cdn']:
  30. f4m_stream = self._download_json(info['url'], video_id, 'Download f4m stream')
  31. formats.extend(
  32. self._extract_f4m_formats(f4m_stream['fileurl'] + '&g=PCROWKHLYUDY&hdcore=3.0.3', video_id))
  33. self._sort_formats(formats)
  34. return {
  35. 'id': video_id,
  36. 'title': stream_info['title'],
  37. 'creator': stream_info.get('program_title'),
  38. 'formats': formats,
  39. }