- formats.append({
- 'url': '%s?h=%s&k=%s' % (resource['url'], signed_hash, 'flash'),
- 'format_id': resource_id,
- 'height': resource['height']
- })
+ resource_url = resource['url']
+ signed_url = '%s?h=%s&k=%s' % (resource_url, signed_hash, 'flash')
+ if resource_id.endswith('m3u8') or resource_url.endswith('.m3u8'):
+ formats.extend(self._extract_m3u8_formats(signed_url, resource_id, 'mp4'))
+ else:
+ formats.append({
+ 'url': signed_url,
+ 'format_id': resource_id,
+ 'height': resource.get('height'),
+ })