|
13 | 13 | from programs.applio_code.rvc.infer.infer import VoiceConverter |
14 | 14 | from programs.applio_code.rvc.lib.tools.model_download import model_download_pipeline |
15 | 15 | from programs.music_separation_code.inference import proc_file |
| 16 | +from assets.presence.discord_presence import RPCManager, track_presence |
| 17 | + |
16 | 18 |
|
17 | 19 | logging.basicConfig( |
18 | 20 | level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" |
@@ -145,6 +147,20 @@ def import_voice_converter(): |
145 | 147 | return VoiceConverter() |
146 | 148 |
|
147 | 149 |
|
| 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 | + |
148 | 164 | @lru_cache(maxsize=1) |
149 | 165 | def get_config(): |
150 | 166 | from programs.applio_code.rvc.configs.config import Config |
@@ -288,6 +304,8 @@ def check_fp16_support(device): |
288 | 304 | return True |
289 | 305 |
|
290 | 306 |
|
| 307 | + |
| 308 | +@track_presence("Infer the Audio") |
291 | 309 | def full_inference_program( |
292 | 310 | model_path, |
293 | 311 | index_path, |
@@ -1031,14 +1049,13 @@ def download_music(link): |
1031 | 1049 | output_template = os.path.join(output_dir, "%(title)s.%(ext)s") |
1032 | 1050 |
|
1033 | 1051 | 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 | +] |
1042 | 1059 |
|
1043 | 1060 | try: |
1044 | 1061 | result = subprocess.run(command, check=True, capture_output=True, text=True) |
|
0 commit comments