+
+ thumbnails = []
+ for image_id, image in video_data.get('images', {}).items():
+ image_url = image.get('url')
+ if not image_url or image.get('type') != 'video':
+ continue
+ i = {
+ 'id': image_id,
+ 'url': image_url,
+ }
+ mobj = re.search(r'(\d+)x(\d+)', image_url)
+ if mobj:
+ i.update({
+ 'width': int(mobj.group(1)),
+ 'height': int(mobj.group(2)),
+ })
+ thumbnails.append(i)
+
+ info.update({
+ 'id': media_id,
+ 'title': title,
+ 'description': strip_or_none(video_data.get('descriptionNoTags') or video_data.get('shortDescriptionNoTags')),
+ 'duration': float_or_none(video_data.get('duration')) or info.get('duration'),
+ 'timestamp': int_or_none(video_data.get('created')),
+ 'season_number': int_or_none(video_data.get('season')),
+ 'episode_number': int_or_none(video_data.get('episode')),
+ 'thumbnails': thumbnails,
+ })
+ return info