2 from __future__ import unicode_literals
4 from .common import InfoExtractor
12 class MnetIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?mnet\.(?:com|interest\.me)/tv/vod/(?:.*?\bclip_id=)?(?P<id>[0-9]+)'
16 'url': 'http://www.mnet.com/tv/vod/171008',
17 'md5': '6abd7a837fa9fe56d22709a60b19bffb',
20 'title': 'SS_이해인@히든박스',
21 'description': 'md5:b9efa592c3918b615ba69fe9f8a05c55',
23 'upload_date': '20151231',
24 'timestamp': 1451564040,
26 'thumbnails': 'mincount:5',
31 'url': 'http://mnet.interest.me/tv/vod/172790',
32 'only_matching': True,
35 'url': 'http://www.mnet.com/tv/vod/vod_view.asp?clip_id=172790&tabMenu=',
36 'only_matching': True,
40 def _real_extract(self, url):
41 video_id = self._match_id(url)
42 info_url = 'http://content.api.mnet.com/player/vodConfig?id=%s' % video_id
43 info = self._download_json(info_url, video_id)
44 info = info['data']['info']
47 rtmp_info_url = info['cdn'] + 'CLIP'
48 rtmp_info = self._download_json(rtmp_info_url, video_id)
49 file_url = rtmp_info['serverurl'] + rtmp_info['fileurl']
50 description = info.get('ment')
51 duration = parse_duration(info.get('time'))
52 timestamp = parse_iso8601(info.get('date'), delimiter=' ')
53 age_limit = info.get('adult')
54 if age_limit is not None:
55 age_limit = 0 if age_limit == 'N' else 18
60 'width': int_or_none(thumb.get('width')),
61 'height': int_or_none(thumb.get('height')),
63 for (thumb_format, thumb) in info.get('cover', {}).items()
70 'description': description,
72 'timestamp': timestamp,
73 'age_limit': age_limit,
74 'thumbnails': thumbnails,