1 from .common
import InfoExtractor
8 class PlanetMarathiIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?planetmarathi\.com/titles/(?P<id>[^/#&?$]+)'
11 'url': 'https://www.planetmarathi.com/titles/ek-unad-divas',
12 'playlist_mincount': 2,
14 'id': 'ek-unad-divas',
18 'id': 'ASSETS-MOVIE-ASSET-01_ek-unad-divas',
20 'title': 'ek unad divas',
21 'alt_title': 'चित्रपट',
22 'description': 'md5:41c7ed6b041c2fea9820a3f3125bd881',
25 'upload_date': '20210829',
29 'url': 'https://www.planetmarathi.com/titles/baap-beep-baap-season-1',
30 'playlist_mincount': 10,
32 'id': 'baap-beep-baap-season-1',
36 'id': 'ASSETS-CHARACTER-PROFILE-SEASON-01-ASSET-01_baap-beep-baap-season-1',
38 'title': 'Manohar Kanhere',
39 'alt_title': 'मनोहर कान्हेरे',
40 'description': 'md5:285ed45d5c0ab5522cac9a043354ebc6',
44 'upload_date': '20210829',
46 }], # Trailers, Episodes, other Character profiles skipped
49 def _real_extract(self
, url
):
50 playlist_id
= self
._match
_id
(url
)
52 json_data
= self
._download
_json
(
53 f
'https://www.planetmarathi.com/api/v1/titles/{playlist_id}/assets', playlist_id
)['assets']
54 for asset
in json_data
:
55 asset_title
= asset
['mediaAssetName']['en']
56 if asset_title
== 'Movie':
57 asset_title
= playlist_id
.replace('-', ' ')
58 asset_id
= f
'{asset["sk"]}_{playlist_id}'.replace('#', '-')
59 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(asset
['mediaAssetURL'], asset_id
)
63 'alt_title': try_get(asset
, lambda x
: x
['mediaAssetName']['mr']),
64 'description': try_get(asset
, lambda x
: x
['mediaAssetDescription']['en']),
65 'season_number': asset
.get('mediaAssetSeason'),
66 'episode_number': asset
.get('mediaAssetIndexForAssetType'),
67 'duration': asset
.get('mediaAssetDurationInSeconds'),
68 'upload_date': unified_strdate(asset
.get('created')),
70 'subtitles': subtitles
,
72 return self
.playlist_result(entries
, playlist_id
=playlist_id
)