1 from .common
import InfoExtractor
9 class MnetIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?mnet\.(?:com|interest\.me)/tv/vod/(?:.*?\bclip_id=)?(?P<id>[0-9]+)'
12 'url': 'http://www.mnet.com/tv/vod/171008',
15 'title': 'SS_이해인@히든박스',
16 'description': 'md5:b9efa592c3918b615ba69fe9f8a05c55',
18 'upload_date': '20151231',
19 'timestamp': 1451564040,
21 'thumbnails': 'mincount:5',
22 'thumbnail': r
're:^https?://.*\.jpg$',
27 'skip_download': True,
30 'url': 'http://mnet.interest.me/tv/vod/172790',
31 'only_matching': True,
33 'url': 'http://www.mnet.com/tv/vod/vod_view.asp?clip_id=172790&tabMenu=',
34 'only_matching': True,
37 def _real_extract(self
, url
):
38 video_id
= self
._match
_id
(url
)
40 # TODO: extract rtmp formats
41 # no stype -> rtmp url
44 info
= self
._download
_json
(
45 'http://content.api.mnet.com/player/vodConfig',
46 video_id
, 'Downloading vod config JSON', query
={
54 cdn_data
= self
._download
_json
(
55 info
['cdn'], video_id
, 'Downloading vod cdn JSON')['data'][0]
56 m3u8_url
= cdn_data
['url']
57 token
= cdn_data
.get('token')
58 if token
and token
!= '-':
59 m3u8_url
+= '?' + token
60 formats
= self
._extract
_wowza
_formats
(
61 m3u8_url
, video_id
, skip_protocols
=['rtmp', 'rtsp', 'f4m'])
63 description
= info
.get('ment')
64 duration
= parse_duration(info
.get('time'))
65 timestamp
= parse_iso8601(info
.get('date'), delimiter
=' ')
66 age_limit
= info
.get('adult')
67 if age_limit
is not None:
68 age_limit
= 0 if age_limit
== 'N' else 18
72 'width': int_or_none(thumb
.get('width')),
73 'height': int_or_none(thumb
.get('height')),
74 } for thumb_format
, thumb
in info
.get('cover', {}).items() if thumb
.get('url')]
79 'description': description
,
81 'timestamp': timestamp
,
82 'age_limit': age_limit
,
83 'thumbnails': thumbnails
,