'info_dict': {
'id': '3449373',
'display_id': 'les-enfants-terribles',
- 'ext': 'flv',
+ 'ext': 'mp4',
'duration': 1488,
'title': 'Les Enfants Terribles',
'description': 'France Pommier et sa soeur Luce Feral, les deux filles de ce groupe de 5.',
'thumbnail': 're:^https?://.*\.image',
'view_count': int,
},
+ 'params': {
+ # m3u8 download
+ 'skip_download': True,
+ }
},
{
'url': 'http://www.rts.ch/emissions/passe-moi-les-jumelles/5624067-entre-ciel-et-mer.html',
'info_dict': {
'id': '5742494',
'display_id': '5742494',
- 'ext': 'flv',
+ 'ext': 'mp4',
'duration': 3720,
'title': 'Les yeux dans les cieux - Mon homard au Canada',
'description': 'md5:d22ee46f5cc5bac0912e5a0c6d44a9f7',
'thumbnail': 're:^https?://.*\.image',
'view_count': int,
},
+ 'params': {
+ # m3u8 download
+ 'skip_download': True,
+ }
},
{
'url': 'http://www.rts.ch/video/sport/hockey/5745975-1-2-kloten-fribourg-5-2-second-but-pour-gotteron-par-kwiatowski.html',
'info_dict': {
'id': '5745356',
'display_id': 'londres-cachee-par-un-epais-smog',
- 'ext': 'flv',
+ 'ext': 'mp4',
'duration': 33,
'title': 'Londres cachée par un épais smog',
'description': 'Un important voile de smog recouvre Londres depuis mercredi, provoqué par la pollution et du sable du Sahara.',
'thumbnail': 're:^https?://.*\.image',
'view_count': int,
},
+ 'params': {
+ # m3u8 download
+ 'skip_download': True,
+ }
},
{
'url': 'http://www.rts.ch/audio/couleur3/programmes/la-belle-video-de-stephane-laurenceau/5706148-urban-hippie-de-damien-krisl-03-04-2014.html',
auth_params = xpath_text(token, './/authparams', 'auth params')
if not auth_params:
continue
- f4m_formats = self._extract_f4m_formats(
+ formats.extend(self._extract_f4m_formats(
'%s?%s&hdcore=3.4.0&plugin=aasp-3.4.0.132.66' % (format_url, auth_params),
- media_id, f4m_id=format_id, fatal=False)
- if f4m_formats:
- formats.extend(f4m_formats)
+ media_id, f4m_id=format_id, fatal=False))
elif format_url.endswith('.m3u8'):
- m3u8_formats = self._extract_m3u8_formats(
- format_url, media_id, 'mp4', m3u8_id=format_id, fatal=False)
- if m3u8_formats:
- formats.extend(m3u8_formats)
+ formats.extend(self._extract_m3u8_formats(
+ format_url, media_id, 'mp4', m3u8_id=format_id, fatal=False))
else:
formats.append({
'format_id': format_id,
created_date = media_data.get('createdDate') or metadata.get('createdDate')
timestamp = parse_iso8601(created_date)
- thumbnails = []
- if 'Image' in media_data:
- for image in media_data['Image']['ImageRepresentations']['ImageRepresentation']:
- thumbnails.append({
- 'id': image.get('id'),
- 'url': image['url'],
- })
+ thumbnails = [{
+ 'id': image.get('id'),
+ 'url': image['url'],
+ } for image in media_data.get('Image', {}).get('ImageRepresentations', {}).get('ImageRepresentation', [])]
preference = qualities(['LQ', 'MQ', 'SD', 'HQ', 'HD'])
formats = []
- for source in media_data['Playlists']['Playlist']:
- assets = {}
+ for source in media_data.get('Playlists', {}).get('Playlist', []) + media_data.get('Downloads', {}).get('Download', []):
protocol = source.get('@protocol')
if protocol in ('HTTP-HDS', 'HTTP-HLS'):
+ assets = {}
for quality in source['url']:
assets[quality['@quality']] = quality['text']
asset_url = assets.get('HD') or assets.get('HQ') or assets.get('SD') or assets.get('MQ') or assets.get('LQ')
if '.f4m' in asset_url:
- f4m_formats = formats.extend(self._extract_f4m_formats(asset_url + '?hdcore=3.4.0', media_id, f4m_id='hds', fatal=False))
- if f4m_formats:
- formats.extend(f4m_formats)
+ formats.extend(self._extract_f4m_formats(asset_url + '?hdcore=3.4.0', media_id, f4m_id='hds', fatal=False))
elif '.m3u8' in asset_url:
- m3u8_formats = formats.extend(self._extract_m3u8_formats(asset_url, media_id, m3u8_id='hls', fatal=False))
- if m3u8_formats:
- formats.extend(m3u8_formats)
+ formats.extend(self._extract_m3u8_formats(asset_url, media_id, m3u8_id='hls', fatal=False))
else:
for asset in source['url']:
asset_url = asset['text']
'preference': preference(asset['@quality']),
'ext': ext,
})
-
- if 'Downloads' in media_data:
- for source in media_data['Downloads']['Download']:
- for asset in source['url']:
- formats.append({
- 'format_id': asset['@quality'],
- 'url': asset['text'],
- 'preference': preference(asset['@quality'])
- })
self._sort_formats(formats)
return {
'info_dict': {
'id': '6348260',
'display_id': '6348260',
- 'ext': 'flv',
+ 'ext': 'mp4',
'duration': 1796,
'title': 'Le 19h30',
'description': '',
'thumbnail': 're:^https?://.*\.image',
'view_count': int,
},
+ 'params': {
+ # m3u8 download
+ 'skip_download': True,
+ }
}]
def _real_extract(self, url):