diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-09 17:40:24 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-10 01:22:55 +0530 |
commit | ad3dc496bbf2e2a574a16244ddde0740778e5daf (patch) | |
tree | f4eeaf0711946c1181ce1769c33d8ff94c3847cd /yt_dlp/options.py | |
parent | 2831b4686c2436cd151260539e010ce3577911cc (diff) | |
download | hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.tar.lz hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.tar.xz hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.zip |
Misc fixes - See desc
* Remove unnecessary uses of _list_from_options_callback
* Fix download tests - Bug from 6e84b21559f586ee4d6affb61688d5c6a0c21221
* Rename ExecAfterDownloadPP to ExecPP and refactor its tests
* Ensure _write_ytdl_file closes file handle on error - Potential fix for #517
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r-- | yt_dlp/options.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py index f8cfdeb12..f2d5deb68 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -23,7 +23,7 @@ from .cookies import SUPPORTED_BROWSERS from .version import __version__ from .downloader.external import list_external_downloaders -from .postprocessor.ffmpeg import ( +from .postprocessor import ( FFmpegExtractAudioPP, FFmpegSubtitlesConvertorPP, FFmpegThumbnailsConvertorPP, @@ -803,9 +803,8 @@ def parseOpts(overrideArguments=None): action='store_true', dest='skip_download', default=False, help='Do not download the video but write all related files (Alias: --no-download)') verbosity.add_option( - '-O', '--print', metavar='TEMPLATE', - action='callback', dest='forceprint', type='str', default=[], - callback=_list_from_options_callback, callback_kwargs={'delim': None}, + '-O', '--print', + metavar='TEMPLATE', action='append', dest='forceprint', help=( 'Quiet, but print the given fields for each video. Simulate unless --no-simulate is used. ' 'Either a field name or same syntax as the output template can be used')) @@ -1276,8 +1275,7 @@ def parseOpts(overrideArguments=None): help='Location of the ffmpeg binary; either the path to the binary or its containing directory') postproc.add_option( '--exec', metavar='CMD', - action='callback', dest='exec_cmd', default=[], type='str', - callback=_list_from_options_callback, callback_kwargs={'delim': None}, + action='append', dest='exec_cmd', help=( 'Execute a command on the file after downloading and post-processing. ' 'Same syntax as the output template can be used to pass any field as arguments to the command. ' @@ -1290,8 +1288,7 @@ def parseOpts(overrideArguments=None): help='Remove any previously defined --exec') postproc.add_option( '--exec-before-download', metavar='CMD', - action='callback', dest='exec_before_dl_cmd', default=[], type='str', - callback=_list_from_options_callback, callback_kwargs={'delim': None}, + action='append', dest='exec_before_dl_cmd', help=( 'Execute a command before the actual download. ' 'The syntax is the same as --exec but "filepath" is not available. ' |