- for file_el in file_els:
- bitrate = file_el.attrib.get('bitrate')
- width = int(file_el.attrib.get('width'))
- height = int(file_el.attrib.get('height'))
- formats.append({
- 'url': compat_str(file_el.text),
- 'ext': 'mp4',
- 'height': height,
- 'width': width
- })
+ posters_el = metadata.find('./PosterLinks')
+ thumbnails = [{
+ 'url': thumbnail.text,
+ 'width': int(thumbnail.get('width')),
+ 'height': int(thumbnail.get('height')),
+ } for thumbnail in posters_el.findall('./PosterIMG')] if posters_el is not None else []
+
+ categories_el = metadata.find('./Categories')
+ categories = [
+ cat.get('name') for cat in categories_el.findall('./Category')
+ ] if categories_el is not None else []