[downloader/f4m] Simply select format when it's the only one

pull/9606/merge
Sergey M․ 2016-05-27 01:46:12 +06:00
parent fac2af3c51
commit 2615fa7584
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ class F4mFD(FragmentFD):
doc = compat_etree_fromstring(manifest)
formats = [(int(f.attrib.get('bitrate', -1)), f)
for f in self._get_unencrypted_media(doc)]
if requested_bitrate is None:
if requested_bitrate is None or len(formats) == 1:
# get the best format
formats = sorted(formats, key=lambda f: f[0])
rate, media = formats[-1]