X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Ftunein.py;h=b6b1f2568f23a6ea9fe8e12c86deb6b30d44a809;hb=b0ab0fac49057ea0df3db75fb407af92deaaa453;hp=4ce5aeeba242b94b78d71e3c9d033aa318b588fb;hpb=1434bffa1ff2fb1e4d80efc900a13a3541923119;p=youtube-dl diff --git a/youtube_dl/extractor/tunein.py b/youtube_dl/extractor/tunein.py index 4ce5aeeba..b6b1f2568 100644 --- a/youtube_dl/extractor/tunein.py +++ b/youtube_dl/extractor/tunein.py @@ -24,7 +24,7 @@ class TuneInIE(InfoExtractor): _INFO_DICT = { 'id': '34682', 'title': 'Jazz 24 on 88.5 Jazz24 - KPLU-HD2', - 'ext': 'AAC', + 'ext': 'aac', 'thumbnail': 're:^https?://.*\.png$', 'location': 'Tacoma, WA', } @@ -78,14 +78,21 @@ class TuneInIE(InfoExtractor): for stream in streams: if stream.get('Type') == 'Live': is_live = True + reliability = stream.get('Reliability') + format_note = ( + 'Reliability: %d%%' % reliability + if reliability is not None else None) formats.append({ + 'preference': ( + 0 if reliability is None or reliability > 90 + else 1), 'abr': stream.get('Bandwidth'), - 'ext': stream.get('MediaType'), + 'ext': stream.get('MediaType').lower(), 'acodec': stream.get('MediaType'), 'vcodec': 'none', 'url': stream.get('Url'), - # Sometimes streams with the highest quality do not exist - 'preference': stream.get('Reliability'), + 'source_preference': reliability, + 'format_note': format_note, }) self._sort_formats(formats)