]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/mwave.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   4 from ..compat 
import compat_str
 
  11 class MwaveIE(InfoExtractor
): 
  12     _VALID_URL 
= r
'https?://mwave\.interest\.me/mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)' 
  14         'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859', 
  15         'md5': 'c930e27b7720aaa3c9d0018dfc8ff6cc', 
  19             'title': '[M COUNTDOWN] SISTAR - SHAKE IT', 
  20             'thumbnail': 're:^https?://.*\.jpg$', 
  21             'uploader': 'M COUNTDOWN', 
  27     def _real_extract(self
, url
): 
  28         video_id 
= self
._match
_id
(url
) 
  30         vod_info 
= self
._download
_json
( 
  31             'http://mwave.interest.me/onair/vod_info.m?vodtype=CL§orid=&endinfo=Y&id=%s' % video_id
, 
  32             video_id
, 'Download vod JSON') 
  35         for num
, cdn_info 
in enumerate(vod_info
['cdn']): 
  36             stream_url 
= cdn_info
.get('url') 
  39             stream_name 
= cdn_info
.get('name') or compat_str(num
) 
  40             f4m_stream 
= self
._download
_json
( 
  42                 'Download %s stream JSON' % stream_name
) 
  43             f4m_url 
= f4m_stream
.get('fileurl') 
  47                 self
._extract
_f
4m
_formats
(f4m_url 
+ '&hdcore=3.0.3', video_id
, f4m_id
=stream_name
)) 
  48         self
._sort
_formats
(formats
) 
  52             'title': vod_info
['title'], 
  53             'thumbnail': vod_info
.get('cover'), 
  54             'uploader': vod_info
.get('program_title'), 
  55             'duration': parse_duration(vod_info
.get('time')), 
  56             'view_count': int_or_none(vod_info
.get('hit')),