diff options
author | pukkandan <pukkandan@gmail.com> | 2020-10-26 21:20:09 +0530 |
---|---|---|
committer | pukkandan <pukkandan@gmail.com> | 2020-12-13 20:05:02 +0530 |
commit | eb8a44336c3fbecefa9540794449adfd1b53d32b (patch) | |
tree | 6b4b8336da291bf0e4d76d3ba81500904ce9fef2 /youtube_dlc/YoutubeDL.py | |
parent | 98e248faa49e69d795abc60f7cdefcf91e2612aa (diff) |
Better Format Sorting (Squashed)
* Added --format-sort (-S height,filesize)
* Made fields reversible (-S +height)
* Added --format-sort-force, --no-format-sort-force
* Added limit (-S height:720)
* Added codec preference (-S vcodec,acodec)
* Correct handling of preference<-1000
* Rebased to yt-dlc
* Automatically determine missing bitrates
* aext, vext, protocol, acodec, vcodec can now takes priority as string, not number (-S vext:webm)
* Correct handling of None in codec, audio_codec (None means the codec is unknown while 'none' means it doesn't exist)
* Correctly parse filesize (-S filesize:200M)
* Generalized preference calculation
* Rewrote entire code into the class FormatSort
* Correctly handle user input errors
* Combined fields (-S +ext:webm:webm)
* Closest mode (-S filesize~50M)
* Aliases (framerate=fps, br=bitrate etc)
* Documentation
Diffstat (limited to 'youtube_dlc/YoutubeDL.py')
-rw-r--r-- | youtube_dlc/YoutubeDL.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py index ef6fe0a78..2e74802ee 100644 --- a/youtube_dlc/YoutubeDL.py +++ b/youtube_dlc/YoutubeDL.py @@ -162,7 +162,9 @@ class YoutubeDL(object): dump_single_json: Force printing the info_dict of the whole playlist (or video) as a single JSON line. simulate: Do not download the video files. - format: Video format code. See options.py for more information. + format: Video format code. see "FORMAT SELECTION" for more details. + format_sort: How to sort the video formats. see "Sorting Formats" for more details. + format_sort_force: Force the given format_sort. see "Sorting Formats" for more details. outtmpl: Template for output names. restrictfilenames: Do not allow "&" and spaces in file names. trim_file_name: Limit length of filename (extension excluded). @@ -2305,8 +2307,8 @@ class YoutubeDL(object): [f['format_id'], f['ext'], self.format_resolution(f), self._format_note(f)] for f in formats if f.get('preference') is None or f['preference'] >= -1000] - if len(formats) > 1: - table[-1][-1] += (' ' if table[-1][-1] else '') + '(best)' + # if len(formats) > 1: + # table[-1][-1] += (' ' if table[-1][-1] else '') + '(best)' header_line = ['format code', 'extension', 'resolution', 'note'] self.to_screen( |