mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-11 03:09:35 +00:00
Add field name
for subtitles
Co-authored by: pukkandan, tpikonen Based on: #310, https://github.com/ytdl-org/youtube-dl/pull/26112
This commit is contained in:
@@ -3005,10 +3005,17 @@ class YoutubeDL(object):
|
||||
return
|
||||
self.to_screen(
|
||||
'Available %s for %s:' % (name, video_id))
|
||||
|
||||
def _row(lang, formats):
|
||||
exts, names = zip(*((f['ext'], f['name']) for f in reversed(formats)))
|
||||
if len(set(names)) == 1:
|
||||
names = names[:1]
|
||||
return [lang, ', '.join(names), ', '.join(exts)]
|
||||
|
||||
self.to_screen(render_table(
|
||||
['Language', 'formats'],
|
||||
[[lang, ', '.join(f['ext'] for f in reversed(formats))]
|
||||
for lang, formats in subtitles.items()]))
|
||||
['Language', 'Name', 'Formats'],
|
||||
[_row(lang, formats) for lang, formats in subtitles.items()],
|
||||
hideEmpty=True))
|
||||
|
||||
def urlopen(self, req):
|
||||
""" Start an HTTP download """
|
||||
|
Reference in New Issue
Block a user