@staticmethod
def format_resolution(format, default='unknown'):
+ if format.get('vcodec') == 'none':
+ return 'audio only'
if format.get('_resolution') is not None:
return format['_resolution']
if format.get('height') is not None:
res = u''
if fdict.get('format_note') is not None:
res += fdict['format_note'] + u' '
- if fdict.get('vcodec') is not None:
+ if (fdict.get('vcodec') is not None and
+ fdict.get('vcodec') != 'none'):
res += u'%-5s' % fdict['vcodec']
elif fdict.get('vbr') is not None:
res += u'video'
'format_id': 'download',
'ext': ext,
'url': format_url,
+ 'vcodec': 'none',
}]
else:
# We have to retrieve the url
'format_id': key,
'ext': ext,
'url': stream_url,
+ 'vcodec': 'none',
})
elif key.startswith(u'rtmp'):
# The url doesn't have an rtmp app, we have to extract the playpath
'url': url,
'play_path': 'mp3:' + path,
'ext': ext,
+ 'vcodec': 'none',
})
if not formats:
'format_id': u'fallback',
'url': info['stream_url'] + '?client_id=' + self._CLIENT_ID,
'ext': ext,
+ 'vcodec': 'none',
})
def format_pref(f):