mirror of
https://github.com/Steffo99/bbbdl.git
synced 2024-11-22 07:44:18 +00:00
✨ Add debug option to print compiled command
This commit is contained in:
parent
2238642ad3
commit
4bab3197f9
1 changed files with 8 additions and 2 deletions
|
@ -21,7 +21,9 @@ def main():
|
||||||
help="Overwrite existing files instead of skipping them.")
|
help="Overwrite existing files instead of skipping them.")
|
||||||
@click.option("-v", "--verbose-ffmpeg", is_flag=True,
|
@click.option("-v", "--verbose-ffmpeg", is_flag=True,
|
||||||
help="Print ffmpeg info to stderr.")
|
help="Print ffmpeg info to stderr.")
|
||||||
def download(input_url, output_file, overwrite=False, verbose_ffmpeg=False):
|
@click.option("-D", "--debug", is_flag=True,
|
||||||
|
help="Print the compiled ffmpeg command to stdout instead of running it.")
|
||||||
|
def download(input_url, output_file, overwrite=False, verbose_ffmpeg=False, debug=False):
|
||||||
if not overwrite and os.path.exists(output_file):
|
if not overwrite and os.path.exists(output_file):
|
||||||
raise click.ClickException(f"Output file already exists: {output_file}")
|
raise click.ClickException(f"Output file already exists: {output_file}")
|
||||||
|
|
||||||
|
@ -29,9 +31,13 @@ def download(input_url, output_file, overwrite=False, verbose_ffmpeg=False):
|
||||||
|
|
||||||
click.secho(f"Downloading: {input_url} -> {output_file}", err=True, fg="green")
|
click.secho(f"Downloading: {input_url} -> {output_file}", err=True, fg="green")
|
||||||
streams = compose_lesson(meeting)
|
streams = compose_lesson(meeting)
|
||||||
|
|
||||||
output = ffmpeg.output(*streams, output_file)
|
output = ffmpeg.output(*streams, output_file)
|
||||||
|
|
||||||
output.run(quiet=not verbose_ffmpeg, overwrite_output=True)
|
if debug:
|
||||||
|
click.echo(" ".join(output.compile()))
|
||||||
|
else:
|
||||||
|
output.run(quiet=not verbose_ffmpeg, overwrite_output=True)
|
||||||
|
|
||||||
|
|
||||||
@main.command()
|
@main.command()
|
||||||
|
|
Loading…
Reference in a new issue