1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-16 21:35:51 +00:00

[RTV SLO 4D] Support for multiple audio formats

This commit is contained in:
Miha Frangež 2021-02-15 15:31:03 +01:00
parent 2e75b8092f
commit 6435b66967

View file

@ -3,6 +3,8 @@ from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
try_get,
unified_timestamp
)
@ -71,6 +73,15 @@ class RTVSLO4DIE(InfoExtractor):
self._sort_formats(extracted['formats'])
elif media_info['mediaType'] == 'audio':
extracted['url'] = media_info['mediaFiles'][0]['streamers']['http'] + '/' + media_info['mediaFiles'][0]['filename']
extracted['formats'] = [{
'format_id': file['mediaType'],
'url': file['streamers']['http'] + '/' + file['filename'],
'ext': determine_ext(file['filename']),
'tbr': int_or_none(file.get('bitrate')),
'filesize': int_or_none(file.get('filesize')),
'vcodec': 'none'
} for file in media_info['mediaFiles']]
self._sort_formats(extracted['formats'])
return extracted