1 from .common
import InfoExtractor
10 class MzaaloIE(InfoExtractor
):
11 _VALID_URL
= r
'(?i)https?://(?:www\.)?mzaalo\.com/(?:play|watch)/(?P<type>movie|original|clip)/(?P<id>[a-f0-9-]+)/[\w-]+'
14 'url': 'https://www.mzaalo.com/play/movie/c0958d9f-f90e-4503-a755-44358758921d/Jamun',
16 'id': 'c0958d9f-f90e-4503-a755-44358758921d',
19 'description': 'md5:24fe9ebb9bbe5b36f7b54b90ab1e2f31',
20 'thumbnails': 'count:15',
21 'thumbnail': r
're:^https?://.*\.jpg$',
24 'categories': ['Drama'],
27 'params': {'skip_download': 'm3u8'},
30 'url': 'https://www.mzaalo.com/play/original/93d42b2b-f373-4c2d-bca4-997412cb069d/Modi-Season-2-CM-TO-PM/Episode-1:Decision,-Not-Promises',
32 'id': '93d42b2b-f373-4c2d-bca4-997412cb069d',
33 'title': 'Episode 1:Decision, Not Promises',
35 'description': 'md5:16f76058432a54774fbb2561a1955652',
36 'thumbnails': 'count:22',
37 'thumbnail': r
're:^https?://.*\.jpg$',
40 'categories': ['Drama'],
43 'params': {'skip_download': 'm3u8'},
46 'url': 'https://www.mzaalo.com/play/clip/83cdbcb5-400a-42f1-a1d2-459053cfbda5/Manto-Ki-Kahaaniya',
48 'id': '83cdbcb5-400a-42f1-a1d2-459053cfbda5',
49 'title': 'Manto Ki Kahaaniya',
51 'description': 'md5:c3c5f1d05f0fd1bfcb05b673d1cc9f2f',
52 'thumbnails': 'count:3',
53 'thumbnail': r
're:^https?://.*\.jpg$',
57 'params': {'skip_download': 'm3u8'},
59 'url': 'https://mzaalo.com/watch/MOVIE/389c892d-0b65-4019-bf73-d4edcb1c014f/Chalo-Dilli',
60 'only_matching': True,
63 def _real_extract(self
, url
):
64 video_id
, type_
= self
._match
_valid
_url
(url
).group('id', 'type')
65 path
= (f
'partner/streamurl?&assetId={video_id}&getClipDetails=YES' if type_
== 'clip'
66 else f
'api/v2/player/details?assetType={type_.upper()}&assetId={video_id}')
67 data
= self
._download
_json
(
68 f
'https://production.mzaalo.com/platform/{path}', video_id
, headers
={
69 'Ocp-Apim-Subscription-Key': '1d0caac2702049b89a305929fdf4cbae',
72 formats
= self
._extract
_m
3u8_formats
(data
['streamURL'], video_id
)
75 for subs_lang
, subs_url
in traverse_obj(data
, ('subtitles', {dict.items
}, ...)):
76 if url_or_none(subs_url
):
77 subtitles
[subs_lang
] = [{'url': subs_url
, 'ext': 'vtt'}]
79 lang
= traverse_obj(data
, ('language', {str.lower
}))
86 'subtitles': subtitles
,
87 **traverse_obj(data
, {
88 'title': ('title', {str}
),
89 'description': ('description', {str}
),
90 'duration': ('duration', {parse_duration}
),
91 'age_limit': ('maturity_rating', {parse_age_limit}
),
92 'thumbnails': ('images', ..., {'url': {url_or_none}
}),
93 'categories': ('genre', ..., {str}
),