mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-09 10:50:38 +00:00
[cleanup] Refactor __init__.py
(#2570)
* Split `__init__` code into multiple functions * Clean up validation code by grouping similar types of options * Expose `parse_options` to third parties
This commit is contained in:
parent
1eae7f94c1
commit
d1b5f70bc9
File diff suppressed because it is too large
Load Diff
@ -1182,7 +1182,7 @@ def create_parser():
|
||||
help='Do not write video description (default)')
|
||||
filesystem.add_option(
|
||||
'--write-info-json',
|
||||
action='store_true', dest='writeinfojson', default=False,
|
||||
action='store_true', dest='writeinfojson', default=None,
|
||||
help='Write video metadata to a .info.json file (this may contain personal information)')
|
||||
filesystem.add_option(
|
||||
'--no-write-info-json',
|
||||
|
@ -404,7 +404,7 @@ class FFmpegPostProcessor(PostProcessor):
|
||||
|
||||
class FFmpegExtractAudioPP(FFmpegPostProcessor):
|
||||
COMMON_AUDIO_EXTS = ('wav', 'flac', 'm4a', 'aiff', 'mp3', 'ogg', 'mka', 'opus', 'wma')
|
||||
SUPPORTED_EXTS = ('best', 'aac', 'flac', 'mp3', 'm4a', 'opus', 'vorbis', 'wav', 'alac')
|
||||
SUPPORTED_EXTS = ('aac', 'flac', 'mp3', 'm4a', 'opus', 'vorbis', 'wav', 'alac')
|
||||
|
||||
def __init__(self, downloader=None, preferredcodec=None, preferredquality=None, nopostoverwrites=False):
|
||||
FFmpegPostProcessor.__init__(self, downloader)
|
||||
|
@ -3603,6 +3603,9 @@ def match_str(filter_str, dct, incomplete=False):
|
||||
|
||||
|
||||
def match_filter_func(filter_str):
|
||||
if filter_str is None:
|
||||
return None
|
||||
|
||||
def _match_func(info_dict, *args, **kwargs):
|
||||
if match_str(filter_str, info_dict, *args, **kwargs):
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user