Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Aug 12, 2024
1 parent 548bbc7 commit 01938f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/subtitle_tutorial_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def main() -> None:
if args.input and args.output:
logging.info(f"Attaching subtitles to {args.input}")
i_strings: List[str] = []
map_strings: List[str] = ["-map" ,"0"]
map_strings: List[str] = ["-map", "0"]
metadata_strings: List[str] = []
for i in range(len(langs)):
in_path = subtitles_path / f"{args.subtitles}.{langs[i]}.srt"
Expand All @@ -137,8 +137,11 @@ def main() -> None:
+ [args.output]
)
logging.info(f"Executing: {exec_command}")
if run(exec_command).returncode == 0:
completed_run = run(exec_command)
if completed_run.returncode == 0:
logging.info(f"Video with subtitles saved to {args.output}")
else:
logging.error("Execution failed.")
else:
logging.info("No -i and -o file paths provided, so ffmpeg was not run.")

Expand Down

0 comments on commit 01938f8

Please sign in to comment.