+
+ width = None
+ height = None
+ size_str = url_data.get('size', [''])[0]
+ if size_str.count('x') == 1:
+ width, height = [int_or_none(x) for x in size_str.split('x')]
+
+ format_url = {
+ 'format_id': format_id,
+ 'url': url,
+ 'player_url': player_url,
+ # As of this writing these are only defined for DASH formats:
+ 'filesize': int_or_none(url_data.get('clen', [None])[0]),
+ 'tbr': float_or_none(url_data.get('bitrate', [None])[0], scale=1024),
+ 'width': width,
+ 'height': height,
+ 'fps': int_or_none(url_data.get('fps', [None])[0]),
+ }
+
+ # drop Nones so they do not overwrite the defaults from self._formats
+ format_url = dict((k, v) for k, v in format_url.items() if v is not None)
+
+ format_full = self._formats.get(format_id, {}).copy()
+ format_full.update(format_url)
+
+ formats.append(format_full)
+