1 from .common
import InfoExtractor
2 from ..utils
import parse_age_limit
, parse_duration
, traverse_obj
5 class MagellanTVIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?magellantv\.com/(?:watch|video)/(?P<id>[\w-]+)'
8 'url': 'https://www.magellantv.com/watch/my-dads-on-death-row?type=v',
10 'id': 'my-dads-on-death-row',
12 'title': 'My Dad\'s On Death Row',
13 'description': 'md5:33ba23b9f0651fc4537ed19b1d5b0d7a',
16 'tags': ['Justice', 'Reality', 'United States', 'True Crime'],
18 'params': {'skip_download': 'm3u8'},
20 'url': 'https://www.magellantv.com/video/james-bulger-the-new-revelations',
22 'id': 'james-bulger-the-new-revelations',
24 'title': 'James Bulger: The New Revelations',
25 'description': 'md5:7b97922038bad1d0fe8d0470d8a189f2',
28 'tags': ['Investigation', 'True Crime', 'Justice', 'Europe'],
30 'params': {'skip_download': 'm3u8'},
32 'url': 'https://www.magellantv.com/watch/celebration-nation',
34 'id': 'celebration-nation',
36 'tags': ['Art & Culture', 'Human Interest', 'Anthropology', 'China', 'History'],
40 'params': {'skip_download': 'm3u8'},
43 def _real_extract(self
, url
):
44 video_id
= self
._match
_id
(url
)
45 webpage
= self
._download
_webpage
(url
, video_id
)
46 data
= traverse_obj(self
._search
_nextjs
_data
(webpage
, video_id
), (
47 'props', 'pageProps', 'reactContext',
48 (('video', 'detail'), ('series', 'currentEpisode')), {dict}
), get_all
=False)
49 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(data
['jwpVideoUrl'], video_id
)
54 'subtitles': subtitles
,
55 **traverse_obj(data
, {
56 'title': ('title', {str}
),
57 'description': ('metadata', 'description', {str}
),
58 'duration': ('duration', {parse_duration}
),
59 'age_limit': ('ratingCategory', {parse_age_limit}
),
60 'tags': ('tags', ..., {str}
),