mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 01:02:48 +01:00
[YoutubeDL] use the 'render_table' function for listing the subtitles
This commit is contained in:
parent
9868ea4936
commit
edab9dbf4d
@ -1659,13 +1659,12 @@ def list_subtitles(self, video_id, subtitles, name='subtitles'):
|
|||||||
if not subtitles:
|
if not subtitles:
|
||||||
self.to_screen('%s has no %s' % (video_id, name))
|
self.to_screen('%s has no %s' % (video_id, name))
|
||||||
return
|
return
|
||||||
header_line = 'Language formats'
|
|
||||||
sub_lines = [
|
|
||||||
'%-12s%s' % (lang, ', '.join(f['ext'] for f in reversed(formats)))
|
|
||||||
for lang, formats in subtitles.items()]
|
|
||||||
self.to_screen(
|
self.to_screen(
|
||||||
'Available %s for %s:\n%s\n%s' %
|
'Available %s for %s:' % (name, video_id))
|
||||||
(name, video_id, header_line, '\n'.join(sub_lines)))
|
self.to_screen(render_table(
|
||||||
|
['Language', 'formats'],
|
||||||
|
[[lang, ', '.join(f['ext'] for f in reversed(formats))]
|
||||||
|
for lang, formats in subtitles.items()]))
|
||||||
|
|
||||||
def urlopen(self, req):
|
def urlopen(self, req):
|
||||||
""" Start an HTTP download """
|
""" Start an HTTP download """
|
||||||
|
Loading…
Reference in New Issue
Block a user