1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +01:00

[disney] provide episode_number and season_number for some series

This commit is contained in:
Marcin Cieślak 2017-06-14 23:27:50 +02:00
parent 5215f45327
commit 6bb5f07c53

View File

@ -150,7 +150,7 @@ class DisneyIE(InfoExtractor):
}.get(caption_format, caption_format), }.get(caption_format, caption_format),
}) })
return { metadata = {
'id': video_id, 'id': video_id,
'title': title, 'title': title,
'description': video_data.get('description') or video_data.get('short_desc'), 'description': video_data.get('description') or video_data.get('short_desc'),
@ -160,3 +160,16 @@ class DisneyIE(InfoExtractor):
'formats': formats, 'formats': formats,
'subtitles': subtitles, 'subtitles': subtitles,
} }
externals = video_data.get('externals', {})
if len(externals) > 0:
data_pack = externals[0].get('data', {})
if data_pack:
season_number = int_or_none(data_pack.get('Season', None))
episode_number = int_or_none(data_pack.get('Episode', None))
if season_number:
metadata['season_number'] = season_number
if episode_number:
metadata['episode_number'] = episode_number
return metadata