+ elif asset_type == 'OnceURL':
+ tp_formats, tp_subtitles = self._extract_theplatform_smil(
+ video_url, video_id)
+ formats.extend(tp_formats)
+ subtitles = self._merge_subtitles(subtitles, tp_subtitles)
+ else:
+ tbr = int_or_none(video_asset.get('bitRate'), 1000)
+ format_id = 'http%s' % ('-%d' % tbr if tbr else '')
+ video_url = update_url_query(
+ video_url, {'format': 'redirect'})
+ # resolve the url so that we can check availability and detect the correct extension
+ head = self._request_webpage(
+ HEADRequest(video_url), video_id,
+ 'Checking %s url' % format_id,
+ '%s is not available' % format_id,
+ fatal=False)
+ if head:
+ video_url = head.geturl()
+ formats.append({
+ 'format_id': format_id,
+ 'url': video_url,
+ 'width': int_or_none(video_asset.get('width')),
+ 'height': int_or_none(video_asset.get('height')),
+ 'tbr': tbr,
+ 'container': video_asset.get('format'),
+ })
+ self._sort_formats(formats)