Skip to content

Commit 43df767

Browse files
author
NeoDev
authored
Update core.py
1 parent 5d9955d commit 43df767

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

core.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from programs.applio_code.rvc.infer.infer import VoiceConverter
1414
from programs.applio_code.rvc.lib.tools.model_download import model_download_pipeline
1515
from programs.music_separation_code.inference import proc_file
16+
from assets.presence.discord_presence import RPCManager, track_presence
17+
1618

1719
logging.basicConfig(
1820
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
@@ -145,6 +147,20 @@ def import_voice_converter():
145147
return VoiceConverter()
146148

147149

150+
151+
def load_config_presence():
152+
with open(config_file, "r", encoding="utf8") as file:
153+
config = json.load(file)
154+
return config["discord_presence"]
155+
156+
def initialize_presence():
157+
if load_config_presence():
158+
RPCManager.start_presence()
159+
160+
initialize_presence()
161+
162+
163+
148164
@lru_cache(maxsize=1)
149165
def get_config():
150166
from programs.applio_code.rvc.configs.config import Config
@@ -288,6 +304,8 @@ def check_fp16_support(device):
288304
return True
289305

290306

307+
308+
@track_presence("Infer the Audio")
291309
def full_inference_program(
292310
model_path,
293311
index_path,
@@ -1031,14 +1049,13 @@ def download_music(link):
10311049
output_template = os.path.join(output_dir, "%(title)s.%(ext)s")
10321050

10331051
command = [
1034-
"yt-dlp",
1035-
"-x",
1036-
"--audio-format",
1037-
"wav",
1038-
"--output",
1039-
output_template,
1040-
link,
1041-
]
1052+
"yt-dlp",
1053+
"-x",
1054+
"--audio-format", "wav",
1055+
"--output", output_template,
1056+
"--cookies", "./assets/ytdlstuff.txt",
1057+
link,
1058+
]
10421059

10431060
try:
10441061
result = subprocess.run(command, check=True, capture_output=True, text=True)

0 commit comments

Comments
 (0)