Skip to content

Commit

Permalink
Move output files from transcriber to parent dir
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Jan 28, 2025
1 parent 54a48ce commit af5db14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
12 changes: 11 additions & 1 deletion karaoke_prep/karaoke_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,21 @@ def transcribe_lyrics(self, input_audio_wav, artist, title, track_output_dir):
transcriber_outputs = {}
if results.lrc_filepath:
transcriber_outputs["lrc_filepath"] = results.lrc_filepath
# Move LRC file to parent directory
parent_lrc_path = os.path.join(track_output_dir, f"{artist} - {title} (Karaoke).lrc")
self.logger.info(f"Moving LRC file from {results.lrc_filepath} to {parent_lrc_path}")
shutil.copy2(results.lrc_filepath, parent_lrc_path)

if results.ass_filepath:
transcriber_outputs["ass_filepath"] = results.ass_filepath
# Move video file to parent directory
parent_video_path = os.path.join(track_output_dir, f"{artist} - {title} (With Vocals).mkv")
self.logger.info(f"Moving video file from {results.ass_filepath[:-4]}.mkv to {parent_video_path}")
shutil.copy2(f"{results.ass_filepath[:-4]}.mkv", parent_video_path)

if results.transcription_corrected:
transcriber_outputs["corrected_lyrics_text"] = results.transcription_corrected.corrected_text
transcriber_outputs["corrected_lyrics_text_filepath"] = results.transcription_corrected.filepath
transcriber_outputs["corrected_lyrics_text_filepath"] = results.corrected_txt

if transcriber_outputs:
self.logger.info(f"*** Transcriber Filepath Outputs: ***")
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-prep"
version = "0.38.1"
version = "0.38.2"
description = "Prepare for karaoke video creation, by downloading audio and lyrics for a specified song or playlist from youtube and separating audio stems. After syncing, finalise the video with a title screen!"
authors = ["Andrew Beveridge <[email protected]>"]
license = "MIT"
Expand All @@ -12,7 +12,7 @@ documentation = "https://github.com/karaokenerds/karaoke-prep/blob/main/README.m

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
torch = ">=2.3,<2.5"
torch = ">=2.3,<2.5 || >=2.7"
requests = ">=2"
beautifulsoup4 = ">=4"
yt-dlp = "*"
Expand All @@ -28,7 +28,7 @@ thefuzz = ">=0.22"
numpy = "^1"
audio-separator = { version = ">=0.21.0", extras = ["cpu"] }
lyrics-converter = ">=0.2.1"
lyrics-transcriber = ">=0.32"
lyrics-transcriber = ">=0.34"
kbputils = "^0.0.16"
attrs = ">=24.2.0"
cattrs = ">=24.1.2"
Expand Down

0 comments on commit af5db14

Please sign in to comment.