1 from .common
import InfoExtractor
8 class CONtvIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?contv\.com/details-movie/(?P<id>[^/]+)'
11 'url': 'https://www.contv.com/details-movie/CEG10022949/days-of-thrills-&-laughter',
15 'title': 'Days Of Thrills & Laughter',
16 'description': 'md5:5d6b3d0b1829bb93eb72898c734802eb',
17 'upload_date': '20180703',
18 'timestamp': 1530634789.61,
22 'skip_download': True,
25 'url': 'https://www.contv.com/details-movie/CLIP-show_fotld_bts/fight-of-the-living-dead:-behind-the-scenes-bites',
27 'id': 'CLIP-show_fotld_bts',
28 'title': 'Fight of the Living Dead: Behind the Scenes Bites',
30 'playlist_mincount': 7,
33 def _real_extract(self
, url
):
34 video_id
= self
._match
_id
(url
)
35 details
= self
._download
_json
(
36 'http://metax.contv.live.junctiontv.net/metax/2.5/details/' + video_id
,
37 video_id
, query
={'device': 'web'})
39 if details
.get('type') == 'episodic':
40 seasons
= self
._download
_json
(
41 'http://metax.contv.live.junctiontv.net/metax/2.5/seriesfeed/json/' + video_id
,
44 for season
in seasons
:
45 for episode
in season
.get('episodes', []):
46 episode_id
= episode
.get('id')
49 entries
.append(self
.url_result(
50 'https://www.contv.com/details-movie/' + episode_id
,
51 CONtvIE
.ie_key(), episode_id
))
52 return self
.playlist_result(entries
, video_id
, details
.get('title'))
54 m_details
= details
['details']
55 title
= details
['title']
59 media_hls_url
= m_details
.get('media_hls_url')
61 formats
.extend(self
._extract
_m
3u8_formats
(
62 media_hls_url
, video_id
, 'mp4',
63 m3u8_id
='hls', fatal
=False))
65 media_mp4_url
= m_details
.get('media_mp4_url')
73 captions
= m_details
.get('captions') or {}
74 for caption_url
in captions
.values():
75 subtitles
.setdefault('en', []).append({
80 for image
in m_details
.get('images', []):
81 image_url
= image
.get('url')
86 'width': int_or_none(image
.get('width')),
87 'height': int_or_none(image
.get('height')),
91 for p
in ('large_', 'medium_', 'small_', ''):
92 d
= m_details
.get(p
+ 'description')
101 'thumbnails': thumbnails
,
102 'description': description
,
103 'timestamp': float_or_none(details
.get('metax_added_on'), 1000),
104 'subtitles': subtitles
,
105 'duration': float_or_none(m_details
.get('duration'), 1000),
106 'view_count': int_or_none(details
.get('num_watched')),
107 'like_count': int_or_none(details
.get('num_fav')),
108 'categories': details
.get('category'),
109 'tags': details
.get('tags'),
110 'season_number': int_or_none(details
.get('season')),
111 'episode_number': int_or_none(details
.get('episode')),
112 'release_year': int_or_none(details
.get('pub_year')),