From 54b581c60dc92f70ecc1bbce1543ba5456270c52 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 17 Nov 2020 18:00:57 +0530 Subject: [PATCH] flake8 and --list-formats-old --- youtube_dlc/YoutubeDL.py | 14 +++++++------- youtube_dlc/options.py | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py index ea55b36ea..d1a0c6484 100644 --- a/youtube_dlc/YoutubeDL.py +++ b/youtube_dlc/YoutubeDL.py @@ -2289,16 +2289,16 @@ class YoutubeDL(object): res += ', ' res += '~' + format_bytes(fdict['filesize_approx']) return res - + def _format_note_table(self, f): def join_fields(*vargs): return ', '.join((val for val in vargs if val != '')) return join_fields( 'UNSUPPORTED' if f.get('ext') in ('f4f', 'f4m') else '', - format_field(f, 'language', '[%s]'), - format_field(f, 'format_note'), - format_field(f, 'container', ignore=(None, f.get('ext'))), + format_field(f, 'language', '[%s]'), + format_field(f, 'format_note'), + format_field(f, 'container', ignore=(None, f.get('ext'))), format_field(f, 'asr', '%5dHz')) def list_formats(self, info_dict): @@ -2307,10 +2307,10 @@ class YoutubeDL(object): if new_format: table = [ [ - format_field(f, 'format_id'), + format_field(f, 'format_id'), format_field(f, 'ext'), self.format_resolution(f), - format_field(f, 'fps', '%d'), + format_field(f, 'fps', '%d'), '|', format_field(f, 'filesize', ' %s', func=format_bytes) + format_field(f, 'filesize_approx', '~%s', func=format_bytes), format_field(f, 'tbr', '%4dk'), @@ -2324,7 +2324,7 @@ class YoutubeDL(object): self._format_note_table(f)] for f in formats if f.get('preference') is None or f['preference'] >= -1000] - header_line = ['ID', 'EXT', 'RESOLUTION', 'FPS', '|', ' FILESIZE', ' TBR', 'PROTO', + header_line = ['ID', 'EXT', 'RESOLUTION', 'FPS', '|', ' FILESIZE', ' TBR', 'PROTO', '|', 'VIDEO CODEC', ' VBR', 'AUDIO CODEC', ' ABR', ' ASR', 'NOTE'] else: table = [ diff --git a/youtube_dlc/options.py b/youtube_dlc/options.py index 1478fb79a..407c65e2f 100644 --- a/youtube_dlc/options.py +++ b/youtube_dlc/options.py @@ -414,6 +414,10 @@ def parseOpts(overrideArguments=None): '--list-formats-as-table', action='store_true', dest='listformats_table', default=False, help='Present the output of -F in a more tabular form') + video_format.add_option( + '--list-formats-old', + action='store_false', dest='listformats_table' + help=optparse.SUPPRESS_HELP) video_format.add_option( '--youtube-include-dash-manifest', action='store_true', dest='youtube_include_dash_manifest', default=True,