-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev-implement-click' into dev
- Loading branch information
Showing
11 changed files
with
178 additions
and
557 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,16 @@ | ||
"""Bulk Audio Export Tool (BAET) is a command line tool for exporting audio tracks from video files in bulk.""" | ||
|
||
import sys | ||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
import rich | ||
from rich.live import Live | ||
from rich.traceback import install | ||
|
||
from . import app_console, configure_logging, create_logger | ||
from .app_args import get_args | ||
from .FFmpeg.extract import MultiTrackAudioBulkExtractor | ||
from BAET.cli.cli import cli | ||
|
||
# Enable rich traceback | ||
install(show_locals=True) | ||
|
||
|
||
def main() -> None: | ||
"""Entry point for BAET.""" | ||
args = get_args() | ||
|
||
if args.debug_options.print_args: | ||
rich.print(args) | ||
sys.exit(0) | ||
|
||
if args.debug_options.logging: | ||
log_path = Path("~/.baet").expanduser() | ||
log_path.mkdir(parents=True, exist_ok=True) | ||
log_file = log_path / f"logs_{datetime.now()}.txt" | ||
log_file.touch() | ||
|
||
configure_logging(enable_logging=True, file_out=log_file) | ||
else: | ||
configure_logging(enable_logging=False, file_out=None) | ||
|
||
logger = create_logger() | ||
extractor = MultiTrackAudioBulkExtractor(args) | ||
|
||
with Live(extractor, console=app_console): | ||
logger.info("Running jobs") | ||
extractor.run_synchronously() | ||
|
||
cli() | ||
sys.exit(0) |
Oops, something went wrong.