-
- idoc = self._download_xml(
- segment_url, segment_title,
- 'Downloading segment information', 'Unable to download segment information')
-
- segment_duration = float_or_none(
- xpath_text(idoc, './/trt', 'segment duration').strip())
-
- formats = []
- file_els = idoc.findall('.//files/file')
-
- for file_el in file_els:
- bitrate = file_el.attrib.get('bitrate')
- ftype = file_el.attrib.get('type')
-
- formats.append({
- 'format_id': '%s_%s' % (bitrate, ftype),
- 'url': file_el.text.strip(),
- # The bitrate may not be a number (for example: 'iphone')
- 'tbr': int(bitrate) if bitrate.isdigit() else None,
- 'quality': 1 if ftype == 'hd' else -1
- })
-
- self._sort_formats(formats)
-
- entries.append({