mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-30 09:14:03 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b17440fd21 | ||
|
|
08b8abf27d | ||
|
|
1b62b396cb | ||
|
|
f249a841e1 | ||
|
|
0f8eb3f6d4 | ||
|
|
586763ae5f | ||
|
|
6092a67ef4 | ||
|
|
951b64eaf5 | ||
|
|
78f7412d2d | ||
|
|
ef54ba9dc5 | ||
|
|
481a57e0e1 | ||
|
|
af5db142ef | ||
|
|
54a48cef39 | ||
|
|
1663f229a3 | ||
|
|
87ed4799e5 | ||
|
|
a7a96f2f4b | ||
|
|
07ee85b304 | ||
|
|
595fbbc4e2 | ||
|
|
dfdbd92269 | ||
|
|
78f8880922 | ||
|
|
17be398a0f | ||
|
|
ee9958bfe9 | ||
|
|
fc5eabb588 | ||
|
|
4883a93603 | ||
|
|
5d8b697c61 | ||
|
|
94ea24bfea | ||
|
|
42fc646954 | ||
|
|
bd6db70bcf | ||
|
|
242c1e03ac | ||
|
|
ade7c40af7 | ||
|
|
162faa9189 | ||
|
|
7ad1ae8305 | ||
|
|
7852619403 | ||
|
|
ddb70a9c31 | ||
|
|
f9336590fa | ||
|
|
4151650a90 | ||
|
|
2c1e9f38f7 | ||
|
|
164b0309ab | ||
|
|
ca080e53a0 | ||
|
|
7776365c80 | ||
|
|
ef3a2dfbe5 | ||
|
|
1b26fe9a46 | ||
|
|
e6b475fc5c | ||
|
|
ff98d4d191 | ||
|
|
df9d1053df | ||
|
|
0618574cbf | ||
|
|
1028c26a59 | ||
|
|
49982b4ad4 | ||
|
|
a9291e97a1 | ||
|
|
d96b844962 | ||
|
|
5d5cb86494 |
No files matched your search
@@ -0,0 +1,28 @@
|
||||
2384d2383
|
||||
< triton = ">=2.0.0,<3"
|
||||
4185d4183
|
||||
< triton = {version = "2.3.1", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.12\""}
|
||||
4318,4340d4315
|
||||
< name = "triton"
|
||||
< version = "2.3.1"
|
||||
< description = "A language and compiler for custom Deep Learning operations"
|
||||
< optional = false
|
||||
< python-versions = "*"
|
||||
< files = [
|
||||
< {file = "triton-2.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c84595cbe5e546b1b290d2a58b1494df5a2ef066dd890655e5b8a8a92205c33"},
|
||||
< {file = "triton-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9d64ae33bcb3a7a18081e3a746e8cf87ca8623ca13d2c362413ce7a486f893e"},
|
||||
< {file = "triton-2.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaf80e8761a9e3498aa92e7bf83a085b31959c61f5e8ac14eedd018df6fccd10"},
|
||||
< {file = "triton-2.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b13bf35a2b659af7159bf78e92798dc62d877aa991de723937329e2d382f1991"},
|
||||
< {file = "triton-2.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63381e35ded3304704ea867ffde3b7cfc42c16a55b3062d41e017ef510433d66"},
|
||||
< {file = "triton-2.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d968264523c7a07911c8fb51b4e0d1b920204dae71491b1fe7b01b62a31e124"},
|
||||
< ]
|
||||
<
|
||||
< [package.dependencies]
|
||||
< filelock = "*"
|
||||
<
|
||||
< [package.extras]
|
||||
< build = ["cmake (>=3.20)", "lit"]
|
||||
< tests = ["autopep8", "flake8", "isort", "numpy", "pytest", "scipy (>=1.7.1)", "torch"]
|
||||
< tutorials = ["matplotlib", "pandas", "tabulate", "torch"]
|
||||
<
|
||||
< [[package]]
|
||||
@@ -1,11 +1,14 @@
|
||||
# Andrew env
|
||||
.DS_Store
|
||||
.vscode
|
||||
*.csv
|
||||
*.mp3
|
||||
|
||||
# Andrew functional adds
|
||||
audio/
|
||||
lyrics/
|
||||
karaoke/
|
||||
tests/outputs
|
||||
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
|
||||
@@ -16,6 +16,10 @@ from google.auth.transport.requests import Request
|
||||
from googleapiclient.http import MediaFileUpload
|
||||
import subprocess
|
||||
import time
|
||||
from google.oauth2.credentials import Credentials
|
||||
import base64
|
||||
from email.mime.text import MIMEText
|
||||
from lyrics_transcriber.output.cdg import CDGGenerator
|
||||
|
||||
|
||||
class KaraokeFinalise:
|
||||
@@ -36,6 +40,9 @@ class KaraokeFinalise:
|
||||
youtube_description_file=None,
|
||||
rclone_destination=None,
|
||||
discord_webhook_url=None,
|
||||
email_template_file=None,
|
||||
cdg_styles=None,
|
||||
keep_brand_code=False,
|
||||
non_interactive=False,
|
||||
):
|
||||
self.logger = logging.getLogger(__name__)
|
||||
@@ -97,12 +104,16 @@ class KaraokeFinalise:
|
||||
"end_jpg": " (End).jpg",
|
||||
"with_vocals_mov": " (With Vocals).mov",
|
||||
"with_vocals_mp4": " (With Vocals).mp4",
|
||||
"with_vocals_mkv": " (With Vocals).mkv",
|
||||
"karaoke_lrc": " (Karaoke).lrc",
|
||||
"karaoke_cdg": " (Karaoke).cdg",
|
||||
"karaoke_txt": " (Karaoke).txt",
|
||||
"karaoke_mp3": " (Karaoke).mp3",
|
||||
"karaoke_mov": " (Karaoke).mov",
|
||||
"final_karaoke_mp4": " (Final Karaoke).mp4",
|
||||
"karaoke_mp4": " (Karaoke).mp4",
|
||||
"final_karaoke_lossless_mp4": " (Final Karaoke Lossless 4k).mp4",
|
||||
"final_karaoke_lossless_mkv": " (Final Karaoke Lossless 4k).mkv",
|
||||
"final_karaoke_lossy_mp4": " (Final Karaoke Lossy 4k).mp4",
|
||||
"final_karaoke_lossy_720p_mp4": " (Final Karaoke Lossy 720p).mp4",
|
||||
"final_karaoke_cdg_zip": " (Final Karaoke CDG).zip",
|
||||
"final_karaoke_txt_zip": " (Final Karaoke TXT).zip",
|
||||
}
|
||||
@@ -115,6 +126,20 @@ class KaraokeFinalise:
|
||||
self.new_brand_code_dir_path = None
|
||||
self.brand_code_dir_sharing_link = None
|
||||
|
||||
self.email_template_file = email_template_file
|
||||
self.gmail_service = None
|
||||
|
||||
self.cdg_styles = cdg_styles
|
||||
|
||||
# Determine best available AAC codec
|
||||
self.aac_codec = self.detect_best_aac_codec()
|
||||
|
||||
self.keep_brand_code = keep_brand_code
|
||||
|
||||
# Update ffmpeg base command to include -y if non-interactive
|
||||
if self.non_interactive:
|
||||
self.ffmpeg_base_command += " -y"
|
||||
|
||||
def check_input_files_exist(self, base_name, with_vocals_file, instrumental_audio_file):
|
||||
self.logger.info(f"Checking required input files exist...")
|
||||
|
||||
@@ -130,12 +155,7 @@ class KaraokeFinalise:
|
||||
"end_jpg": f"{base_name}{self.suffixes['end_jpg']}",
|
||||
}
|
||||
|
||||
if self.enable_cdg:
|
||||
input_files["karaoke_cdg"] = f"{base_name}{self.suffixes['karaoke_cdg']}"
|
||||
input_files["karaoke_mp3"] = f"{base_name}{self.suffixes['karaoke_mp3']}"
|
||||
|
||||
if self.enable_txt:
|
||||
input_files["karaoke_mp3"] = f"{base_name}{self.suffixes['karaoke_mp3']}"
|
||||
if self.enable_cdg or self.enable_txt:
|
||||
input_files["karaoke_lrc"] = f"{base_name}{self.suffixes['karaoke_lrc']}"
|
||||
|
||||
for key, file_path in input_files.items():
|
||||
@@ -155,9 +175,13 @@ class KaraokeFinalise:
|
||||
|
||||
def prepare_output_filenames(self, base_name):
|
||||
output_files = {
|
||||
"karaoke_mov": f"{base_name}{self.suffixes['karaoke_mov']}",
|
||||
"karaoke_mp4": f"{base_name}{self.suffixes['karaoke_mp4']}",
|
||||
"karaoke_mp3": f"{base_name}{self.suffixes['karaoke_mp3']}",
|
||||
"with_vocals_mp4": f"{base_name}{self.suffixes['with_vocals_mp4']}",
|
||||
"final_karaoke_mp4": f"{base_name}{self.suffixes['final_karaoke_mp4']}",
|
||||
"final_karaoke_lossless_mp4": f"{base_name}{self.suffixes['final_karaoke_lossless_mp4']}",
|
||||
"final_karaoke_lossless_mkv": f"{base_name}{self.suffixes['final_karaoke_lossless_mkv']}",
|
||||
"final_karaoke_lossy_mp4": f"{base_name}{self.suffixes['final_karaoke_lossy_mp4']}",
|
||||
"final_karaoke_lossy_720p_mp4": f"{base_name}{self.suffixes['final_karaoke_lossy_720p_mp4']}",
|
||||
}
|
||||
|
||||
if self.enable_cdg:
|
||||
@@ -170,13 +194,17 @@ class KaraokeFinalise:
|
||||
return output_files
|
||||
|
||||
def prompt_user_confirmation_or_raise_exception(self, prompt_message, exit_message, allow_empty=False):
|
||||
if self.non_interactive:
|
||||
self.logger.info(f"Non-interactive mode, automatically confirming: {prompt_message}")
|
||||
return True
|
||||
|
||||
if not self.prompt_user_bool(prompt_message, allow_empty=allow_empty):
|
||||
self.logger.error(exit_message)
|
||||
raise Exception(exit_message)
|
||||
|
||||
def prompt_user_bool(self, prompt_message, allow_empty=False):
|
||||
if self.non_interactive:
|
||||
self.logger.warning(f"Non-interactive mode, responding True for prompt: {prompt_message}")
|
||||
self.logger.info(f"Non-interactive mode, automatically answering yes to: {prompt_message}")
|
||||
return True
|
||||
|
||||
options_string = "[y]/n" if allow_empty else "y/[n]"
|
||||
@@ -266,11 +294,11 @@ class KaraokeFinalise:
|
||||
def authenticate_youtube(self):
|
||||
"""Authenticate and return a YouTube service object."""
|
||||
credentials = None
|
||||
pickle_file = "/tmp/karaoke-finalise-token.pickle"
|
||||
youtube_token_file = "/tmp/karaoke-finalise-youtube-token.pickle"
|
||||
|
||||
# Token file stores the user's access and refresh tokens.
|
||||
if os.path.exists(pickle_file):
|
||||
with open(pickle_file, "rb") as token:
|
||||
# Token file stores the user's access and refresh tokens for YouTube.
|
||||
if os.path.exists(youtube_token_file):
|
||||
with open(youtube_token_file, "rb") as token:
|
||||
credentials = pickle.load(token)
|
||||
|
||||
# If there are no valid credentials, let the user log in.
|
||||
@@ -284,7 +312,7 @@ class KaraokeFinalise:
|
||||
credentials = flow.run_local_server(port=0) # This will open a browser for authentication
|
||||
|
||||
# Save the credentials for the next run
|
||||
with open(pickle_file, "wb") as token:
|
||||
with open(youtube_token_file, "wb") as token:
|
||||
pickle.dump(credentials, token)
|
||||
|
||||
return build("youtube", "v3", credentials=credentials)
|
||||
@@ -340,10 +368,10 @@ class KaraokeFinalise:
|
||||
return truncated_title
|
||||
|
||||
def upload_final_mp4_to_youtube_with_title_thumbnail(self, artist, title, input_files, output_files):
|
||||
self.logger.info(f"Uploading final MP4 to YouTube with title thumbnail...")
|
||||
self.logger.info(f"Uploading final MKV to YouTube with title thumbnail...")
|
||||
if self.dry_run:
|
||||
self.logger.info(
|
||||
f'DRY RUN: Would upload {output_files["final_karaoke_mp4"]} to YouTube with thumbnail {input_files["title_jpg"]} using client secrets file: {self.youtube_client_secrets_file}'
|
||||
f'DRY RUN: Would upload {output_files["final_karaoke_lossless_mkv"]} to YouTube with thumbnail {input_files["title_jpg"]} using client secrets file: {self.youtube_client_secrets_file}'
|
||||
)
|
||||
else:
|
||||
youtube_title = f"{artist} - {title} (Karaoke)"
|
||||
@@ -378,11 +406,11 @@ class KaraokeFinalise:
|
||||
"status": {"privacyStatus": "public"},
|
||||
}
|
||||
|
||||
# Use MediaFileUpload to handle the video file
|
||||
media_file = MediaFileUpload(output_files["final_karaoke_mp4"], mimetype="video/mp4", resumable=True)
|
||||
# Use MediaFileUpload to handle the video file - using the MKV with FLAC audio
|
||||
media_file = MediaFileUpload(output_files["final_karaoke_lossless_mkv"], mimetype="video/x-matroska", resumable=True)
|
||||
|
||||
# Call the API's videos.insert method to create and upload the video.
|
||||
self.logger.info(f"Uploading final MP4 to YouTube...")
|
||||
self.logger.info(f"Uploading final MKV to YouTube...")
|
||||
request = youtube.videos().insert(part="snippet,status", body=body, media_body=media_file)
|
||||
response = request.execute()
|
||||
|
||||
@@ -426,54 +454,68 @@ class KaraokeFinalise:
|
||||
self.logger.info("Message posted to Discord")
|
||||
|
||||
def find_with_vocals_file(self):
|
||||
self.logger.info("Finding input file in current directory ending (With Vocals).mov or (With Vocals).mp4")
|
||||
self.logger.info("Finding input file ending in (With Vocals).mov/.mp4/.mkv or (Karaoke).mov/.mp4/.mkv")
|
||||
|
||||
with_vocals_files = [f for f in os.listdir(".") if self.suffixes["with_vocals_mov"] in f]
|
||||
# Define all possible suffixes for with vocals files
|
||||
with_vocals_suffixes = [
|
||||
self.suffixes["with_vocals_mov"],
|
||||
self.suffixes["with_vocals_mp4"],
|
||||
self.suffixes["with_vocals_mkv"],
|
||||
]
|
||||
|
||||
if not with_vocals_files:
|
||||
self.logger.info(f"No with vocals MOV file found, looking for with vocals MP4 file instead")
|
||||
# First try to find a properly named with vocals file in any supported format
|
||||
with_vocals_files = [f for f in os.listdir(".") if any(f.endswith(suffix) for suffix in with_vocals_suffixes)]
|
||||
|
||||
with_vocals_files = [f for f in os.listdir(".") if self.suffixes["with_vocals_mp4"] in f]
|
||||
if with_vocals_files:
|
||||
self.logger.info(f"Found with vocals MP4 file: {with_vocals_files[0]}")
|
||||
return with_vocals_files[0]
|
||||
if with_vocals_files:
|
||||
self.logger.info(f"Found with vocals file: {with_vocals_files[0]}")
|
||||
return with_vocals_files[0]
|
||||
|
||||
if not with_vocals_files:
|
||||
karaoke_files = [f for f in os.listdir(".") if self.suffixes["karaoke_mov"] in f]
|
||||
if karaoke_files:
|
||||
for file in karaoke_files:
|
||||
new_file = file.replace(self.suffixes["karaoke_mov"], self.suffixes["with_vocals_mov"])
|
||||
# If no with vocals file found, look for potentially misnamed karaoke files
|
||||
karaoke_suffixes = [" (Karaoke).mov", " (Karaoke).mp4", " (Karaoke).mkv"]
|
||||
karaoke_files = [f for f in os.listdir(".") if any(f.endswith(suffix) for suffix in karaoke_suffixes)]
|
||||
|
||||
self.prompt_user_confirmation_or_raise_exception(
|
||||
f"Found '{file}' but no '(With Vocals)', rename to {new_file} for vocal input?",
|
||||
"Unable to proceed without With Vocals file or user confirmation of rename.",
|
||||
allow_empty=True,
|
||||
)
|
||||
if karaoke_files:
|
||||
for file in karaoke_files:
|
||||
# Get the current extension
|
||||
current_ext = os.path.splitext(file)[1]
|
||||
base_without_suffix = file.replace(f" (Karaoke){current_ext}", "")
|
||||
new_file = f"{base_without_suffix}{self.suffixes[f'with_vocals{current_ext[1:]}']}"
|
||||
|
||||
os.rename(file, new_file)
|
||||
self.logger.info(f"Renamed '{file}' to '{new_file}'")
|
||||
return new_file
|
||||
else:
|
||||
raise Exception("No suitable files found for processing.")
|
||||
else:
|
||||
return with_vocals_files[0] # Assuming only one such file is expected
|
||||
self.prompt_user_confirmation_or_raise_exception(
|
||||
f"Found '{file}' but no '(With Vocals)', rename to {new_file} for vocal input?",
|
||||
"Unable to proceed without With Vocals file or user confirmation of rename.",
|
||||
allow_empty=True,
|
||||
)
|
||||
|
||||
os.rename(file, new_file)
|
||||
self.logger.info(f"Renamed '{file}' to '{new_file}'")
|
||||
return new_file
|
||||
|
||||
raise Exception("No suitable files found for processing.")
|
||||
|
||||
def choose_instrumental_audio_file(self, base_name):
|
||||
self.logger.info(f"Choosing instrumental audio file to use as karaoke audio...")
|
||||
|
||||
search_string = " (Instrumental "
|
||||
search_string = " (Instrumental"
|
||||
self.logger.info(f"Searching for files in current directory containing {search_string}")
|
||||
|
||||
all_instrumental_files = [f for f in os.listdir(".") if search_string in f]
|
||||
flac_files = set(f.rsplit(".", 1)[0] for f in all_instrumental_files if f.endswith(".flac"))
|
||||
mp3_files = set(f.rsplit(".", 1)[0] for f in all_instrumental_files if f.endswith(".mp3"))
|
||||
wav_files = set(f.rsplit(".", 1)[0] for f in all_instrumental_files if f.endswith(".wav"))
|
||||
|
||||
self.logger.debug(f"FLAC files found: {flac_files}")
|
||||
self.logger.debug(f"MP3 files found: {mp3_files}")
|
||||
self.logger.debug(f"WAV files found: {wav_files}")
|
||||
|
||||
# Filter out MP3 files if their FLAC counterpart exists
|
||||
# Filter out MP3 files if their FLAC or WAV counterpart exists
|
||||
# Filter out WAV files if their FLAC counterpart exists
|
||||
filtered_files = [
|
||||
f for f in all_instrumental_files if f.endswith(".flac") or (f.endswith(".mp3") and f.rsplit(".", 1)[0] not in flac_files)
|
||||
f
|
||||
for f in all_instrumental_files
|
||||
if f.endswith(".flac")
|
||||
or (f.endswith(".wav") and f.rsplit(".", 1)[0] not in flac_files)
|
||||
or (f.endswith(".mp3") and f.rsplit(".", 1)[0] not in flac_files and f.rsplit(".", 1)[0] not in wav_files)
|
||||
]
|
||||
|
||||
self.logger.debug(f"Filtered instrumental files: {filtered_files}")
|
||||
@@ -484,6 +526,11 @@ class KaraokeFinalise:
|
||||
if len(filtered_files) == 1:
|
||||
return filtered_files[0]
|
||||
|
||||
# In non-interactive mode, always choose the first option
|
||||
if self.non_interactive:
|
||||
self.logger.info(f"Non-interactive mode, automatically choosing first instrumental file: {filtered_files[0]}")
|
||||
return filtered_files[0]
|
||||
|
||||
# Sort the remaining instrumental options alphabetically
|
||||
filtered_files.sort(reverse=True)
|
||||
|
||||
@@ -509,7 +556,18 @@ class KaraokeFinalise:
|
||||
def get_names_from_withvocals(self, with_vocals_file):
|
||||
self.logger.info(f"Getting artist and title from {with_vocals_file}")
|
||||
|
||||
base_name = with_vocals_file.replace(self.suffixes["with_vocals_mov"], "").replace(self.suffixes["with_vocals_mp4"], "")
|
||||
# Remove both possible suffixes and their extensions
|
||||
base_name = with_vocals_file
|
||||
for suffix_key in ["with_vocals_mov", "with_vocals_mp4", "with_vocals_mkv"]:
|
||||
suffix = self.suffixes[suffix_key]
|
||||
if suffix in base_name:
|
||||
base_name = base_name.replace(suffix, "")
|
||||
break
|
||||
|
||||
# If we didn't find a match above, try removing just the extension
|
||||
if base_name == with_vocals_file:
|
||||
base_name = os.path.splitext(base_name)[0]
|
||||
|
||||
artist, title = base_name.split(" - ", 1)
|
||||
return base_name, artist, title
|
||||
|
||||
@@ -521,27 +579,97 @@ class KaraokeFinalise:
|
||||
self.logger.info(f"Running command: {command}")
|
||||
os.system(command)
|
||||
|
||||
def remux_with_instrumental(self, with_vocals_file, instrumental_audio, output_file):
|
||||
"""Remux the video with instrumental audio to create karaoke version"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f'{self.ffmpeg_base_command} -an -i "{with_vocals_file}" '
|
||||
f'-vn -i "{instrumental_audio}" -c:v copy -c:a pcm_s16le "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Remuxing video with instrumental audio")
|
||||
|
||||
def convert_mov_to_mp4(self, input_file, output_file):
|
||||
"""Convert MOV file to MP4 format"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f'{self.ffmpeg_base_command} -i "{input_file}" '
|
||||
f'-c:v libx264 -c:a {self.aac_codec} "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Converting MOV video to MP4")
|
||||
|
||||
def encode_lossless_mp4(self, title_mov_file, karaoke_mp4_file, env_mov_input, ffmpeg_filter, output_file):
|
||||
"""Create the final MP4 with PCM audio (lossless)"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f"{self.ffmpeg_base_command} -i {title_mov_file} -i {karaoke_mp4_file} {env_mov_input} "
|
||||
f'{ffmpeg_filter} -map "[outv]" -map "[outa]" -c:v libx264 -c:a pcm_s16le "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Creating MP4 version with PCM audio")
|
||||
|
||||
def encode_lossy_mp4(self, input_file, output_file):
|
||||
"""Create MP4 with AAC audio (lossy, for wider compatibility)"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f'{self.ffmpeg_base_command} -i "{input_file}" '
|
||||
f'-c:v copy -c:a {self.aac_codec} -b:a 320k "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Creating MP4 version with AAC audio")
|
||||
|
||||
def encode_lossless_mkv(self, input_file, output_file):
|
||||
"""Create MKV with FLAC audio (for YouTube)"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f'{self.ffmpeg_base_command} -i "{input_file}" '
|
||||
f'-c:v copy -c:a flac "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Creating MKV version with FLAC audio for YouTube")
|
||||
|
||||
def encode_720p_version(self, input_file, output_file):
|
||||
"""Create 720p MP4 with AAC audio (for smaller file size)"""
|
||||
# fmt: off
|
||||
ffmpeg_command = (
|
||||
f'{self.ffmpeg_base_command} -i "{input_file}" '
|
||||
f'-c:v libx264 -vf "scale=1280:720" -b:v 200k -preset medium -tune animation '
|
||||
f'-c:a {self.aac_codec} -b:a 128k "{output_file}"'
|
||||
)
|
||||
# fmt: on
|
||||
self.execute_command(ffmpeg_command, "Encoding 720p version of the final video")
|
||||
|
||||
def prepare_concat_filter(self, input_files):
|
||||
"""Prepare the concat filter and additional input for end credits if present"""
|
||||
env_mov_input = ""
|
||||
ffmpeg_filter = '-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]"'
|
||||
|
||||
if "end_mov" in input_files and os.path.isfile(input_files["end_mov"]):
|
||||
self.logger.info(f"Found end_mov file: {input_files['end_mov']}, including in final MP4")
|
||||
end_mov_file = shlex.quote(os.path.abspath(input_files["end_mov"]))
|
||||
env_mov_input = f"-i {end_mov_file}"
|
||||
ffmpeg_filter = '-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0][2:a:0]concat=n=3:v=1:a=1[outv][outa]"'
|
||||
|
||||
return env_mov_input, ffmpeg_filter
|
||||
|
||||
def remux_and_encode_output_video_files(self, with_vocals_file, input_files, output_files):
|
||||
self.logger.info(f"Remuxing and encoding output video files...")
|
||||
|
||||
# Check if output files already exist, if so, ask user to overwrite or skip
|
||||
if os.path.isfile(output_files["karaoke_mov"]) and os.path.isfile(output_files["final_karaoke_mp4"]):
|
||||
# Check if output files already exist
|
||||
if os.path.isfile(output_files["final_karaoke_lossless_mp4"]) and os.path.isfile(output_files["final_karaoke_lossless_mkv"]):
|
||||
if not self.prompt_user_bool(
|
||||
f"Found existing Final Karaoke output file: {output_files['final_karaoke_mp4']}. Overwrite (y) or skip (n)?",
|
||||
f"Found existing Final Karaoke output files. Overwrite (y) or skip (n)?",
|
||||
):
|
||||
self.logger.info(f"Skipping Karaoke MOV remux and Final MP4 render, existing files will be used.")
|
||||
self.logger.info(f"Skipping Karaoke MP4 remux and Final video renders, existing files will be used.")
|
||||
return
|
||||
|
||||
# Remux the synced video with the instrumental audio to produce an instrumental karaoke MOV file
|
||||
remux_ffmpeg_command = f'{self.ffmpeg_base_command} -an -i "{with_vocals_file}" -vn -i "{input_files["instrumental_audio"]}" -c:v copy -c:a aac "{output_files["karaoke_mov"]}"'
|
||||
self.execute_command(remux_ffmpeg_command, "Remuxing video with instrumental audio")
|
||||
# Create karaoke version with instrumental audio
|
||||
self.remux_with_instrumental(with_vocals_file, input_files["instrumental_audio"], output_files["karaoke_mp4"])
|
||||
|
||||
# Convert the with vocals video to MP4 if it isn't already
|
||||
# Convert the with vocals video to MP4 if needed
|
||||
if not with_vocals_file.endswith(".mp4"):
|
||||
with_vocals_mp4_command = (
|
||||
f'{self.ffmpeg_base_command} -i "{with_vocals_file}" -c:v libx264 -c:a aac "{output_files["with_vocals_mp4"]}"'
|
||||
)
|
||||
self.execute_command(with_vocals_mp4_command, "Converting with vocals video to MP4")
|
||||
self.convert_mov_to_mp4(with_vocals_file, output_files["with_vocals_mp4"])
|
||||
|
||||
# Delete the with vocals mov after successfully converting it to mp4
|
||||
if not self.dry_run and os.path.isfile(with_vocals_file):
|
||||
@@ -550,41 +678,31 @@ class KaraokeFinalise:
|
||||
|
||||
# Quote file paths to handle special characters
|
||||
title_mov_file = shlex.quote(os.path.abspath(input_files["title_mov"]))
|
||||
karaoke_mov_file = shlex.quote(os.path.abspath(output_files["karaoke_mov"]))
|
||||
output_final_mp4_file = shlex.quote(output_files["final_karaoke_mp4"])
|
||||
karaoke_mp4_file = shlex.quote(os.path.abspath(output_files["karaoke_mp4"]))
|
||||
|
||||
env_mov_input = ""
|
||||
ffmpeg_filter = '-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]"'
|
||||
# Prepare concat filter for combining videos
|
||||
env_mov_input, ffmpeg_filter = self.prepare_concat_filter(input_files)
|
||||
|
||||
# Check if end_mov file exists and include it in the concat command
|
||||
if "end_mov" in input_files and os.path.isfile(input_files["end_mov"]):
|
||||
self.logger.info(f"Found end_mov file: {input_files['end_mov']}, including in final MP4")
|
||||
end_mov_file = shlex.quote(os.path.abspath(input_files["end_mov"]))
|
||||
env_mov_input = f"-i {end_mov_file}"
|
||||
ffmpeg_filter = '-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0][2:a:0]concat=n=3:v=1:a=1[outv][outa]"'
|
||||
# Create all output versions
|
||||
self.encode_lossless_mp4(title_mov_file, karaoke_mp4_file, env_mov_input, ffmpeg_filter, output_files["final_karaoke_lossless_mp4"])
|
||||
self.encode_lossy_mp4(output_files["final_karaoke_lossless_mp4"], output_files["final_karaoke_lossy_mp4"])
|
||||
self.encode_lossless_mkv(output_files["final_karaoke_lossless_mp4"], output_files["final_karaoke_lossless_mkv"])
|
||||
self.encode_720p_version(output_files["final_karaoke_lossless_mp4"], output_files["final_karaoke_lossy_720p_mp4"])
|
||||
|
||||
aac_codec = "libfdk_aac"
|
||||
|
||||
# Check if aac_at codec is available
|
||||
codec_check_command = f"{self.ffmpeg_base_command} -codecs"
|
||||
result = os.popen(codec_check_command).read()
|
||||
if "aac_at" in result:
|
||||
aac_codec = "aac_at"
|
||||
|
||||
join_ffmpeg_command = f'{self.ffmpeg_base_command} -i {title_mov_file} -i {karaoke_mov_file} {env_mov_input} {ffmpeg_filter} -map "[outv]" -map "[outa]" -c:v libx264 -c:a {aac_codec} -q:a 14 {output_final_mp4_file}'
|
||||
|
||||
self.logger.debug(f"Running command: {join_ffmpeg_command}")
|
||||
self.execute_command(join_ffmpeg_command, "Joining title and instrumental videos")
|
||||
|
||||
# Prompt user to check final MP4 file before proceeding
|
||||
# Prompt user to check final video files before proceeding
|
||||
self.prompt_user_confirmation_or_raise_exception(
|
||||
f"Final MP4 file created: {output_files['final_karaoke_mp4']}, please check it! Proceed?",
|
||||
"Refusing to proceed without user confirmation they're happy with the Final MP4.",
|
||||
f"Final video files created:\n"
|
||||
f"- Lossless 4K MP4: {output_files['final_karaoke_lossless_mp4']}\n"
|
||||
f"- Lossless 4K MKV: {output_files['final_karaoke_lossless_mkv']}\n"
|
||||
f"- Lossy 4K MP4: {output_files['final_karaoke_lossy_mp4']}\n"
|
||||
f"- Lossy 720p MP4: {output_files['final_karaoke_lossy_720p_mp4']}\n"
|
||||
f"Please check them! Proceed?",
|
||||
"Refusing to proceed without user confirmation they're happy with the Final videos.",
|
||||
allow_empty=True,
|
||||
)
|
||||
|
||||
def create_cdg_zip_file(self, input_files, output_files):
|
||||
self.logger.info(f"Creating CDG ZIP file...")
|
||||
def create_cdg_zip_file(self, input_files, output_files, artist, title):
|
||||
self.logger.info(f"Creating CDG and MP3 files, then zipping them...")
|
||||
|
||||
# Check if CDG file already exists, if so, ask user to overwrite or skip
|
||||
if os.path.isfile(output_files["final_karaoke_cdg_zip"]):
|
||||
@@ -594,19 +712,47 @@ class KaraokeFinalise:
|
||||
self.logger.info(f"Skipping CDG ZIP file creation, existing file will be used.")
|
||||
return
|
||||
|
||||
# Create the ZIP file containing the MP3 and CDG files
|
||||
# Generate CDG and MP3 files
|
||||
if self.dry_run:
|
||||
self.logger.info(f"DRY RUN: Would create CDG ZIP file: {output_files['final_karaoke_cdg_zip']}")
|
||||
self.logger.info(f"DRY RUN: Would generate CDG and MP3 files")
|
||||
else:
|
||||
self.logger.info(f"Creating ZIP file containing {input_files['karaoke_mp3']} and {input_files['karaoke_cdg']}")
|
||||
with zipfile.ZipFile(output_files["final_karaoke_cdg_zip"], "w") as zipf:
|
||||
zipf.write(input_files["karaoke_mp3"], os.path.basename(input_files["karaoke_mp3"]))
|
||||
zipf.write(input_files["karaoke_cdg"], os.path.basename(input_files["karaoke_cdg"]))
|
||||
self.logger.info(f"Generating CDG and MP3 files")
|
||||
|
||||
if not os.path.isfile(output_files["final_karaoke_cdg_zip"]):
|
||||
raise Exception(f"Failed to create CDG ZIP file: {output_files['final_karaoke_cdg_zip']}")
|
||||
if self.cdg_styles is None:
|
||||
raise ValueError("CDG styles configuration is required when enable_cdg is True")
|
||||
|
||||
self.logger.info(f"CDG ZIP file created: {output_files['final_karaoke_cdg_zip']}")
|
||||
generator = CDGGenerator(output_dir=os.getcwd(), logger=self.logger)
|
||||
cdg_file, mp3_file, zip_file = generator.generate_cdg_from_lrc(
|
||||
lrc_file=input_files["karaoke_lrc"],
|
||||
audio_file=input_files["instrumental_audio"],
|
||||
title=title,
|
||||
artist=artist,
|
||||
cdg_styles=self.cdg_styles,
|
||||
)
|
||||
|
||||
# Rename the generated ZIP file to match our expected naming convention
|
||||
if os.path.isfile(zip_file):
|
||||
os.rename(zip_file, output_files["final_karaoke_cdg_zip"])
|
||||
self.logger.info(f"Renamed CDG ZIP file from {zip_file} to {output_files['final_karaoke_cdg_zip']}")
|
||||
|
||||
if not os.path.isfile(output_files["final_karaoke_cdg_zip"]):
|
||||
self.logger.error(f"Failed to find any CDG ZIP file. Listing directory contents:")
|
||||
for file in os.listdir():
|
||||
self.logger.error(f" - {file}")
|
||||
raise Exception(f"Failed to create CDG ZIP file: {output_files['final_karaoke_cdg_zip']}")
|
||||
|
||||
self.logger.info(f"CDG ZIP file created: {output_files['final_karaoke_cdg_zip']}")
|
||||
|
||||
# Extract the CDG ZIP file
|
||||
self.logger.info(f"Extracting CDG ZIP file: {output_files['final_karaoke_cdg_zip']}")
|
||||
with zipfile.ZipFile(output_files["final_karaoke_cdg_zip"], "r") as zip_ref:
|
||||
zip_ref.extractall()
|
||||
|
||||
if os.path.isfile(output_files["karaoke_mp3"]):
|
||||
self.logger.info(f"Found extracted MP3 file: {output_files['karaoke_mp3']}")
|
||||
else:
|
||||
self.logger.error("Failed to find extracted MP3 file")
|
||||
raise Exception("Failed to extract MP3 file from CDG ZIP")
|
||||
|
||||
def create_txt_zip_file(self, input_files, output_files):
|
||||
self.logger.info(f"Creating TXT ZIP file...")
|
||||
@@ -631,9 +777,9 @@ class KaraokeFinalise:
|
||||
txt_file.write(converted_txt)
|
||||
self.logger.info(f"TXT file written: {output_files['karaoke_txt']}")
|
||||
|
||||
self.logger.info(f"Creating ZIP file containing {input_files['karaoke_mp3']} and {output_files['karaoke_txt']}")
|
||||
self.logger.info(f"Creating ZIP file containing {output_files['karaoke_mp3']} and {output_files['karaoke_txt']}")
|
||||
with zipfile.ZipFile(output_files["final_karaoke_txt_zip"], "w") as zipf:
|
||||
zipf.write(input_files["karaoke_mp3"], os.path.basename(input_files["karaoke_mp3"]))
|
||||
zipf.write(output_files["karaoke_mp3"], os.path.basename(output_files["karaoke_mp3"]))
|
||||
zipf.write(output_files["karaoke_txt"], os.path.basename(output_files["karaoke_txt"]))
|
||||
|
||||
if not os.path.isfile(output_files["final_karaoke_txt_zip"]):
|
||||
@@ -647,11 +793,11 @@ class KaraokeFinalise:
|
||||
self.new_brand_code_dir = f"{brand_code} - {artist} - {title}"
|
||||
self.new_brand_code_dir_path = os.path.join(self.organised_dir, self.new_brand_code_dir)
|
||||
|
||||
self.prompt_user_confirmation_or_raise_exception(
|
||||
f"Move files to new brand-prefixed directory {self.new_brand_code_dir_path} and delete current dir?",
|
||||
"Refusing to move files without user confirmation of move.",
|
||||
allow_empty=True,
|
||||
)
|
||||
# self.prompt_user_confirmation_or_raise_exception(
|
||||
# f"Move files to new brand-prefixed directory {self.new_brand_code_dir_path} and delete current dir?",
|
||||
# "Refusing to move files without user confirmation of move.",
|
||||
# allow_empty=True,
|
||||
# )
|
||||
|
||||
orig_dir = os.getcwd()
|
||||
os.chdir(os.path.dirname(orig_dir))
|
||||
@@ -663,15 +809,18 @@ class KaraokeFinalise:
|
||||
os.rename(orig_dir, self.new_brand_code_dir_path)
|
||||
|
||||
def copy_final_files_to_public_share_dirs(self, brand_code, base_name, output_files):
|
||||
self.logger.info(f"Copying final MP4 and ZIP to public share directory...")
|
||||
self.logger.info(f"Copying final MP4, 720p MP4, and ZIP to public share directory...")
|
||||
|
||||
# Validate public_share_dir is a valid folder with MP4 and CDG subdirectories
|
||||
# Validate public_share_dir is a valid folder with MP4, MP4-720p, and CDG subdirectories
|
||||
if not os.path.isdir(self.public_share_dir):
|
||||
raise Exception(f"Public share directory does not exist: {self.public_share_dir}")
|
||||
|
||||
if not os.path.isdir(os.path.join(self.public_share_dir, "MP4")):
|
||||
raise Exception(f"Public share directory does not contain MP4 subdirectory: {self.public_share_dir}")
|
||||
|
||||
if not os.path.isdir(os.path.join(self.public_share_dir, "MP4-720p")):
|
||||
raise Exception(f"Public share directory does not contain MP4-720p subdirectory: {self.public_share_dir}")
|
||||
|
||||
if not os.path.isdir(os.path.join(self.public_share_dir, "CDG")):
|
||||
raise Exception(f"Public share directory does not contain CDG subdirectory: {self.public_share_dir}")
|
||||
|
||||
@@ -679,17 +828,23 @@ class KaraokeFinalise:
|
||||
raise Exception(f"New track prefix was not set, refusing to copy to public share directory")
|
||||
|
||||
dest_mp4_dir = os.path.join(self.public_share_dir, "MP4")
|
||||
dest_720p_dir = os.path.join(self.public_share_dir, "MP4-720p")
|
||||
dest_cdg_dir = os.path.join(self.public_share_dir, "CDG")
|
||||
os.makedirs(dest_mp4_dir, exist_ok=True)
|
||||
os.makedirs(dest_720p_dir, exist_ok=True)
|
||||
os.makedirs(dest_cdg_dir, exist_ok=True)
|
||||
|
||||
dest_mp4_file = os.path.join(dest_mp4_dir, f"{brand_code} - {base_name}.mp4")
|
||||
dest_720p_mp4_file = os.path.join(dest_720p_dir, f"{brand_code} - {base_name}.mp4")
|
||||
dest_zip_file = os.path.join(dest_cdg_dir, f"{brand_code} - {base_name}.zip")
|
||||
|
||||
if self.dry_run:
|
||||
self.logger.info(f"DRY RUN: Would copy final MP4 and ZIP to {dest_mp4_file} + .cdg")
|
||||
self.logger.info(
|
||||
f"DRY RUN: Would copy final MP4, 720p MP4, and ZIP to {dest_mp4_file}, {dest_720p_mp4_file}, and {dest_zip_file}"
|
||||
)
|
||||
else:
|
||||
shutil.copy2(output_files["final_karaoke_mp4"], dest_mp4_file)
|
||||
shutil.copy2(output_files["final_karaoke_lossy_mp4"], dest_mp4_file) # Changed to use lossy MP4
|
||||
shutil.copy2(output_files["final_karaoke_lossy_720p_mp4"], dest_720p_mp4_file)
|
||||
shutil.copy2(output_files["final_karaoke_cdg_zip"], dest_zip_file)
|
||||
self.logger.info(f"Copied final files to public share directory")
|
||||
|
||||
@@ -747,6 +902,19 @@ class KaraokeFinalise:
|
||||
self.logger.error(f"Command output (stderr): {e.stderr}")
|
||||
self.logger.error(f"Full exception: {e}")
|
||||
|
||||
def get_existing_brand_code(self):
|
||||
"""Extract brand code from current directory name"""
|
||||
current_dir = os.path.basename(os.getcwd())
|
||||
if " - " not in current_dir:
|
||||
raise Exception(f"Current directory '{current_dir}' does not match expected format 'BRAND-XXXX - Artist - Title'")
|
||||
|
||||
brand_code = current_dir.split(" - ")[0]
|
||||
if not brand_code or "-" not in brand_code:
|
||||
raise Exception(f"Could not extract valid brand code from directory name '{current_dir}'")
|
||||
|
||||
self.logger.info(f"Using existing brand code: {brand_code}")
|
||||
return brand_code
|
||||
|
||||
def execute_optional_features(self, artist, title, base_name, input_files, output_files):
|
||||
self.logger.info(f"Executing optional features...")
|
||||
|
||||
@@ -765,7 +933,16 @@ class KaraokeFinalise:
|
||||
self.post_discord_notification()
|
||||
|
||||
if self.folder_organisation_enabled:
|
||||
self.brand_code = self.get_next_brand_code()
|
||||
if self.keep_brand_code:
|
||||
self.brand_code = self.get_existing_brand_code()
|
||||
self.new_brand_code_dir = os.path.basename(os.getcwd())
|
||||
self.new_brand_code_dir_path = os.getcwd()
|
||||
else:
|
||||
self.brand_code = self.get_next_brand_code()
|
||||
self.move_files_to_brand_code_folder(self.brand_code, artist, title, output_files)
|
||||
# Update output file paths after moving
|
||||
for key in output_files:
|
||||
output_files[key] = os.path.join(self.new_brand_code_dir_path, os.path.basename(output_files[key]))
|
||||
|
||||
if self.public_share_copy_enabled:
|
||||
self.copy_final_files_to_public_share_dirs(self.brand_code, base_name, output_files)
|
||||
@@ -773,10 +950,88 @@ class KaraokeFinalise:
|
||||
if self.public_share_rclone_enabled:
|
||||
self.sync_public_share_dir_to_rclone_destination()
|
||||
|
||||
self.move_files_to_brand_code_folder(self.brand_code, artist, title, output_files)
|
||||
|
||||
self.generate_organised_folder_sharing_link()
|
||||
|
||||
def authenticate_gmail(self):
|
||||
"""Authenticate and return a Gmail service object."""
|
||||
creds = None
|
||||
gmail_token_file = "/tmp/karaoke-finalise-gmail-token.pickle"
|
||||
|
||||
if os.path.exists(gmail_token_file):
|
||||
with open(gmail_token_file, "rb") as token:
|
||||
creds = pickle.load(token)
|
||||
|
||||
if not creds or not creds.valid:
|
||||
if creds and creds.expired and creds.refresh_token:
|
||||
creds.refresh(Request())
|
||||
else:
|
||||
flow = InstalledAppFlow.from_client_secrets_file(
|
||||
self.youtube_client_secrets_file, ["https://www.googleapis.com/auth/gmail.compose"]
|
||||
)
|
||||
creds = flow.run_local_server(port=0)
|
||||
with open(gmail_token_file, "wb") as token:
|
||||
pickle.dump(creds, token)
|
||||
|
||||
return build("gmail", "v1", credentials=creds)
|
||||
|
||||
def draft_completion_email(self, artist, title, youtube_url, dropbox_url):
|
||||
if not self.email_template_file:
|
||||
self.logger.info("Email template file not provided, skipping email draft creation.")
|
||||
return
|
||||
|
||||
with open(self.email_template_file, "r") as f:
|
||||
template = f.read()
|
||||
|
||||
email_body = template.format(youtube_url=youtube_url, dropbox_url=dropbox_url)
|
||||
|
||||
subject = f"{self.brand_code}: {artist} - {title}"
|
||||
|
||||
if self.dry_run:
|
||||
self.logger.info(f"DRY RUN: Would create email draft with subject: {subject}")
|
||||
self.logger.info(f"DRY RUN: Email body:\n{email_body}")
|
||||
else:
|
||||
if not self.gmail_service:
|
||||
self.gmail_service = self.authenticate_gmail()
|
||||
|
||||
message = MIMEText(email_body)
|
||||
message["subject"] = subject
|
||||
raw_message = base64.urlsafe_b64encode(message.as_bytes()).decode("utf-8")
|
||||
draft = self.gmail_service.users().drafts().create(userId="me", body={"message": {"raw": raw_message}}).execute()
|
||||
self.logger.info(f"Email draft created with ID: {draft['id']}")
|
||||
|
||||
def test_email_template(self):
|
||||
if not self.email_template_file:
|
||||
self.logger.error("Email template file not provided. Use --email_template_file to specify the file path.")
|
||||
return
|
||||
|
||||
fake_artist = "Test Artist"
|
||||
fake_title = "Test Song"
|
||||
fake_youtube_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
||||
fake_dropbox_url = "https://www.dropbox.com/sh/fake/folder/link"
|
||||
fake_brand_code = "TEST-0001"
|
||||
|
||||
self.brand_code = fake_brand_code
|
||||
self.draft_completion_email(fake_artist, fake_title, fake_youtube_url, fake_dropbox_url)
|
||||
|
||||
self.logger.info("Email template test complete. Check your Gmail drafts for the test email.")
|
||||
|
||||
def detect_best_aac_codec(self):
|
||||
"""Detect the best available AAC codec (aac_at > libfdk_aac > aac)"""
|
||||
self.logger.info("Detecting best available AAC codec...")
|
||||
|
||||
codec_check_command = f"{self.ffmpeg_base_command} -codecs"
|
||||
result = os.popen(codec_check_command).read()
|
||||
|
||||
if "aac_at" in result:
|
||||
self.logger.info("Using aac_at codec (best quality)")
|
||||
return "aac_at"
|
||||
elif "libfdk_aac" in result:
|
||||
self.logger.info("Using libfdk_aac codec (good quality)")
|
||||
return "libfdk_aac"
|
||||
else:
|
||||
self.logger.info("Using built-in aac codec (basic quality)")
|
||||
return "aac"
|
||||
|
||||
def process(self):
|
||||
if self.dry_run:
|
||||
self.logger.warning("Dry run enabled. No actions will be performed.")
|
||||
@@ -793,7 +1048,7 @@ class KaraokeFinalise:
|
||||
output_files = self.prepare_output_filenames(base_name)
|
||||
|
||||
if self.enable_cdg:
|
||||
self.create_cdg_zip_file(input_files, output_files)
|
||||
self.create_cdg_zip_file(input_files, output_files, artist, title)
|
||||
|
||||
if self.enable_txt:
|
||||
self.create_txt_zip_file(input_files, output_files)
|
||||
@@ -806,8 +1061,11 @@ class KaraokeFinalise:
|
||||
"artist": artist,
|
||||
"title": title,
|
||||
"video_with_vocals": output_files["with_vocals_mp4"],
|
||||
"video_with_instrumental": output_files["karaoke_mov"],
|
||||
"final_video": output_files["final_karaoke_mp4"],
|
||||
"video_with_instrumental": output_files["karaoke_mp4"],
|
||||
"final_video": output_files["final_karaoke_lossless_mp4"],
|
||||
"final_video_mkv": output_files["final_karaoke_lossless_mkv"],
|
||||
"final_video_lossy": output_files["final_karaoke_lossy_mp4"],
|
||||
"final_video_720p": output_files["final_karaoke_lossy_720p_mp4"],
|
||||
"youtube_url": self.youtube_url,
|
||||
"brand_code": self.brand_code,
|
||||
"new_brand_code_dir_path": self.new_brand_code_dir_path,
|
||||
@@ -820,4 +1078,7 @@ class KaraokeFinalise:
|
||||
if self.enable_txt:
|
||||
result["final_karaoke_txt_zip"] = output_files["final_karaoke_txt_zip"]
|
||||
|
||||
if self.email_template_file:
|
||||
self.draft_completion_email(artist, title, result["youtube_url"], result["brand_code_dir_sharing_link"])
|
||||
|
||||
return result
|
||||
+940
-356
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,224 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import logging
|
||||
import pkg_resources
|
||||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
import json
|
||||
from karaoke_prep import KaraokePrep
|
||||
from karaoke_prep.karaoke_finalise import KaraokeFinalise
|
||||
|
||||
|
||||
async def async_main():
|
||||
logger = logging.getLogger(__name__)
|
||||
log_handler = logging.StreamHandler()
|
||||
log_formatter = logging.Formatter(fmt="%(asctime)s.%(msecs)03d - %(levelname)s - %(module)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
||||
log_handler.setFormatter(log_formatter)
|
||||
logger.addHandler(log_handler)
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Automatically prepare and finalise karaoke videos in one step, combining karaoke-prep and karaoke-finalise functionality.",
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, max_help_position=54),
|
||||
)
|
||||
|
||||
# Basic information (from prep_cli.py)
|
||||
parser.add_argument(
|
||||
"args",
|
||||
nargs="*",
|
||||
help="[Media or playlist URL] [Artist] [Title] of song to prep. If URL is provided, Artist and Title are optional but increase chance of fetching the correct lyrics. If Artist and Title are provided with no URL, the top YouTube search result will be fetched.",
|
||||
)
|
||||
|
||||
package_version = pkg_resources.get_distribution("karaoke-prep").version
|
||||
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {package_version}")
|
||||
|
||||
# Common arguments for both prep and finalise
|
||||
parser.add_argument(
|
||||
"--log_level",
|
||||
default="info",
|
||||
help="Optional: logging level, e.g. info, debug, warning (default: %(default)s). Example: --log_level=debug",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dry_run",
|
||||
action="store_true",
|
||||
help="Optional: perform a dry run without making any changes. Example: --dry_run",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--style_params_json",
|
||||
help="Optional: Path to JSON file containing style configuration. Example: --style_params_json='/path/to/style_params.json'",
|
||||
)
|
||||
|
||||
# Prep-specific arguments (add any additional prep arguments you commonly use)
|
||||
parser.add_argument(
|
||||
"--output_dir",
|
||||
default=".",
|
||||
help="Optional: directory to write output files (default: <current dir>). Example: --output_dir=/app/karaoke",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no_track_subfolders",
|
||||
action="store_false",
|
||||
dest="create_track_subfolders",
|
||||
help="Optional: do NOT create a named subfolder for each track. Example: --no_track_subfolders",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--existing_instrumental",
|
||||
help="Optional: Path to an existing instrumental audio file. If provided, audio separation will be skipped.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--lyrics_file",
|
||||
help="Optional: Path to a file containing lyrics to use instead of fetching from online. Example: --lyrics_file='/path/to/lyrics.txt'",
|
||||
)
|
||||
|
||||
# Finalise-specific arguments
|
||||
parser.add_argument(
|
||||
"--enable_cdg",
|
||||
action="store_true",
|
||||
help="Optional: Enable CDG ZIP generation during finalisation. Example: --enable_cdg",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--enable_txt",
|
||||
action="store_true",
|
||||
help="Optional: Enable TXT ZIP generation during finalisation. Example: --enable_txt",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--brand_prefix",
|
||||
help="Optional: Your brand prefix to calculate the next sequential number. Example: --brand_prefix=BRAND",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--organised_dir",
|
||||
help="Optional: Target directory where the processed folder will be moved. Example: --organised_dir='/path/to/Tracks-Organized'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--organised_dir_rclone_root",
|
||||
help="Optional: Rclone path which maps to your organised_dir. Example: --organised_dir_rclone_root='dropbox:Media/Karaoke/Tracks-Organized'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--public_share_dir",
|
||||
help="Optional: Public share directory for final files. Example: --public_share_dir='/path/to/Tracks-PublicShare'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--youtube_client_secrets_file",
|
||||
help="Optional: Path to youtube client secrets file. Example: --youtube_client_secrets_file='/path/to/client_secret.json'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--youtube_description_file",
|
||||
help="Optional: Path to youtube description template. Example: --youtube_description_file='/path/to/description.txt'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--rclone_destination",
|
||||
help="Optional: Rclone destination for public_share_dir sync. Example: --rclone_destination='googledrive:KaraokeFolder'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--discord_webhook_url",
|
||||
help="Optional: Discord webhook URL for notifications. Example: --discord_webhook_url='https://discord.com/api/webhooks/...'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--email_template_file",
|
||||
help="Optional: Path to email template file. Example: --email_template_file='/path/to/template.txt'",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Parse input arguments similar to prep_cli.py
|
||||
input_media, artist, title = None, None, None
|
||||
|
||||
if not args.args:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
if args.args[0].startswith(("http://", "https://")) or os.path.isfile(args.args[0]):
|
||||
input_media = args.args[0]
|
||||
if len(args.args) > 2:
|
||||
artist = args.args[1]
|
||||
title = args.args[2]
|
||||
elif len(args.args) > 1:
|
||||
artist = args.args[0]
|
||||
title = args.args[1]
|
||||
else:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
log_level = getattr(logging, args.log_level.upper())
|
||||
logger.setLevel(log_level)
|
||||
|
||||
# Step 1: Run KaraokePrep
|
||||
logger.info("Starting preparation phase...")
|
||||
kprep = KaraokePrep(
|
||||
artist=artist,
|
||||
title=title,
|
||||
input_media=input_media,
|
||||
dry_run=args.dry_run,
|
||||
log_formatter=log_formatter,
|
||||
log_level=log_level,
|
||||
output_dir=args.output_dir,
|
||||
create_track_subfolders=True if not hasattr(args, "create_track_subfolders") else args.create_track_subfolders,
|
||||
style_params_json=args.style_params_json,
|
||||
existing_instrumental=args.existing_instrumental,
|
||||
lyrics_file=args.lyrics_file,
|
||||
)
|
||||
|
||||
tracks = await kprep.process()
|
||||
|
||||
# Step 2: For each track, run KaraokeFinalise
|
||||
for track in tracks:
|
||||
logger.info(f"Starting finalisation phase for {track['artist']} - {track['title']}...")
|
||||
|
||||
# Use the track directory that was actually created by KaraokePrep
|
||||
track_dir = track["track_output_dir"]
|
||||
if not os.path.exists(track_dir):
|
||||
logger.error(f"Track directory not found: {track_dir}")
|
||||
continue
|
||||
|
||||
logger.info(f"Changing to directory: {track_dir}")
|
||||
os.chdir(track_dir)
|
||||
|
||||
# Load CDG styles if CDG generation is enabled
|
||||
cdg_styles = None
|
||||
if args.enable_cdg:
|
||||
if not args.style_params_json:
|
||||
logger.error("CDG styles JSON file path (--style_params_json) is required when --enable_cdg is used")
|
||||
sys.exit(1)
|
||||
try:
|
||||
with open(args.style_params_json, "r") as f:
|
||||
style_params = json.loads(f.read())
|
||||
cdg_styles = style_params["cdg"]
|
||||
except FileNotFoundError:
|
||||
logger.error(f"CDG styles configuration file not found: {args.style_params_json}")
|
||||
sys.exit(1)
|
||||
except json.JSONDecodeError as e:
|
||||
logger.error(f"Invalid JSON in CDG styles configuration file: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Initialize KaraokeFinalise
|
||||
kfinalise = KaraokeFinalise(
|
||||
log_formatter=log_formatter,
|
||||
log_level=log_level,
|
||||
dry_run=args.dry_run,
|
||||
enable_cdg=args.enable_cdg,
|
||||
enable_txt=args.enable_txt,
|
||||
brand_prefix=args.brand_prefix,
|
||||
organised_dir=args.organised_dir,
|
||||
organised_dir_rclone_root=args.organised_dir_rclone_root,
|
||||
public_share_dir=args.public_share_dir,
|
||||
youtube_client_secrets_file=args.youtube_client_secrets_file,
|
||||
youtube_description_file=args.youtube_description_file,
|
||||
rclone_destination=args.rclone_destination,
|
||||
discord_webhook_url=args.discord_webhook_url,
|
||||
email_template_file=args.email_template_file,
|
||||
cdg_styles=cdg_styles,
|
||||
)
|
||||
|
||||
try:
|
||||
final_track = kfinalise.process()
|
||||
logger.info(f"Successfully completed auto processing for: {track['artist']} - {track['title']}")
|
||||
except Exception as e:
|
||||
logger.error(f"Error during finalisation: {str(e)}")
|
||||
raise e
|
||||
|
||||
|
||||
def main():
|
||||
asyncio.run(async_main())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,237 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import logging
|
||||
import pkg_resources
|
||||
import os
|
||||
import csv
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
from karaoke_prep import KaraokePrep
|
||||
from karaoke_prep.karaoke_finalise import KaraokeFinalise
|
||||
|
||||
# Global logger
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.INFO) # Set initial log level
|
||||
|
||||
|
||||
async def process_track(row, args, logger, log_formatter):
|
||||
"""Process a single track through prep and finalise stages"""
|
||||
original_dir = os.getcwd() # Store the original directory
|
||||
try:
|
||||
# Extract track info from CSV row
|
||||
artist = row["Artist"].strip() # Remove leading/trailing whitespace
|
||||
title = row["Title"].strip()
|
||||
guide_file = row["Mixed Audio Filename"].strip()
|
||||
instrumental_file = row["Instrumental Audio Filename"].strip()
|
||||
|
||||
logger.info(f"Processing track: {artist} - {title}")
|
||||
|
||||
# Initialize KaraokePrep
|
||||
kprep = KaraokePrep(
|
||||
artist=artist,
|
||||
title=title,
|
||||
input_media=guide_file,
|
||||
existing_instrumental=instrumental_file,
|
||||
style_params_json=args.style_params_json,
|
||||
log_formatter=log_formatter,
|
||||
log_level=args.log_level,
|
||||
dry_run=args.dry_run,
|
||||
skip_transcription_review=True,
|
||||
create_track_subfolders=True,
|
||||
)
|
||||
|
||||
tracks = await kprep.process()
|
||||
|
||||
# Step 2: For each track, run KaraokeFinalise
|
||||
for track in tracks:
|
||||
logger.info(f"Starting finalisation phase for {track['artist']} - {track['title']}...")
|
||||
|
||||
# Look for the track directory, trying different possible formats
|
||||
possible_dirs = [
|
||||
os.path.join(args.output_dir, f"{track['artist']} - {track['title']}"),
|
||||
os.path.join(args.output_dir, f"{artist} - {title}"),
|
||||
os.path.join(args.output_dir, f"{artist.replace(' ', ' ')} - {title}"),
|
||||
]
|
||||
|
||||
track_dir = None
|
||||
for possible_dir in possible_dirs:
|
||||
if os.path.exists(possible_dir):
|
||||
track_dir = possible_dir
|
||||
break
|
||||
|
||||
if track_dir is None:
|
||||
logger.error(f"Track directory not found. Tried: {possible_dirs}")
|
||||
continue
|
||||
|
||||
logger.info(f"Changing to directory: {track_dir}")
|
||||
os.chdir(track_dir)
|
||||
|
||||
# Load CDG styles if CDG generation is enabled
|
||||
cdg_styles = None
|
||||
if args.enable_cdg:
|
||||
if not args.style_params_json:
|
||||
logger.error("CDG styles JSON file path (--style_params_json) is required when --enable_cdg is used")
|
||||
sys.exit(1)
|
||||
try:
|
||||
with open(args.style_params_json, "r") as f:
|
||||
style_params = json.loads(f.read())
|
||||
cdg_styles = style_params["cdg"]
|
||||
except FileNotFoundError:
|
||||
logger.error(f"CDG styles configuration file not found: {args.style_params_json}")
|
||||
sys.exit(1)
|
||||
except json.JSONDecodeError as e:
|
||||
logger.error(f"Invalid JSON in CDG styles configuration file: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Initialize KaraokeFinalise
|
||||
kfinalise = KaraokeFinalise(
|
||||
log_formatter=log_formatter,
|
||||
log_level=args.log_level,
|
||||
dry_run=args.dry_run,
|
||||
enable_cdg=args.enable_cdg,
|
||||
enable_txt=args.enable_txt,
|
||||
cdg_styles=cdg_styles,
|
||||
non_interactive=True,
|
||||
)
|
||||
|
||||
try:
|
||||
final_track = kfinalise.process()
|
||||
logger.info(f"Successfully completed auto processing for: {track['artist']} - {track['title']}")
|
||||
except Exception as e:
|
||||
logger.error(f"Error during finalisation: {str(e)}")
|
||||
raise e
|
||||
|
||||
# Always return to the original directory after processing
|
||||
os.chdir(original_dir)
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to process {artist} - {title}: {str(e)}")
|
||||
return False
|
||||
finally:
|
||||
# Ensure we return to the original directory even if an error occurred
|
||||
os.chdir(original_dir)
|
||||
|
||||
|
||||
def update_csv_status(csv_path, row_index, new_status):
|
||||
"""Update the status of a processed row in the CSV file"""
|
||||
# Read all rows
|
||||
with open(csv_path, "r") as f:
|
||||
rows = list(csv.DictReader(f))
|
||||
|
||||
# Update status for the processed row
|
||||
rows[row_index]["Status"] = new_status
|
||||
|
||||
# Write back to CSV
|
||||
fieldnames = rows[0].keys()
|
||||
with open(csv_path, "w", newline="") as f:
|
||||
writer = csv.DictWriter(f, fieldnames=fieldnames)
|
||||
writer.writeheader()
|
||||
writer.writerows(rows)
|
||||
|
||||
|
||||
async def async_main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Process multiple karaoke tracks in bulk from a CSV file.",
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, max_help_position=54),
|
||||
)
|
||||
|
||||
# Basic information
|
||||
parser.add_argument(
|
||||
"input_csv",
|
||||
help="Path to CSV file containing tracks to process. CSV should have columns: Artist,Title,Mixed Audio Filename,Instrumental Audio Filename,Status",
|
||||
)
|
||||
|
||||
package_version = pkg_resources.get_distribution("karaoke-prep").version
|
||||
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {package_version}")
|
||||
|
||||
# Required arguments
|
||||
parser.add_argument(
|
||||
"--style_params_json",
|
||||
required=True,
|
||||
help="Path to style parameters JSON file",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output_dir",
|
||||
default=".",
|
||||
help="Optional: directory to write output files (default: <current dir>). Example: --output_dir=/app/karaoke",
|
||||
)
|
||||
|
||||
# Finalise-specific arguments
|
||||
parser.add_argument(
|
||||
"--enable_cdg",
|
||||
action="store_true",
|
||||
help="Optional: Enable CDG ZIP generation during finalisation. Example: --enable_cdg",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--enable_txt",
|
||||
action="store_true",
|
||||
help="Optional: Enable TXT ZIP generation during finalisation. Example: --enable_txt",
|
||||
)
|
||||
|
||||
# Logging & Debugging
|
||||
parser.add_argument(
|
||||
"--log_level",
|
||||
default="info",
|
||||
help="Optional: logging level, e.g. info, debug, warning (default: %(default)s). Example: --log_level=debug",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dry_run",
|
||||
action="store_true",
|
||||
help="Optional: perform a dry run without making any changes (default: %(default)s). Example: --dry_run",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Convert input_csv to absolute path
|
||||
args.input_csv = os.path.abspath(args.input_csv)
|
||||
|
||||
if not os.path.isfile(args.input_csv):
|
||||
logger.error(f"Input CSV file not found: {args.input_csv}")
|
||||
exit(1)
|
||||
|
||||
# Fix: Convert log level to uppercase before getting attribute
|
||||
log_level = getattr(logging, args.log_level.upper())
|
||||
args.log_level = log_level # Store the numeric log level in args
|
||||
|
||||
logger.info(f"Starting bulk processing with input CSV: {args.input_csv}")
|
||||
|
||||
# Read and process CSV
|
||||
with open(args.input_csv, "r") as f:
|
||||
reader = csv.DictReader(f)
|
||||
rows = list(reader) # Convert to list to allow multiple passes
|
||||
|
||||
for i, row in enumerate(rows):
|
||||
if row["Status"].lower() != "uploaded":
|
||||
logger.info(f"Skipping {row['Artist']} - {row['Title']} (Status: {row['Status']})")
|
||||
continue
|
||||
|
||||
logger.info(f"Starting processing of {row['Artist']} - {row['Title']}")
|
||||
|
||||
success = await process_track(row, args, logger, log_formatter)
|
||||
|
||||
if not args.dry_run:
|
||||
if success:
|
||||
update_csv_status(args.input_csv, i, "Completed")
|
||||
logger.info(f"Successfully processed {row['Artist']} - {row['Title']}")
|
||||
else:
|
||||
update_csv_status(args.input_csv, i, "Failed")
|
||||
logger.error(f"Failed to process {row['Artist']} - {row['Title']}")
|
||||
|
||||
|
||||
def main():
|
||||
# Set up logging only once
|
||||
global log_formatter # Make log_formatter accessible to other functions
|
||||
log_handler = logging.StreamHandler()
|
||||
log_formatter = logging.Formatter(fmt="%(asctime)s.%(msecs)03d - %(levelname)s - %(module)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
||||
log_handler.setFormatter(log_formatter)
|
||||
logger.addHandler(log_handler)
|
||||
|
||||
# Run the async main function using asyncio
|
||||
asyncio.run(async_main())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -4,6 +4,9 @@ import logging
|
||||
import pkg_resources
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import pyperclip
|
||||
import time
|
||||
from karaoke_prep.karaoke_finalise import KaraokeFinalise
|
||||
|
||||
|
||||
@@ -16,7 +19,7 @@ def main():
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Render, remux and join intermediate files to create final karaoke video, as the third stage after using karaoke-prep. Processes all (Karaoke).mov files in current directory.",
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, max_help_position=54),
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, max_help_position=62),
|
||||
)
|
||||
|
||||
package_version = pkg_resources.get_distribution("karaoke-prep").version
|
||||
@@ -107,6 +110,37 @@ def main():
|
||||
help="Optional: Discord webhook URL to send notifications to. Example: --discord_webhook_url='https://discord.com/api/webhooks/1234567890/TOKEN/messages",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--email_template_file",
|
||||
default=None,
|
||||
help="Optional: File path to email template for drafting completion email. Example: --email_template_file='/path/to/email_template.txt'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--test_email_template",
|
||||
action="store_true",
|
||||
help="Optional: Test the email template functionality with fake data. Example: --test_email_template",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--style_params_json",
|
||||
default=None,
|
||||
help="Optional: Path to JSON file containing CDG style configuration. Required if --enable_cdg is used. Example: --style_params_json='/path/to/cdg_styles.json'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--keep-brand-code",
|
||||
action="store_true",
|
||||
help="Optional: Use existing brand code from current directory instead of generating new one (default: disabled). Example: --keep-brand-code",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-y",
|
||||
"--yes",
|
||||
action="store_true",
|
||||
help="Optional: Run in non-interactive mode, assuming yes to all prompts (default: disabled). Example: -y",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
log_level = getattr(logging, args.log_level.upper())
|
||||
@@ -114,6 +148,23 @@ def main():
|
||||
|
||||
logger.info(f"KaraokeFinalise CLI beginning initialisation...")
|
||||
|
||||
# Load CDG styles if CDG generation is enabled
|
||||
cdg_styles = None
|
||||
if args.enable_cdg:
|
||||
if not args.style_params_json:
|
||||
logger.error("CDG styles JSON file path (--style_params_json) is required when --enable_cdg is used")
|
||||
sys.exit(1)
|
||||
try:
|
||||
with open(args.style_params_json, "r") as f:
|
||||
style_params = json.loads(f.read())
|
||||
cdg_styles = style_params["cdg"]
|
||||
except FileNotFoundError:
|
||||
logger.error(f"CDG styles configuration file not found: {args.style_params_json}")
|
||||
sys.exit(1)
|
||||
except json.JSONDecodeError as e:
|
||||
logger.error(f"Invalid JSON in CDG styles configuration file: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
kfinalise = KaraokeFinalise(
|
||||
log_formatter=log_formatter,
|
||||
log_level=log_level,
|
||||
@@ -130,32 +181,72 @@ def main():
|
||||
youtube_description_file=args.youtube_description_file,
|
||||
rclone_destination=args.rclone_destination,
|
||||
discord_webhook_url=args.discord_webhook_url,
|
||||
email_template_file=args.email_template_file,
|
||||
cdg_styles=cdg_styles,
|
||||
keep_brand_code=args.keep_brand_code,
|
||||
non_interactive=args.yes,
|
||||
)
|
||||
|
||||
try:
|
||||
track = kfinalise.process()
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred during finalisation, see stack trace below: {str(e)}")
|
||||
raise e
|
||||
if args.test_email_template:
|
||||
logger.info("Testing email template functionality...")
|
||||
kfinalise.test_email_template()
|
||||
else:
|
||||
try:
|
||||
track = kfinalise.process()
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred during finalisation, see stack trace below: {str(e)}")
|
||||
raise e
|
||||
|
||||
logger.info(f"Karaoke finalisation processing complete! Output files:")
|
||||
logger.info(f"")
|
||||
logger.info(f"Track: {track['artist']} - {track['title']}")
|
||||
logger.info(f"")
|
||||
logger.info(f"Working Files:")
|
||||
logger.info(f" Video With Vocals: {track['video_with_vocals']}")
|
||||
logger.info(f" Video With Instrumental: {track['video_with_instrumental']}")
|
||||
logger.info(f"")
|
||||
logger.info(f"Final Videos:")
|
||||
logger.info(f" Lossless 4K MP4 (PCM): {track['final_video']}")
|
||||
logger.info(f" Lossless 4K MKV (FLAC): {track['final_video_mkv']}")
|
||||
logger.info(f" Lossy 4K MP4 (AAC): {track['final_video_lossy']}")
|
||||
logger.info(f" Lossy 720p MP4 (AAC): {track['final_video_720p']}")
|
||||
|
||||
if "final_karaoke_cdg_zip" in track or "final_karaoke_txt_zip" in track:
|
||||
logger.info(f"")
|
||||
logger.info(f"Karaoke Files:")
|
||||
|
||||
if "final_karaoke_cdg_zip" in track:
|
||||
logger.info(f" Final CDG+MP3 ZIP: {track['final_karaoke_cdg_zip']}")
|
||||
logger.info(f" CDG+MP3 ZIP: {track['final_karaoke_cdg_zip']}")
|
||||
|
||||
if "final_karaoke_txt_zip" in track:
|
||||
logger.info(f" Final TXT+MP3 ZIP: {track['final_karaoke_txt_zip']}")
|
||||
logger.info(f" TXT+MP3 ZIP: {track['final_karaoke_txt_zip']}")
|
||||
|
||||
logger.info(f" Final Video with Title: {track['final_video']}")
|
||||
logger.info(f" Brand Code: {track['brand_code']}")
|
||||
logger.info(f" New Brand Code Directory: {track['new_brand_code_dir_path']}")
|
||||
if track["brand_code"]:
|
||||
logger.info(f"")
|
||||
logger.info(f"Organization:")
|
||||
logger.info(f" Brand Code: {track['brand_code']}")
|
||||
logger.info(f" New Directory: {track['new_brand_code_dir_path']}")
|
||||
|
||||
logger.info(f" YouTube URL: {track['youtube_url']}")
|
||||
logger.info(f" Folder Sharing Link: {track['brand_code_dir_sharing_link']}")
|
||||
if track["youtube_url"] or track["brand_code_dir_sharing_link"]:
|
||||
logger.info(f"")
|
||||
logger.info(f"Sharing:")
|
||||
|
||||
if track["brand_code_dir_sharing_link"]:
|
||||
logger.info(f" Folder Link: {track['brand_code_dir_sharing_link']}")
|
||||
try:
|
||||
time.sleep(1) # Brief pause between clipboard operations
|
||||
pyperclip.copy(track["brand_code_dir_sharing_link"])
|
||||
logger.info(f" (Folder link copied to clipboard)")
|
||||
except Exception as e:
|
||||
logger.warning(f" Failed to copy folder link to clipboard: {str(e)}")
|
||||
|
||||
if track["youtube_url"]:
|
||||
logger.info(f" YouTube URL: {track['youtube_url']}")
|
||||
try:
|
||||
pyperclip.copy(track["youtube_url"])
|
||||
logger.info(f" (YouTube URL copied to clipboard)")
|
||||
except Exception as e:
|
||||
logger.warning(f" Failed to copy YouTube URL to clipboard: {str(e)}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+146
-260
@@ -4,7 +4,10 @@ import logging
|
||||
import pkg_resources
|
||||
import tempfile
|
||||
import os
|
||||
import json
|
||||
import sys
|
||||
from karaoke_prep import KaraokePrep
|
||||
import asyncio
|
||||
|
||||
|
||||
def is_url(string):
|
||||
@@ -17,7 +20,7 @@ def is_file(string):
|
||||
return os.path.isfile(string)
|
||||
|
||||
|
||||
def main():
|
||||
async def async_main():
|
||||
logger = logging.getLogger(__name__)
|
||||
log_handler = logging.StreamHandler()
|
||||
log_formatter = logging.Formatter(fmt="%(asctime)s.%(msecs)03d - %(levelname)s - %(module)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
||||
@@ -29,6 +32,7 @@ def main():
|
||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, max_help_position=54),
|
||||
)
|
||||
|
||||
# Basic information
|
||||
parser.add_argument(
|
||||
"args",
|
||||
nargs="*",
|
||||
@@ -38,34 +42,73 @@ def main():
|
||||
package_version = pkg_resources.get_distribution("karaoke-prep").version
|
||||
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {package_version}")
|
||||
|
||||
# Logging & Debugging
|
||||
parser.add_argument(
|
||||
"--log_level",
|
||||
default="info",
|
||||
help="Optional: logging level, e.g. info, debug, warning (default: %(default)s). Example: --log_level=debug",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--filename_pattern",
|
||||
help="Required if processing a folder: Python regex pattern to extract track names from filenames. Must contain a named group 'title'. Example: --filename_pattern='(?P<index>\\d+) - (?P<title>.+).mp3'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--dry_run",
|
||||
action="store_true",
|
||||
help="Optional: perform a dry run without making any changes (default: %(default)s). Example: --dry_run=true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--model_names",
|
||||
"--render_bounding_boxes",
|
||||
action="store_true",
|
||||
help="Optional: render bounding boxes around text regions for debugging (default: %(default)s). Example: --render_bounding_boxes",
|
||||
)
|
||||
|
||||
# Input/Output Configuration
|
||||
parser.add_argument(
|
||||
"--filename_pattern",
|
||||
help="Required if processing a folder: Python regex pattern to extract track names from filenames. Must contain a named group 'title'. Example: --filename_pattern='(?P<index>\\d+) - (?P<title>.+).mp3'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output_dir",
|
||||
default=".",
|
||||
help="Optional: directory to write output files (default: <current dir>). Example: --output_dir=/app/karaoke",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no_track_subfolders",
|
||||
action="store_false",
|
||||
help="Optional: do NOT create a named subfolder for each track. Example: --no_track_subfolders",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--lossless_output_format",
|
||||
default="FLAC",
|
||||
help="Optional: lossless output format for separated audio (default: FLAC). Example: --lossless_output_format=WAV",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output_png",
|
||||
type=lambda x: (str(x).lower() == "true"),
|
||||
default=True,
|
||||
help="Optional: output PNG format for title and end images (default: %(default)s). Example: --output_png=False",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output_jpg",
|
||||
type=lambda x: (str(x).lower() == "true"),
|
||||
default=True,
|
||||
help="Optional: output JPG format for title and end images (default: %(default)s). Example: --output_jpg=False",
|
||||
)
|
||||
|
||||
# Audio Processing Configuration
|
||||
parser.add_argument(
|
||||
"--clean_instrumental_model",
|
||||
default="model_bs_roformer_ep_317_sdr_12.9755.ckpt",
|
||||
help="Optional: Model for clean instrumental separation (default: %(default)s).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--backing_vocals_models",
|
||||
nargs="+",
|
||||
default=[
|
||||
"UVR_MDXNET_KARA_2.onnx",
|
||||
"mel_band_roformer_karaoke_aufr33_viperx_sdr_10.1956.ckpt",
|
||||
"2_HP-UVR.pth",
|
||||
"model_bs_roformer_ep_317_sdr_12.9755.yaml",
|
||||
"MDX23C-8KFFT-InstVoc_HQ_2.ckpt",
|
||||
],
|
||||
help="Optional: list of model names to be used for separation (default: %(default)s). Example: --model_names UVR_MDXNET_KARA_2.onnx UVR-MDX-NET-Inst_HQ_4.onnx",
|
||||
default=["mel_band_roformer_karaoke_aufr33_viperx_sdr_10.1956.ckpt"],
|
||||
help="Optional: List of models for backing vocals separation (default: %(default)s).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--other_stems_models",
|
||||
nargs="+",
|
||||
default=["htdemucs_6s.yaml"],
|
||||
help="Optional: List of models for other stems separation (default: %(default)s).",
|
||||
)
|
||||
|
||||
default_model_dir_unix = "/tmp/audio-separator-models/"
|
||||
@@ -80,44 +123,16 @@ def main():
|
||||
default=default_model_dir,
|
||||
help="Optional: model files directory (default: %(default)s). Example: --model_file_dir=/app/models",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--output_dir",
|
||||
default=".",
|
||||
help="Optional: directory to write output files (default: <current dir>). Example: --output_dir=/app/karaoke",
|
||||
"--existing_instrumental",
|
||||
help="Optional: Path to an existing instrumental audio file. If provided, audio separation will be skipped.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--lossless_output_format",
|
||||
default="FLAC",
|
||||
help="Optional: lossless output format for separated audio (default: FLAC). Example: --lossless_output_format=WAV",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--lossy_output_format",
|
||||
default="MP3",
|
||||
help="Optional: lossy output format for separated audio (default: MP3). Example: --lossy_output_format=OGG",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--use_cuda",
|
||||
action="store_true",
|
||||
help="Optional: use Nvidia GPU with CUDA for separation (default: %(default)s). Example: --use_cuda=true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--use_coreml",
|
||||
action="store_true",
|
||||
help="Optional: use Apple Silicon GPU with CoreML for separation (default: %(default)s). Example: --use_coreml=true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--denoise",
|
||||
type=lambda x: (str(x).lower() == "true"),
|
||||
default=True,
|
||||
help="Optional: enable or disable denoising during separation (default: %(default)s). Example: --denoise=False",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--normalize",
|
||||
type=lambda x: (str(x).lower() == "true"),
|
||||
@@ -125,193 +140,47 @@ def main():
|
||||
help="Optional: enable or disable normalization during separation (default: %(default)s). Example: --normalize=False",
|
||||
)
|
||||
|
||||
# Hardware Acceleration
|
||||
parser.add_argument(
|
||||
"--no_track_subfolders",
|
||||
action="store_false",
|
||||
help="Optional: do NOT create a named subfolder for each track. Example: --no_track_subfolders",
|
||||
"--use_cuda",
|
||||
action="store_true",
|
||||
help="Optional: use Nvidia GPU with CUDA for separation (default: %(default)s). Example: --use_cuda=true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--intro_background_color",
|
||||
default="#000000",
|
||||
help="Optional: Background color for intro video (default: black). Example: --intro_background_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--intro_background_image",
|
||||
help="Optional: Path to background image for intro video. Overrides background color if provided. Example: --intro_background_image=path/to/image.jpg",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--intro_font",
|
||||
default="Montserrat-Bold.ttf",
|
||||
help="Optional: Font file for intro video (default: Montserrat-Bold.ttf). Example: --intro_font=AvenirNext-Bold.ttf",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--intro_artist_color",
|
||||
default="#ffdf6b",
|
||||
help="Optional: Font color for intro video artist text (default: #ffdf6b). Example: --intro_artist_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--intro_title_color",
|
||||
default="#ffffff",
|
||||
help="Optional: Font color for intro video title text (default: #ffffff). Example: --intro_title_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--existing_instrumental",
|
||||
help="Optional: Path to an existing instrumental audio file. If provided, audio separation will be skipped.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--existing_title_image",
|
||||
help="Optional: Path to an existing title image file. If provided, title image generation will be skipped.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_background_color",
|
||||
default="#000000",
|
||||
help="Optional: Background color for end screen video (default: black). Example: --end_background_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_background_image",
|
||||
help="Optional: Path to background image for end screen video. Overrides background color if provided. Example: --end_background_image=path/to/image.jpg",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_extra_text",
|
||||
default="THANK YOU FOR SINGING!",
|
||||
help="Optional: Extra text to display on the end screen video. Example: --end_extra_text='THANK YOU FOR WATCHING!'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_font",
|
||||
default="Montserrat-Bold.ttf",
|
||||
help="Optional: Font file for end screen video (default: Montserrat-Bold.ttf). Example: --end_font=AvenirNext-Bold.ttf",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_extra_text_color",
|
||||
default="#ff7acc",
|
||||
help="Optional: Font color for end screen video text (default: #ffffff). Example: --end_extra_text_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_artist_color",
|
||||
default="#ffdf6b",
|
||||
help="Optional: Font color for end screen video artist text (default: #ffdf6b). Example: --end_artist_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_title_color",
|
||||
default="#ffffff",
|
||||
help="Optional: Font color for end screen video title text (default: #ffffff). Example: --end_title_color=#123456",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--existing_end_image",
|
||||
help="Optional: Path to an existing end screen image file. If provided, end screen image generation will be skipped.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--title_video_duration",
|
||||
type=int,
|
||||
default=5,
|
||||
help="Optional: duration of the title video in seconds (default: 5). Example: --title_video_duration=10",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--end_video_duration",
|
||||
type=int,
|
||||
default=5,
|
||||
help="Optional: duration of the end video in seconds (default: 5). Example: --end_video_duration=10",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--title_initial_font_size",
|
||||
type=int,
|
||||
default=500,
|
||||
help="Optional: Initial font size for title video (default: 500). Example: --title_initial_font_size=600",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--title_top_padding",
|
||||
type=int,
|
||||
default=950,
|
||||
help="Optional: Top padding for title video (default: 950). Example: --title_top_padding=1000",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--title_title_padding",
|
||||
type=int,
|
||||
default=400,
|
||||
help="Optional: Title padding for title video (default: 400). Example: --title_title_padding=450",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--title_artist_padding",
|
||||
type=int,
|
||||
default=700,
|
||||
help="Optional: Artist padding for title video (default: 700). Example: --title_artist_padding=750",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--title_fixed_gap",
|
||||
type=int,
|
||||
default=150,
|
||||
help="Optional: Fixed gap for title video (default: 150). Example: --title_fixed_gap=200",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_initial_font_size",
|
||||
type=int,
|
||||
default=500,
|
||||
help="Optional: Initial font size for end video (default: 500). Example: --end_initial_font_size=600",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_top_padding",
|
||||
type=int,
|
||||
default=950,
|
||||
help="Optional: Top padding for end video (default: 950). Example: --end_top_padding=1000",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_title_padding",
|
||||
type=int,
|
||||
default=400,
|
||||
help="Optional: Title padding for end video (default: 400). Example: --end_title_padding=450",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_artist_padding",
|
||||
type=int,
|
||||
default=700,
|
||||
help="Optional: Artist padding for end video (default: 700). Example: --end_artist_padding=750",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_extra_text_padding",
|
||||
type=int,
|
||||
default=300,
|
||||
help="Optional: Extra text padding for end video (default: 600). Example: --end_extra_text_padding=650",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--end_fixed_gap",
|
||||
type=int,
|
||||
default=150,
|
||||
help="Optional: Fixed gap for end video (default: 150). Example: --end_fixed_gap=200",
|
||||
"--use_coreml",
|
||||
action="store_true",
|
||||
help="Optional: use Apple Silicon GPU with CoreML for separation (default: %(default)s). Example: --use_coreml=true",
|
||||
)
|
||||
|
||||
# Lyrics Configuration
|
||||
parser.add_argument(
|
||||
"--lyrics_artist",
|
||||
help="Optional: Override the artist name used for lyrics search. Example: --lyrics_artist='The Beatles'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--lyrics_title",
|
||||
help="Optional: Override the song title used for lyrics search. Example: --lyrics_title='Hey Jude'",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--lyrics_file",
|
||||
help="Optional: Path to a file containing lyrics to use instead of fetching from online. Example: --lyrics_file='/path/to/lyrics.txt'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip_lyrics",
|
||||
action="store_true",
|
||||
help="Optional: Skip fetching and processing lyrics. Example: --skip_lyrics",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip_transcription",
|
||||
action="store_true",
|
||||
help="Optional: Skip audio transcription but still attempt to fetch lyrics from Spotify/Genius. Example: --skip_transcription",
|
||||
)
|
||||
|
||||
# Style Configuration
|
||||
parser.add_argument(
|
||||
"--style_params_json",
|
||||
help="Optional: Path to JSON file containing style configuration for intro/end videos. Example: --style_params_json='/path/to/style_params.json'",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -359,63 +228,47 @@ def main():
|
||||
log_level = getattr(logging, args.log_level.upper())
|
||||
logger.setLevel(log_level)
|
||||
|
||||
if args.existing_instrumental:
|
||||
args.model_names = ["Custom"]
|
||||
|
||||
logger.info(f"KaraokePrep beginning with input_media: {input_media} artist: {artist} and title: {title}")
|
||||
|
||||
kprep = KaraokePrep(
|
||||
# Basic inputs
|
||||
artist=artist,
|
||||
title=title,
|
||||
input_media=input_media,
|
||||
filename_pattern=filename_pattern,
|
||||
# Logging & Debugging
|
||||
dry_run=args.dry_run,
|
||||
log_formatter=log_formatter,
|
||||
log_level=log_level,
|
||||
model_names=args.model_names,
|
||||
model_file_dir=args.model_file_dir,
|
||||
render_bounding_boxes=args.render_bounding_boxes,
|
||||
# Input/Output Configuration
|
||||
filename_pattern=filename_pattern,
|
||||
output_dir=args.output_dir,
|
||||
create_track_subfolders=args.no_track_subfolders,
|
||||
lossless_output_format=args.lossless_output_format,
|
||||
lossy_output_format=args.lossy_output_format,
|
||||
output_png=args.output_png,
|
||||
output_jpg=args.output_jpg,
|
||||
# Audio Processing Configuration
|
||||
existing_instrumental=args.existing_instrumental,
|
||||
clean_instrumental_model=args.clean_instrumental_model,
|
||||
backing_vocals_models=args.backing_vocals_models,
|
||||
other_stems_models=args.other_stems_models,
|
||||
model_file_dir=args.model_file_dir,
|
||||
denoise_enabled=args.denoise,
|
||||
normalization_enabled=args.normalize,
|
||||
# Hardware Acceleration
|
||||
use_cuda=args.use_cuda,
|
||||
use_coreml=args.use_coreml,
|
||||
normalization_enabled=args.normalize,
|
||||
denoise_enabled=args.denoise,
|
||||
create_track_subfolders=args.no_track_subfolders,
|
||||
existing_instrumental=args.existing_instrumental,
|
||||
existing_title_image=args.existing_title_image,
|
||||
existing_end_image=args.existing_end_image,
|
||||
title_video_duration=args.title_video_duration,
|
||||
intro_background_color=args.intro_background_color,
|
||||
intro_background_image=args.intro_background_image,
|
||||
intro_font=args.intro_font,
|
||||
intro_artist_color=args.intro_artist_color,
|
||||
intro_title_color=args.intro_title_color,
|
||||
title_initial_font_size=args.title_initial_font_size,
|
||||
title_top_padding=args.title_top_padding,
|
||||
title_title_padding=args.title_title_padding,
|
||||
title_artist_padding=args.title_artist_padding,
|
||||
title_fixed_gap=args.title_fixed_gap,
|
||||
end_video_duration=args.end_video_duration,
|
||||
end_extra_text=args.end_extra_text,
|
||||
end_background_color=args.end_background_color,
|
||||
end_background_image=args.end_background_image,
|
||||
end_font=args.end_font,
|
||||
end_extra_text_color=args.end_extra_text_color,
|
||||
end_artist_color=args.end_artist_color,
|
||||
end_title_color=args.end_title_color,
|
||||
end_initial_font_size=args.end_initial_font_size,
|
||||
end_top_padding=args.end_top_padding,
|
||||
end_title_padding=args.end_title_padding,
|
||||
end_artist_padding=args.end_artist_padding,
|
||||
end_extra_text_padding=args.end_extra_text_padding,
|
||||
end_fixed_gap=args.end_fixed_gap,
|
||||
# Lyrics Configuration
|
||||
lyrics_artist=args.lyrics_artist,
|
||||
lyrics_title=args.lyrics_title,
|
||||
lyrics_file=args.lyrics_file,
|
||||
skip_lyrics=args.skip_lyrics,
|
||||
skip_transcription=args.skip_transcription,
|
||||
# Style Configuration
|
||||
style_params_json=args.style_params_json,
|
||||
)
|
||||
|
||||
tracks = kprep.process()
|
||||
tracks = await kprep.process()
|
||||
|
||||
logger.info(f"Karaoke Prep complete! Output files:")
|
||||
|
||||
@@ -428,11 +281,44 @@ def main():
|
||||
logger.info(f" Lyrics: {track['lyrics']}")
|
||||
logger.info(f" Processed Lyrics: {track['processed_lyrics']}")
|
||||
|
||||
for model_name in args.model_names:
|
||||
logger.info(f" Instrumental: {track['separated_audio'][model_name]['instrumental']}")
|
||||
logger.info(f" Instrumental (Lossy): {track['separated_audio'][model_name]['instrumental_lossy']}")
|
||||
logger.info(f" Vocals: {track['separated_audio'][model_name]['vocals']}")
|
||||
logger.info(f" Vocals (Lossy): {track['separated_audio'][model_name]['vocals_lossy']}")
|
||||
logger.info(f" Separated Audio:")
|
||||
|
||||
# Clean Instrumental
|
||||
logger.info(f" Clean Instrumental Model:")
|
||||
for stem_type, file_path in track["separated_audio"]["clean_instrumental"].items():
|
||||
logger.info(f" {stem_type.capitalize()}: {file_path}")
|
||||
|
||||
# Other Stems
|
||||
logger.info(f" Other Stems Models:")
|
||||
for model, stems in track["separated_audio"]["other_stems"].items():
|
||||
logger.info(f" Model: {model}")
|
||||
for stem_type, file_path in stems.items():
|
||||
logger.info(f" {stem_type.capitalize()}: {file_path}")
|
||||
|
||||
# Backing Vocals
|
||||
logger.info(f" Backing Vocals Models:")
|
||||
for model, stems in track["separated_audio"]["backing_vocals"].items():
|
||||
logger.info(f" Model: {model}")
|
||||
for stem_type, file_path in stems.items():
|
||||
logger.info(f" {stem_type.capitalize()}: {file_path}")
|
||||
|
||||
# Combined Instrumentals
|
||||
logger.info(f" Combined Instrumentals:")
|
||||
for model, file_path in track["separated_audio"]["combined_instrumentals"].items():
|
||||
logger.info(f" Model: {model}")
|
||||
logger.info(f" Combined Instrumental: {file_path}")
|
||||
|
||||
|
||||
def main():
|
||||
# Set up logging
|
||||
logger = logging.getLogger(__name__)
|
||||
log_handler = logging.StreamHandler()
|
||||
log_formatter = logging.Formatter(fmt="%(asctime)s.%(msecs)03d - %(levelname)s - %(module)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
||||
log_handler.setFormatter(log_formatter)
|
||||
logger.addHandler(log_handler)
|
||||
|
||||
# Run the async main function using asyncio
|
||||
asyncio.run(async_main())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Generated
+3357
-1258
File diff suppressed because it is too large.
Load diff
+10
-2
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "karaoke-prep"
|
||||
version = "0.23.2"
|
||||
version = "0.42.0"
|
||||
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 <andrew@beveridge.uk>"]
|
||||
license = "MIT"
|
||||
@@ -12,6 +12,7 @@ documentation = "https://github.com/karaokenerds/karaoke-prep/blob/main/README.m
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.10,<3.13"
|
||||
torch = "<2.5"
|
||||
requests = ">=2"
|
||||
beautifulsoup4 = ">=4"
|
||||
yt-dlp = "*"
|
||||
@@ -23,11 +24,16 @@ google-api-python-client = "*"
|
||||
google-auth = "*"
|
||||
google-auth-oauthlib = "*"
|
||||
google-auth-httplib2 = "*"
|
||||
pyperclip = ">=1.8"
|
||||
thefuzz = ">=0.22"
|
||||
numpy = "^1"
|
||||
audio-separator = { version = ">=0.21.0", extras = ["cpu"] }
|
||||
lyrics-converter = ">=0.2.1"
|
||||
lyrics-transcriber = ">=0.34"
|
||||
kbputils = "^0.0.16"
|
||||
attrs = ">=24.2.0"
|
||||
cattrs = ">=24.1.2"
|
||||
toml = ">=0.10"
|
||||
argparse = ">=1.4.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
black = ">=23"
|
||||
@@ -36,6 +42,8 @@ poetry = "*"
|
||||
[tool.poetry.scripts]
|
||||
karaoke-prep = 'karaoke_prep.utils.prep_cli:main'
|
||||
karaoke-finalise = 'karaoke_prep.utils.finalise_cli:main'
|
||||
karaoke-auto = 'karaoke_prep.utils.auto_cli:main'
|
||||
karaoke-bulk = 'karaoke_prep.utils.bulk_cli:main'
|
||||
|
||||
[tool.black]
|
||||
line-length = 140
|
||||
|
||||
@@ -0,0 +1,714 @@
|
||||
[
|
||||
["This Is Me Smiling", "Prettier"],
|
||||
["Ленинград", "Алкаш"],
|
||||
["Cher", "Apples Don't Fall Far From The Tree"],
|
||||
["The Hush Sound", "Don't Wake Me Up"],
|
||||
["ABBA", "I Am The City"],
|
||||
["ABBA", "Under Attack"],
|
||||
["The Hush Sound", "A Dark Congregation"],
|
||||
["The Hush Sound", "As You Cry"],
|
||||
["The Hush Sound", "Boys Are Too Refined"],
|
||||
["The Hush Sound", "Break the Sky"],
|
||||
["The Hush Sound", "Carry Me Home"],
|
||||
["The Hush Sound", "City Traffic Puzzle"],
|
||||
["The Hush Sound", "Crawling Towards The Sun"],
|
||||
["The Hush Sound", "Echo"],
|
||||
["The Hush Sound", "Eileen"],
|
||||
["The Hush Sound", "Honey"],
|
||||
["The Hush Sound", "Hospital Bed Crawl"],
|
||||
["The Hush Sound", "Hourglass"],
|
||||
["The Hush Sound", "Hurricane"],
|
||||
["The Hush Sound", "Intro"],
|
||||
["The Hush Sound", "Lions Roar"],
|
||||
["The Hush Sound", "Love You Much Better"],
|
||||
["The Hush Sound", "Magnolia"],
|
||||
["The Hush Sound", "Medicine Man"],
|
||||
["The Hush Sound", "Molasses"],
|
||||
["The Hush Sound", "Momentum"],
|
||||
["The Hush Sound", "My Apologies"],
|
||||
["The Hush Sound", "Not Your Concern"],
|
||||
["The Hush Sound", "Out Through The Curtain"],
|
||||
["The Hush Sound", "Sweet Tangerine"],
|
||||
["The Hush Sound", "That's Okay"],
|
||||
["The Hush Sound", "The Artist"],
|
||||
["The Hush Sound", "The Market"],
|
||||
["The Hush Sound", "Tides Change"],
|
||||
["The Hush Sound", "Unsafe Safe"],
|
||||
["The Hush Sound", "We Intertwined"],
|
||||
["The Hush Sound", "Weeping Willow"],
|
||||
["The Hush Sound", "Where We Went Wrong"],
|
||||
["The Hush Sound", "Wine Red"],
|
||||
["The Hush Sound", "You Are The Moon"],
|
||||
["The Hush Sound", "Lighthouse"],
|
||||
["Allie X", "GLAM!"],
|
||||
["Lemaitre", "Rocket Girl (feat. Betty Who)"],
|
||||
["Just Jack", "253"],
|
||||
["Just Jack", "All Night Cinema"],
|
||||
["Just Jack", "Astronaut"],
|
||||
["Just Jack", "Blood"],
|
||||
["Just Jack", "Disco Friends"],
|
||||
["Just Jack", "Doctor Doctor"],
|
||||
["Just Jack", "Embers"],
|
||||
["Just Jack", "Glory Days"],
|
||||
["Just Jack", "Goth In The Disco"],
|
||||
["Just Jack", "Hold On"],
|
||||
["Just Jack", "I Talk Too Much"],
|
||||
["Just Jack", "Life Stories"],
|
||||
["Just Jack", "Lo And Behold"],
|
||||
["Just Jack", "Lost"],
|
||||
["Just Jack", "Mourning Morning"],
|
||||
["Just Jack", "No Time"],
|
||||
["Just Jack", "So Wrong"],
|
||||
["Just Jack", "Spectacular Failures"],
|
||||
["Just Jack", "Starz in Their Eyes"],
|
||||
["Just Jack", "Symphony of Sirens"],
|
||||
["Just Jack", "The Day I Died"],
|
||||
["Just Jack", "Writers Block"],
|
||||
[
|
||||
"Los Campesinos!",
|
||||
"This Is How You Spell \"HAHAHA, We Destroyed the Hopes and Dreams of a Generation of Faux-Romantics\""
|
||||
],
|
||||
["Los Campesinos!", "2007, The Year Punk Broke (My Heart)"],
|
||||
["Los Campesinos!", "And We Exhale and Roll Our Eyes in Unison"],
|
||||
["Los Campesinos!", "Broken Heartbeats Sounds Like Breakbeats"],
|
||||
["Los Campesinos!", "Death to Los Campesinos!"],
|
||||
["Los Campesinos!", "Don't Tell Me to Do the Math(s)"],
|
||||
["Los Campesinos!", "Drop It Doe Eyes"],
|
||||
["Los Campesinos!", "Knee Deep At ATP"],
|
||||
["Los Campesinos!", "My Year In Lists"],
|
||||
["Los Campesinos!", "Sweet Dreams, Sweet Cheeks"],
|
||||
["Los Campesinos!", "We Are All Accelerated Readers"],
|
||||
["Los Campesinos!", "You! Me! Dancing!"],
|
||||
["Mew", "156"],
|
||||
["Mew", "Am I Wry? No"],
|
||||
["Mew", "Behind the Drapes"],
|
||||
["Mew", "Comforting Sounds"],
|
||||
["Mew", "Eight Flew Over, One was Destroyed"],
|
||||
["Mew", "Her Voice is Beyond Her Years"],
|
||||
["Mew", "She Came Home for Christmas"],
|
||||
["Mew", "She Spider"],
|
||||
["Mew", "Snow Brigade"],
|
||||
["Mew", "Symmetry"],
|
||||
["of Montreal", "Gronlandic Edit"],
|
||||
["Idlewild", "(I Am) What I Am Not"],
|
||||
["Idlewild", "A Modern Way of Letting Go"],
|
||||
["Idlewild", "Actually It's Darkness"],
|
||||
["Idlewild", "American English"],
|
||||
["Idlewild", "Century After Century"],
|
||||
["Idlewild", "I Don't Have The Map"],
|
||||
["Idlewild", "I Never Wanted"],
|
||||
["Idlewild", "Idea Track"],
|
||||
["Idlewild", "In Remote Part , Scottish Fiction"],
|
||||
["Idlewild", "Let Me Sleep (Next To The Mirror)"],
|
||||
["Idlewild", "Listen To What You've Got"],
|
||||
["Idlewild", "Little Discourage"],
|
||||
["Idlewild", "Live in a Hiding Place"],
|
||||
["Idlewild", "Mistake Pageant"],
|
||||
["Idlewild", "Out of Routine"],
|
||||
["Idlewild", "Quiet Crown"],
|
||||
["Idlewild", "Roseability"],
|
||||
["Idlewild", "Rusty"],
|
||||
["Idlewild", "Stay the Same"],
|
||||
["Idlewild", "Tell Me Ten Words"],
|
||||
["Idlewild", "The Bronze Medal"],
|
||||
["Idlewild", "These Wooden Ideas"],
|
||||
["Idlewild", "You Held the World in Your Arms"],
|
||||
["Los Campesinos!", "A Heat Rash in the Shape of the Show Me State"],
|
||||
["Los Campesinos!", "All Your Kayfabe Friends"],
|
||||
["Los Campesinos!", "Coda A Burn Scar in the Shape of the Sooner State"],
|
||||
["Los Campesinos!", "Documented Minor Emotional Breakdown #1"],
|
||||
["Los Campesinos!", "Heart Swells:100-1"],
|
||||
["Los Campesinos!", "Heart Swells / Pacific Daylight Time"],
|
||||
["Los Campesinos!", "I Just Sighed, I Just Signed, Just So You Know"],
|
||||
["Los Campesinos!", "I Warned You, Do Not Make an Enemy of Me"],
|
||||
["Los Campesinos!", "In Medias Res"],
|
||||
[
|
||||
"Los Campesinos!",
|
||||
"It's Never That Easy Though, Is It (Song For The Other Kurt)"
|
||||
],
|
||||
["Los Campesinos!", "Miserabilia"],
|
||||
["Los Campesinos!", "Plan A"],
|
||||
["Los Campesinos!", "Romance is Boring"],
|
||||
["Los Campesinos!", "Straight in at 101"],
|
||||
["Los Campesinos!", "The End Of The Asterisk"],
|
||||
["Los Campesinos!", "The Sea is a Good Place to Think of the Future"],
|
||||
["Los Campesinos!", "There Are Listed Buildings"],
|
||||
["Los Campesinos!", "This is a Flag, There is No Wind"],
|
||||
["Los Campesinos!", "Ways To Make It Through The Wall"],
|
||||
["Los Campesinos!", "We Are Beautiful, We Are Doomed"],
|
||||
["Los Campesinos!", "We've Got Your Back"],
|
||||
["Los Campesinos!", "Who Fell Asleep In"],
|
||||
["Los Campesinos!", "You'll Need Those Fingers For Crossing"],
|
||||
["Miracles of Modern Science", "Bossa Supernova"],
|
||||
["Miracles of Modern Science", "Eating Me Alive"],
|
||||
["Miracles of Modern Science", "Friend Of The Animals"],
|
||||
["Miracles of Modern Science", "I Found Space"],
|
||||
["Miracles of Modern Science", "Luminol"],
|
||||
["Miracles of Modern Science", "MOMS AWAY!"],
|
||||
["Miracles of Modern Science", "Quantum Of Solace"],
|
||||
["Miracles of Modern Science", "Secret Track"],
|
||||
["Miracles of Modern Science", "Space Chopper"],
|
||||
["Miracles of Modern Science", "Strangerous"],
|
||||
["Miracles of Modern Science", "Tensity"],
|
||||
["Miracles of Modern Science", "The Moon & Australia"],
|
||||
["Nia Archives", "(Over)Thinking"],
|
||||
["Nia Archives", "18 & Over"],
|
||||
["Nia Archives", "Crossroads"],
|
||||
["Nia Archives", "Don't Kid Urself"],
|
||||
["Nia Archives", "Gud Gudbyez"],
|
||||
["Nia Archives", "Headz Gone West"],
|
||||
["Nia Archives", "Luv Like"],
|
||||
["Nia Archives", "Part Of Me"],
|
||||
["Nia Archives", "Sober Feels"],
|
||||
["This Is Me Smiling", "A Better Way to Fall in Love"],
|
||||
["This Is Me Smiling", "Alive in the Chase"],
|
||||
["This Is Me Smiling", "Ephemera"],
|
||||
["This Is Me Smiling", "Feelin' the Time Pass By"],
|
||||
["This Is Me Smiling", "For When You Don't Hear It Right"],
|
||||
["This Is Me Smiling", "Goodbye to Each New Day"],
|
||||
["This Is Me Smiling", "Matter to Matter"],
|
||||
["This Is Me Smiling", "Mixin' Up Adjectives"],
|
||||
["This Is Me Smiling", "Say What You're Gonna Say"],
|
||||
["This Is Me Smiling", "So Excited to Sleep"],
|
||||
["This Is Me Smiling", "Up in All Directions"],
|
||||
["Bug Hunter", "Dear McCracken"],
|
||||
["Ken Ashcorp", "Burgz"],
|
||||
["Ken Ashcorp", "Absolute Territory"],
|
||||
["Ken Ashcorp", "I'm Your Slave"],
|
||||
["Mew", "A Dark Design"],
|
||||
["Mew", "An Envoy To The Open Fields"],
|
||||
["Mew", "Apocalypso"],
|
||||
["Mew", "Chinaberry Tree"],
|
||||
["Mew", "Fox Cub"],
|
||||
["Mew", "Louise Louisa"],
|
||||
["Mew", "Saviours Of Jazz Ballet"],
|
||||
["Mew", "Special"],
|
||||
["Mew", "The Seething Rain Weeps For You"],
|
||||
["Mew", "The Zookeeper's Boy"],
|
||||
["Mew", "White Lips Kissed"],
|
||||
["Mew", "Why Are You Looking Grave"],
|
||||
["Get Cape. Wear Cape. Fly", "An Oak Tree"],
|
||||
["Get Cape. Wear Cape. Fly", "Call Me Ishmael"],
|
||||
["Get Cape. Wear Cape. Fly", "Get Cape. Wear Cape. Fly"],
|
||||
["Get Cape. Wear Cape. Fly", "Glasshouses"],
|
||||
["Get Cape. Wear Cape. Fly", "I-Spy"],
|
||||
[
|
||||
"Get Cape. Wear Cape. Fly",
|
||||
"If I Had £1 For Every Stale Song Title I'd Be 30 Short Of Getting Out Of This Mess"
|
||||
],
|
||||
["Get Cape. Wear Cape. Fly", "Once More With Feeling"],
|
||||
[
|
||||
"Get Cape. Wear Cape. Fly",
|
||||
"The Chronicles Of A Bohemian Teenager (Part Two)"
|
||||
],
|
||||
[
|
||||
"Get Cape. Wear Cape. Fly",
|
||||
"The Chronicles Of A Bohemian Teenager (Part One)"
|
||||
],
|
||||
["Get Cape. Wear Cape. Fly", "The Lighthousekeeper"],
|
||||
["Get Cape. Wear Cape. Fly", "War Of The Worlds"],
|
||||
["Get Cape. Wear Cape. Fly", "Whitewash Is Brainwash"],
|
||||
["Hi I'm Case", "Smoke Damage (Youtube version)"],
|
||||
["Ken Ashcorp", "Wear"],
|
||||
["Hi I'm Case", "Smoke Damage (Spotify version)"],
|
||||
["Neil Diamond", "The Look Of Love"],
|
||||
["Amy Winehouse", "Valerie (Short Version)"],
|
||||
["Anastacia", "I'm Outta Love (Short Version)"],
|
||||
["Calum Scott", "Dancing On My Own (Short Version)"],
|
||||
["Ed Sheeran", "Shivers (Short Version)"],
|
||||
["Eminem", "Without Me (Short Version)"],
|
||||
["Gnarls Barkley", "Crazy (Short Version)"],
|
||||
["Jess Glynne", "Hold My Hand (Short Version)"],
|
||||
["Kenny Loggins", "Footloose (Short Version)"],
|
||||
["Kings Of Leon", "Sex on Fire (Short Version)"],
|
||||
["Lady Gaga", "Born This Way (Short Version)"],
|
||||
["Miley Cyrus", "Jolene (Short Version)"],
|
||||
["Miley Cyrus", "Wrecking Ball (Short Version)"],
|
||||
["Robbie Williams", "Angels (Short Version)"],
|
||||
["Shakira", "Whenever, Wherever (Short Version)"],
|
||||
["Shania Twain", "Man! I Feel Like A Woman (Short Version)"],
|
||||
["Shirley Bassey", "Big Spender (Short Version)"],
|
||||
["The Killers", "Mr. Brightside (Short Version)"],
|
||||
["The Pussycat Dolls", "Sway (Short Version)"],
|
||||
["Twenty One Pilots", "Stressed Out (Short Version)"],
|
||||
["Wheatus", "Teenage Dirtbag (Short Version)"],
|
||||
["Christina Stürmer", "Nie Genug"],
|
||||
["James Brown", "It's a Man's World (Short Version)"],
|
||||
["Jerry Lee Lewis", "Great Balls Of Fire (Short Version)"],
|
||||
["Melanie Martinez", "Toxic (Short Version)"],
|
||||
["Melissa Etheridge", "Bring Me Some Water (Short Version)"],
|
||||
["Queen", "Crazy Little Thing Called Love (Short Version)"],
|
||||
["Tina Turner", "Proud Mary (Short Version)"],
|
||||
["Tina Turner", "The Best (Short Version)"],
|
||||
["Tom Jones", "Help Yourself (Short Version)"],
|
||||
["Tom Jones", "Sex Bomb (Short Version)"],
|
||||
["Andreas Gabalier", "Hulapalu (Short Version)"],
|
||||
["Christina Stürmer", "Nie Genug (Short Version)"],
|
||||
["Die Draufgänger", "Cordula Grün (Short Version)"],
|
||||
["Jimi Jamison", "I'm Always Here (Short Version)"],
|
||||
["Jürgen Drews", "Ein Bett im Kornfeld"],
|
||||
["Jürgen Drews", "Ein Bett im Kornfeld (Short Version)"],
|
||||
["STS", "Kalt Und Kälter (Short Version)"],
|
||||
["STS", "Kalt Und Kälter"],
|
||||
["Udo Jürgens", "Aber bitte mit Sahne"],
|
||||
["Udo Jürgens", "Aber bitte mit Sahne (Short Version)"],
|
||||
["Bryan Adams", "Summer of '69 (Short Version)"],
|
||||
["Dylan Emmet", "Lose This"],
|
||||
["Loosey LaDuca", "Let Loose"],
|
||||
["Against Me", "People Who Died"],
|
||||
["Eleven Hundred Springs", "Thunderbird Will Do Just Fine"],
|
||||
["Etherwood", "Begin By Letting Go"],
|
||||
["Foy Vance", "She Burns"],
|
||||
["Frightened Rabbit", "Late March Death March"],
|
||||
["George Barnett", "Stone Cold Classic"],
|
||||
["Get Cape. Wear Cape. Fly", "Better Things (ft. Kate Nash)"],
|
||||
["Get Cape. Wear Cape. Fly", "Could've Seen It All"],
|
||||
["Get Cape. Wear Cape. Fly", "Find The Time"],
|
||||
["Get Cape. Wear Cape. Fly", "I Could Build You A Tower"],
|
||||
["Get Cape. Wear Cape. Fly", "Keep Singing Out"],
|
||||
["Get Cape. Wear Cape. Fly", "Let The Journey Begin"],
|
||||
["Get Cape. Wear Cape. Fly", "Moving Forward"],
|
||||
["Get Cape. Wear Cape. Fly", "Postcards From Catalunya"],
|
||||
[
|
||||
"Get Cape. Wear Cape. Fly",
|
||||
"The Children Are (The Consumers Of) The Future"
|
||||
],
|
||||
["Get Cape. Wear Cape. Fly", "This Could Be All"],
|
||||
["Get Cape. Wear Cape. Fly", "Waiting For The Monster To Drown"],
|
||||
["Get Cape. Wear Cape. Fly", "Window Of Your Mind"],
|
||||
["Get Cape. Wear Cape. Fly", "Young And Lovestruck"],
|
||||
["K-Os", "The Rain"],
|
||||
["Nothing But Thieves", "Pop The Balloon"],
|
||||
["Robbie Basho", "Blue Crystal Fire"],
|
||||
["Smino", "Lee and Lovie"],
|
||||
["The Skints", "Murderer"],
|
||||
["Xan Griffin", "Capricorn (ft. WOLFE)"],
|
||||
["Pulp", "Cocaine Socialism"],
|
||||
["Random Hand", "Play Some Ska"],
|
||||
["Sexyy Red, Nicki Minaj & Tay Keith", "Pound Town 2"],
|
||||
["Tori Amos", "Liquid Diamonds"],
|
||||
["Frightened Rabbit", "Music Now"],
|
||||
["Frightened Rabbit", "Housing (out)"],
|
||||
["Frightened Rabbit", "The Modern Leper"],
|
||||
["Frightened Rabbit", "A Lick Of Paint"],
|
||||
["Frightened Rabbit", "The Greys"],
|
||||
["Frightened Rabbit", "Head Rolls Off"],
|
||||
["Frightened Rabbit", "Backyard Skulls"],
|
||||
["Frightened Rabbit", "The Wreck"],
|
||||
["Frightened Rabbit", "My Backwards Walk"],
|
||||
["Frightened Rabbit", "Be Less Rude"],
|
||||
["Frightened Rabbit", "Die Like A Rich Boy"],
|
||||
["Frightened Rabbit", "State Hospital"],
|
||||
["Frightened Rabbit", "Skip the Youth"],
|
||||
["Frightened Rabbit", "Yes, I Would"],
|
||||
["Frightened Rabbit", "Floating in the Forth"],
|
||||
["Frightened Rabbit", "Nitrous Gas"],
|
||||
["Frightened Rabbit", "Break"],
|
||||
["Frightened Rabbit", "Things"],
|
||||
["Frightened Rabbit", "Nothing Like You"],
|
||||
["Frightened Rabbit", "Good Arms vs Bad Arms"],
|
||||
["Frightened Rabbit", "Foot Shooter"],
|
||||
["Frightened Rabbit", "The Twist"],
|
||||
["Frightened Rabbit", "The Loneliness and the Scream"],
|
||||
["Frightened Rabbit", "Swim Until You Can't See Land"],
|
||||
["Frightened Rabbit", "An Otherwise Disappointing Life"],
|
||||
["Frightened Rabbit", "Holy"],
|
||||
["Frightened Rabbit", "Behave!"],
|
||||
["Frightened Rabbit", "Old Old Fashioned"],
|
||||
["Frightened Rabbit", "Yawns"],
|
||||
["Frightened Rabbit", "I Feel Better"],
|
||||
["Frightened Rabbit", "Woke Up Hurting"],
|
||||
["Frightened Rabbit", "Dead Now"],
|
||||
["Frightened Rabbit", "Poke"],
|
||||
["Frightened Rabbit", "400 Bones"],
|
||||
["Frightened Rabbit", "Little Drum"],
|
||||
["Frightened Rabbit", "Fast Blood"],
|
||||
["Frightened Rabbit", "Square 9"],
|
||||
["Frightened Rabbit", "I Wish I Was Sober"],
|
||||
["Frightened Rabbit", "The Oil Slick"],
|
||||
["Frightened Rabbit", "Still Want To Be Here"],
|
||||
["Frightened Rabbit", "Blood Under The Bridge"],
|
||||
["Frightened Rabbit", "Death Dream"],
|
||||
["Frightened Rabbit", "Wait 'Til The Morning"],
|
||||
["Frightened Rabbit", "Not Miserable"],
|
||||
["Frightened Rabbit", "Snake"],
|
||||
["Frightened Rabbit", "Acts of Man"],
|
||||
["Frightened Rabbit", "Living in Colour"],
|
||||
["Frightened Rabbit", "Housing (in)"],
|
||||
["Frightened Rabbit", "The Wrestle"],
|
||||
["Frightened Rabbit", "Go Go Girls"],
|
||||
["Frightened Rabbit", "December's Traditions"],
|
||||
["Frightened Rabbit", "Lump Street"],
|
||||
["Frightened Rabbit", "Keep Yourself Warm"],
|
||||
["Frightened Rabbit", "The Woodpile"],
|
||||
["Frightened Rabbit", "Get Out"],
|
||||
["Judas Priest", "Living Bad Dreams"],
|
||||
["The Spits", "Bring Me Down"],
|
||||
["Voltaire", "Feathery Wings"],
|
||||
["City and Colour", "The Death of Me"],
|
||||
["Was (Not Was)", "Out Come the Freaks"],
|
||||
["Bon Jovi", "Hallelujah"],
|
||||
["Marilyn Dagenais", "Je serai là"],
|
||||
["Marilyn Dagenais", "J't'écrirai pas"],
|
||||
["A Lost People", "Big Booty Bitches"],
|
||||
["Annika Norlin", "Failure"],
|
||||
["Ascension", "Monsters"],
|
||||
["Bonnie Prince Billy and Tortoise", "Pancho"],
|
||||
["Brandi Carlile", "Raise Hell"],
|
||||
["Britt Daniel", "Let the Distance Bring Us Together"],
|
||||
["Cyn", "Drinks"],
|
||||
["Dan Wriggins", "All Used Up"],
|
||||
["Davey Dynamite & Absent", "Solidarity Forever"],
|
||||
["Elliott Smith", "Strung Out Again"],
|
||||
["Emperor X", "Sad React"],
|
||||
["Girls", "Hellhole Ratrace"],
|
||||
["Hercules & Love Affair", "Iris"],
|
||||
["Iris DeMent", "Easy's Gettin' Harder Every Day"],
|
||||
["Iris DeMent", "Let the Mystery Be"],
|
||||
["Iris DeMent", "Wasteland of the Free"],
|
||||
["Joanna Newsom", "Inflammatory Writ"],
|
||||
["Jukebox The Ghost", "Jumpstarted"],
|
||||
["Kevin Devine", "Splittin’ Up Christmas"],
|
||||
["Kirin J Callinan", "Life Is Life"],
|
||||
["MJ Lenderman", "TLC Cagematch"],
|
||||
["Molly Hatchet", "Sailor"],
|
||||
["Necro", "Pussy Is My Weakness"],
|
||||
["Nevermore", "The Heart Collector"],
|
||||
["New Found Glory", "Sincerely Me"],
|
||||
["New Radicals", "I Hope I Didn't Just Give Away The Ending"],
|
||||
["No Doubt", "Six Feet Under"],
|
||||
["Petey", "Dont Tell The Boys"],
|
||||
["Randy Newman", "A Wedding in Cherokee County"],
|
||||
["Reverend Horton Heat", "Wiggle Stick"],
|
||||
["Rough Cutt", "Dreamin' Again"],
|
||||
["Steve Earle", "Christmas in Washington"],
|
||||
["The Buttertones", "Baby Doll"],
|
||||
["The Buttertones", "Eros"],
|
||||
["Whiskey Myers", "Broken Window Serenade"],
|
||||
["Yoko Kanno", "Whats it For"],
|
||||
["Mac McCaughan & Annie Hayden", "Down We Go"],
|
||||
["The Buttertones", "You and Your Knife"],
|
||||
["The Doubleclicks", "Really Big Chickens"],
|
||||
["Tony All", "At The Party"],
|
||||
["Tony All", "Guitar Case"],
|
||||
["Velvet Pony", "LESBIAN PONIES WITH WEAPONS"],
|
||||
["Waxahatchee", "Noccalula"],
|
||||
["David Bowie", "I Know It’s Gonna Happen Someday"],
|
||||
["Mary Heather Hickman", "Treasure"],
|
||||
["Ray Price", "The Wind Beneath My Wings"],
|
||||
["The Avett Brothers", "Ain't No Man"],
|
||||
["Dropout Kings", "Scratch & Claw"],
|
||||
["Gogol Bordello", "Not a Crime"],
|
||||
["Sparks", "Girl from Germany"],
|
||||
["Sparks", "Under the Table with Her"],
|
||||
["Streetlight Manifesto", "One Foot on the Gas, One Foot in the Grave"],
|
||||
["The Doors", "Not to touch the earth"],
|
||||
["Weird Al Yankovic", "Money for Nothing Beverly Hillbillies"],
|
||||
["Adam Sandler", "Mr. Bake-O"],
|
||||
["Eydie Gormé", "The Gentleman is a Dope"],
|
||||
["Eydie Gormé", "What Did I Have That I Don't Have"],
|
||||
["Rickie Lee Jones", "The Ballad Of The Sad Young Men"],
|
||||
["Eddie Cochran", "Three Stars"],
|
||||
["Lil Durk", "Broadway Girls"],
|
||||
["Luude", "Down Under"],
|
||||
[
|
||||
"Taylor Swift",
|
||||
"We Are Never Ever Getting Back Together (Taylor's Version)"
|
||||
],
|
||||
["The Fray", "Never Say Never"],
|
||||
["The Ghost Club", "See Below"],
|
||||
["General Levy", "Incredible (50% Volume Vocals)"],
|
||||
["General Levy", "Incredible"],
|
||||
["Marilyn Dagenais", "Chanson pour Papa"],
|
||||
["Royal Navy", "Heart of Oak"],
|
||||
["Tiamat", "Cain"],
|
||||
["Marilyn Dagenais", "You Make Me Sing"],
|
||||
["Young and Restless", "B Girls"],
|
||||
["Bug Hunter", "Pinecones"],
|
||||
["Streetlight Manifesto", "With Any Sort of Certainty"],
|
||||
["Marvin Gaye", "God is Love"],
|
||||
["Ben&Ben", "Maybe the Night"],
|
||||
["Blink 182", "Fell In Love"],
|
||||
["Blink 182", "Turpentine"],
|
||||
["Bryson Tiller", "Right My Wrongs"],
|
||||
["Chris Stapleton", "Joy of My Life"],
|
||||
["Marilyn Dagenais", "L'hiver"],
|
||||
["Metric", "Who Would You Be For Me"],
|
||||
["Rex Orange County", "Happiness"],
|
||||
["Sheff G", "Weight on Me"],
|
||||
["Taylor Swift", "I Knew You Were Trouble (Taylor's Version)"],
|
||||
["Taylor Swift", "You Belong With Me (Taylor's Version)"],
|
||||
["The 1975", "Robbers"],
|
||||
["Unknown", "Before the Screen Reads Fin"],
|
||||
["ACDC", "Gone Shootin'"],
|
||||
["Ozzy Osbourne", "You're No Different"],
|
||||
["Alice Cooper", "He's Back (The Man Behind The Mask)"],
|
||||
["Echo and The Bunnymen", "New Direction"],
|
||||
["Iggy Pop", "Tell Me a Story"],
|
||||
["Left Boy", "Security Check"],
|
||||
["The Lemonheads", "If I Could Talk I’d Tell You"],
|
||||
["They Might Be Giants", "Dinner Bell"],
|
||||
["XTC", "Scissor Man"],
|
||||
["XTC", "The Smartest Monkeys"],
|
||||
["Marilyn Dagenais", "Un peu de lumière"],
|
||||
["Bad Lip Reading", "Black Umbrella"],
|
||||
["Bruno Mars", "The Lazy Song (Non-Lazy Parody)"],
|
||||
["Marilyn Dagenais", "Si je t'aime"],
|
||||
["Jerry Lee Lewis", "Meat Man"],
|
||||
["Shovels & Rope", "Birmingham"],
|
||||
["Wolfe Tones", "Rock On Rockall"],
|
||||
["James Rado", "Where Do I Go? (From Hair)"],
|
||||
["Andrea Bocelli", "Gloria in Excelsis Deo"],
|
||||
["ABBA", "The Day Before You Came"],
|
||||
["Fleet Foxes", "He Doesn’t Know Why"],
|
||||
["The Drifters", "Up On The Roof"],
|
||||
["The Seekers", "California Dreamin'"],
|
||||
["Fleet Foxes", "Silver Dagger"],
|
||||
["She Wants Revenge", "Broken Promises For Broken Hearts"],
|
||||
["Ken Ashcorp", "On The Rocks"],
|
||||
["Z-Ro", "Mo City Don Freestyle"],
|
||||
["The Time", "Cool"],
|
||||
["Urban Cookie Collective", "The Key, The Secret"],
|
||||
["Melissa Etheridge", "Meet Me In The Back"],
|
||||
["Garfunkel And Oates", "I Get to Do It With You"],
|
||||
["A Fine Frenzy", "Come On, Come Out"],
|
||||
["A Fine Frenzy", "Rangers"],
|
||||
["Ken Ashcorp", "PVP"],
|
||||
["A Fine Frenzy", "Almost Lover"],
|
||||
["A Fine Frenzy", "You Picked Me"],
|
||||
["Peach PRC", "God Is A Freak"],
|
||||
["Righteous Brothers", "See That Girl"],
|
||||
["Blue Eyed Blondes", "Maneater"],
|
||||
["piri & tommy", "on & on"],
|
||||
["Sudley ft. piri", "fumble"],
|
||||
["A Fine Frenzy", "Ashes And Wine"],
|
||||
["A Fine Frenzy", "The Minnow & The Trout"],
|
||||
["Tame Impala", "The Boat I Row"],
|
||||
["Spinal Tap", "Rainy Day Sun"],
|
||||
["Röyksopp", "Running To The Sea"],
|
||||
["Röyksopp", "Oh, Lover"],
|
||||
["Röyksopp", "Monument"],
|
||||
["Röyksopp", "Only This Moment"],
|
||||
["Röyksopp", "The Girl And The Robot"],
|
||||
["Röyksopp", "49 Percent"],
|
||||
["Maisi & piri", "head"],
|
||||
["Django Django", "Default"],
|
||||
["Django Django", "Hail Bop"],
|
||||
["piri & tommy", "silver lining"],
|
||||
["Daniel O'Donnell", "Galway Bay"],
|
||||
["Daniel O'Donnell", "I'll Take You Home Again Kathleen"],
|
||||
["Daniel O'Donnell", "Mountains of Mourne"],
|
||||
[
|
||||
"Daniel O'Donnell",
|
||||
"Medley: It's a Long Way to Tipperary / Pack up Your Troubles / If You're Irish, Come into the Parlour"
|
||||
],
|
||||
["Jackson Singleton", "Disguise"],
|
||||
["Ken Ashcorp", "Dare You To Love Me"],
|
||||
["A Fine Frenzy", "Borrowed Time"],
|
||||
["A Fine Frenzy", "Last Of Days"],
|
||||
["A Fine Frenzy", "Hope For The Hopeless"],
|
||||
["A Fine Frenzy", "Liar, Liar"],
|
||||
["A Fine Frenzy", "Lifesize"],
|
||||
["A Fine Frenzy", "Near To You"],
|
||||
["A Fine Frenzy", "Think Of You"],
|
||||
["A Fine Frenzy", "Whisper"],
|
||||
["piri & tommy", "settle"],
|
||||
["piri & tommy", "soft spot"],
|
||||
["piri & tommy", "sunlight"],
|
||||
["piri & tommy", "beachin"],
|
||||
["piri & tommy", "player 2"],
|
||||
["piri & tommy", "can we"],
|
||||
["piri & tommy", "easy"],
|
||||
["piri & tommy", "say it"],
|
||||
["piri & tommy", "slowly but surely"],
|
||||
["piri & tommy", "words"],
|
||||
["piri & tommy", "nice 2 me"],
|
||||
["Tony Bennett & k.d.lang", "What A Wonderful World"],
|
||||
["Ying Yang Twins", "Georgia Dome"],
|
||||
[
|
||||
"Daniel O'Donnell",
|
||||
"Medley: Galway Bay, The Mountains Of Mourne, I'll Take You Home Again Kathleen"
|
||||
],
|
||||
["The Beatles", "In My Life"],
|
||||
["Truck Stop", "Komm her du bist mein Cowboy"],
|
||||
["Linda Feller", "Du gabst ihr deinen Namen"],
|
||||
["Victoria OB", "Yeshua"],
|
||||
["Matthew Morrison", "Somewhere Over the Rainbow"],
|
||||
["fun.", "Benson Hedges"],
|
||||
["fun.", "All the Pretty Girls"],
|
||||
["fun.", "At Least I'm Not as Sad (As I Used to Be)"],
|
||||
["fun.", "I Wanna Be the One"],
|
||||
["fun.", "Walking the Dog"],
|
||||
["fun.", "Light a Roman Candle with Me"],
|
||||
["fun.", "Barlights"],
|
||||
["fun.", "Take Your Time (Coming Home)"],
|
||||
["Tom Astor", "Sturm Und Drang"],
|
||||
["Titellied der gleichnamigen Fernsehserie 1962", "Bonanza"],
|
||||
["Linda Feller", "Billy Bob's Texas"],
|
||||
["ABBA", "Dancing Queen"],
|
||||
["Ken Ashcorp", "Touch Fluffy Tail"],
|
||||
["Mavi Phoenix", "Pretty Life (Whsprs Cover)"],
|
||||
["Jimi Hendrix", "Remember"],
|
||||
["Smash Mouth", "All Star"],
|
||||
["Smash Mouth", "All Star (with Shrek)"],
|
||||
["The Silent Comedy", "Enemies Multiply"],
|
||||
["ABBA", "Ring Ring"],
|
||||
["ABBA", "Another Town, Another Train"],
|
||||
["ABBA", "Disillusion"],
|
||||
["ABBA", "People Need Love"],
|
||||
["Frank Sinatra", "New York, New York"],
|
||||
["ABBA", "I Saw It In The Mirror"],
|
||||
["ABBA", "Nina, Pretty Ballerina"],
|
||||
["ABBA", "Love Isn’t Easy (But It Sure Is Hard Enough)"],
|
||||
["ABBA", "Me And Bobby And Bobby’s Brother"],
|
||||
["ABBA", "He Is Your Brother"],
|
||||
["ABBA", "She’s My Kind Of Girl"],
|
||||
["ABBA", "I Am Just A Girl"],
|
||||
["ABBA", "Rock ’N Roll Band"],
|
||||
["ABBA", "Ring Ring (Bara Du Slog En Signal) (Swedish Version)"],
|
||||
["ABBA", "Åh, Vilka Tider"],
|
||||
["ABBA", "Merry‐Go‐Round"],
|
||||
["ABBA", "Santa Rosa"],
|
||||
["ABBA", "Ring Ring (Spanish Version)"],
|
||||
["ABBA", "Wer Im Wartesaal Der Liebe Steht"],
|
||||
["ABBA", "Ring Ring (German Version)"],
|
||||
["Fleet Foxes", "Montezuma"],
|
||||
["Harald Juhnke", "Berlin, Berlin"],
|
||||
["Shoshana Bean", "Strange Thunder"],
|
||||
["Michael Callen", "Crazy World"],
|
||||
["Michael Callen", "Wish I Had A Dime"],
|
||||
["The Blasters", "One Bad Stud"],
|
||||
["Michael Callen", "The Healing Power Of Love"],
|
||||
["Meat Loaf", "Braver Than We Are"],
|
||||
["Harald Juhnke", "Berlin, Berlin (Lisa, Milan)"],
|
||||
["Friday", "The Ballad Of Skinny Linguine"],
|
||||
["Emery", "The Ponytail Parades"],
|
||||
["Black Sabbath", "Buried Alive"],
|
||||
["Aloha from space", "Storm Troopin'"],
|
||||
["NerdOut", "Bounty"],
|
||||
["Charles Strouse and Lee Adams", "Han's Your Man"],
|
||||
["Juliane Werding", "Man muß Das Leben Eben Nehmen, Wie Das Leben Eben Ist"],
|
||||
["Aurelio Voltaire", "Butterfly"],
|
||||
["Blind Guardian", "Violent Shadows"],
|
||||
["Jonny Hill & Linda Feller", "Zusammenstehn (Duet)"],
|
||||
["Tori Amos", "Big Wheel"],
|
||||
["Chairlift", "Bruises"],
|
||||
["Jonny Hill & Linda Feller", "London"],
|
||||
["Life Languages", "The Mover Song"],
|
||||
["Life Languages", "The Responder Song"],
|
||||
["Life Languages", "The Contemplator Song"],
|
||||
["Life Languages", "The Doer Song"],
|
||||
["Life Languages", "The Shaper Song"],
|
||||
["Life Languages", "The Influencer Song"],
|
||||
["Life Languages", "The Producer Song"],
|
||||
["The Amazing Devil", "That Unwanted Animal"],
|
||||
["Bobby Capo", "Locamente Enamorado"],
|
||||
["Dagmar", "Lass mich damit bloß in Ruhe"],
|
||||
["Los Campesinos!", "You! Me! Dancing! (Daytrotter Session)"],
|
||||
["Joe P", "Leaves"],
|
||||
["ABBA", "Waterloo"],
|
||||
["ABBA", "Sitting In The Palmtree"],
|
||||
["ABBA", "King Kong Song"],
|
||||
["ABBA", "Hasta Mañana"],
|
||||
["ABBA", "My Mama Said"],
|
||||
["ABBA", "Dance (While The Music Still Goes On)"],
|
||||
["ABBA", "Honey, Honey"],
|
||||
["Thomas Borchert", "I Know Those Eyes / This Man Is Dead (Duet)"],
|
||||
[
|
||||
"Thomas Borchert",
|
||||
"I Know Those Eyes / This Man Is Dead (Duet With Female Vocals)"
|
||||
],
|
||||
["SHE WANTS REVENGE", "Rachael"],
|
||||
["Matt Redmond", "Unbroken Praise"],
|
||||
["Ian McConnell", "Level 429"],
|
||||
["ABBA", "Watch Out"],
|
||||
["ABBA", "What About Livingstone"],
|
||||
["Ten Years After", "Outside My Window"],
|
||||
["ABBA", "Gonna Sing You My Lovesong"],
|
||||
["ABBA", "Suzy-Hang-Around"],
|
||||
["ABBA", "Waterloo (Swedish Version)"],
|
||||
["ABBA", "Honey, Honey (Swedish Version)"],
|
||||
["ABBA", "Waterloo (German Version)"],
|
||||
["ABBA", "Hasta Mañana (Spanish Version)"],
|
||||
["ABBA", "Waterloo (French Version)"],
|
||||
["ABBA", "Mamma Mia"],
|
||||
["ABBA", "Hey, Hey Helen"],
|
||||
["ABBA", "Tropical Loveland"],
|
||||
["ABBA", "S.O.S."],
|
||||
["ABBA", "Man In The Middle"],
|
||||
["ABBA", "Bang-A-Boomerang"],
|
||||
["ABBA", "I Do, I Do, I Do, I Do, I Do"],
|
||||
["ABBA", "Rock Me"],
|
||||
["ABBA", "I’ve Been Waiting For You"],
|
||||
["ABBA", "So Long"],
|
||||
["ABBA", "Crazy World"],
|
||||
["ABBA", "Medley (1978 Mix)"],
|
||||
["ABBA", "Mamma Mia (Spanish Version)"],
|
||||
["Marina and The Diamonds", "Froot"],
|
||||
["Maxton Waller", "On My Way (Marching Band)"],
|
||||
["100 gecs", "mememe"],
|
||||
["Stuck Out Here", "Embarrass You"],
|
||||
["DCSane", "Heart's Whiskey"],
|
||||
["Release", "Devil's Handshake"],
|
||||
["Kelly Clarkson", "Since U Been Gone (Pitch -3: E major)"],
|
||||
["Justin Townes Earle", "Rogers Park"],
|
||||
["Armin van Buuren ft. Teddy Swims", "Easy To Love"],
|
||||
["Willie Nelson", "One More Song to Write"],
|
||||
["Will Varley", "Seize The Night"],
|
||||
["Passenger", "However It Comes, Wherever It Goes"],
|
||||
["Ricky Braddy", "Anyone (Acoustic Cover of Demi Lovato)"],
|
||||
["Bryan Adams", "Help Me Make It Through The Night"],
|
||||
["Ivan Rivers", "Mid-Riff"],
|
||||
["Kane Brown", "American Bad Dream"],
|
||||
["Mother Mother", "Ghosting"],
|
||||
["Charlie Terrell", "Libby Anna"],
|
||||
["Taylor Swift", "Fortnight (feat. Post Malone)"],
|
||||
["The Gaslight Anthem", "National Anthem"],
|
||||
["The Lonely Island", "Semicolon (feat. Solange)"],
|
||||
["Lucky Daye", "Algorithm"],
|
||||
["The Black Eyed Peas", "They Don't Want Music"],
|
||||
["Tiger Really", "Fundamentally Unlovable"],
|
||||
["Da Ali G Show", "Jarvis Cocker"],
|
||||
["Colin Hay", "Send Somebody (Stripped Mix)"],
|
||||
["Ernie Taylor", "I Ain't Leavin' Yet"],
|
||||
["Smashing Pumpkins", "Here Is No Why"],
|
||||
["Drake", "Virginia Beach"],
|
||||
["Maverick City Music", "I Thank God"],
|
||||
["Ax and the Hatchetmen", "Drive-in Movie"],
|
||||
["Faith No More", "Das Schutzenfest"],
|
||||
["Miguel", "Use Me"],
|
||||
["Ivan Rivers", "Sad Around Me"],
|
||||
["Young The Giant", "Both Sides Now"],
|
||||
["Jimmy Buffett", "Bob Robert's Society Band"],
|
||||
["buildspace, MAYV", "the end"],
|
||||
["Frank Turner", "A Wave Across A Bay"],
|
||||
["Angel Olsen", "Eyes Without A Face"],
|
||||
["Deven May", "The Sensitive Song (from Cops)"],
|
||||
["The Mountain Goats", "Night Light"],
|
||||
["Steppenwolf", "Born To Be Wild"],
|
||||
["Bobby Solo", "O sole mio"],
|
||||
["HCA West", "Driving Quality"],
|
||||
["Engelbert Humperdinck", "Marry Me"],
|
||||
["Mark Knopfler", "Are We in Trouble Now"],
|
||||
["Danny Pynes", "One Night in Spain"],
|
||||
["The Butterfly Effect", "I’m Not Okay"],
|
||||
["The Sonic Bridges", "Sweet Evelyn"],
|
||||
["Carrie and Jake", "Wedding Medley"],
|
||||
["Gregory Porter", "Insanity (feat. Lalah Hathaway)"],
|
||||
["Linda Feller", "Ich weiss genau, was ich will"],
|
||||
["Mikey Chuck Rivers", "She's Cryin' (I'm Drunk Again)"],
|
||||
["Gregory Porter", "Insanity (feat. Lalah Hathaway) (Duet)"],
|
||||
["Country Rose", "Spaß Am Leben"],
|
||||
["Tom Astor", "Du bist da (wenn's drum geht)"],
|
||||
["Linda Feller", "Wenn überhaupt, dann nur Country"],
|
||||
["Alabama", "The Fans"],
|
||||
["Ghost Brothers", "What Kind Of Man Am I"],
|
||||
["The Stand", "Baby, Can You Dig Your Man"],
|
||||
["Nu Shooz", "I Can't Wait"],
|
||||
["Freddie Jackson", "All I'll Ever Ask (feat. Najee)"],
|
||||
["Linda Feller", "Du bist das Salz in meiner Suppe"],
|
||||
["Claudia Jung, Tom Astor", "Wer Liebe Sucht"],
|
||||
["The Smashing Pumpkins", "Tales of a Scorched Earth"],
|
||||
["The Smashing Pumpkins", "Thru the Eyes of Ruby"],
|
||||
["Tom Astor", "Geistertruck"]
|
||||
]
|
||||
Executable
+103
@@ -0,0 +1,103 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import os
|
||||
import json
|
||||
import logging
|
||||
from karaoke_prep.karaoke_prep import KaraokePrep
|
||||
|
||||
# Set up logging
|
||||
logger = logging.getLogger(__name__)
|
||||
log_handler = logging.StreamHandler()
|
||||
log_formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
|
||||
log_handler.setFormatter(log_formatter)
|
||||
logger.addHandler(log_handler)
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
# Define the artist/title combinations
|
||||
def total_length(tuple):
|
||||
artist, title = tuple
|
||||
return len(artist) + len(title)
|
||||
|
||||
|
||||
with open("data/artist-titles.json", "r", encoding="utf-8") as f:
|
||||
all_combinations = json.load(f)
|
||||
|
||||
# Sort by length and get shortest and longest 20
|
||||
sorted_combinations = sorted(all_combinations, key=total_length)
|
||||
artist_title_combinations = sorted_combinations[:20] + sorted_combinations[-20:]
|
||||
|
||||
# Define the format dictionary with expanded configurations
|
||||
formats = [
|
||||
{
|
||||
"name": "nomadkaraoke",
|
||||
"style_params_json": "/Users/andrew/AB Dropbox/Andrew Beveridge/MediaUnsynced/Karaoke/NomadBranding/karaoke-prep-styles-nomad.json",
|
||||
},
|
||||
{
|
||||
"name": "vocalstar",
|
||||
"style_params_json": "/Users/andrew/AB Dropbox/Andrew Beveridge/MediaUnsynced/Karaoke/Tracks-NonPublished/VocalStar/Resources/karaoke-prep-styles-vocalstar.json",
|
||||
},
|
||||
{
|
||||
"name": "minimal",
|
||||
"style_params_json": None,
|
||||
},
|
||||
]
|
||||
|
||||
# Define other parameters
|
||||
base_output_dir = "outputs"
|
||||
os.makedirs(base_output_dir, exist_ok=True)
|
||||
|
||||
# Process each format
|
||||
for format in formats:
|
||||
# Create format-specific output directory
|
||||
format_output_dir = os.path.join(base_output_dir, format["name"])
|
||||
os.makedirs(format_output_dir, exist_ok=True)
|
||||
|
||||
style_params = None
|
||||
if format["style_params_json"]:
|
||||
with open(format["style_params_json"], "r") as f:
|
||||
style_params = json.loads(f.read())
|
||||
|
||||
# Instantiate KaraokePrep for this format
|
||||
kprep = KaraokePrep(
|
||||
log_level=logging.INFO,
|
||||
log_formatter=log_formatter,
|
||||
output_dir=format_output_dir,
|
||||
style_params=style_params,
|
||||
render_bounding_boxes=False,
|
||||
output_jpg=False,
|
||||
output_png=True,
|
||||
)
|
||||
|
||||
# Run the create_title_video and create_end_video functions for each combination
|
||||
for artist, title in artist_title_combinations:
|
||||
sanitized_artist = kprep.sanitize_filename(artist)
|
||||
sanitized_title = kprep.sanitize_filename(title)
|
||||
|
||||
# Generate title video
|
||||
title_image_filepath_noext = os.path.join(format_output_dir, f"{sanitized_artist}_{sanitized_title}_title")
|
||||
title_video_filepath = os.path.join(format_output_dir, f"{sanitized_artist}_{sanitized_title}_title.mov")
|
||||
|
||||
kprep.intro_video_duration = 0
|
||||
kprep.create_title_video(
|
||||
artist=artist,
|
||||
title=title,
|
||||
format=kprep.title_format,
|
||||
output_image_filepath_noext=title_image_filepath_noext,
|
||||
output_video_filepath=title_video_filepath,
|
||||
)
|
||||
logger.info(f"Created title video for {artist} - {title} using {format['name']} format")
|
||||
|
||||
# Generate end video
|
||||
end_image_filepath_noext = os.path.join(format_output_dir, f"{sanitized_artist}_{sanitized_title}_end")
|
||||
end_video_filepath = os.path.join(format_output_dir, f"{sanitized_artist}_{sanitized_title}_end.mov")
|
||||
|
||||
kprep.end_video_duration = 0
|
||||
kprep.create_end_video(
|
||||
artist=artist,
|
||||
title=title,
|
||||
format=kprep.end_format,
|
||||
output_image_filepath_noext=end_image_filepath_noext,
|
||||
output_video_filepath=end_video_filepath,
|
||||
)
|
||||
logger.info(f"Created end video for {artist} - {title} using {format['name']} format")
|
||||
Reference in new issue
Block a user