add small tools

This commit is contained in:
2024-10-04 10:55:48 +08:00
parent c10bd094da
commit 620f030d5f
8 changed files with 138 additions and 37 deletions

View File

@@ -147,7 +147,7 @@ def get_lyric_from_folder(self):
suffix="", max=len(ncm_files), color="green", width=9999) as bar:
total = len(ncm_files)
allocated = 0 # 已经分配的任务数量
while True: # 进入循环,执行 新建进程->检测队列->检测任务完成 的循环
while True: # 进入循环,执行 "新建进程->检测队列->检测任务完成" 的循环
sleep(0.05)
if current_process <= max_process and allocated < total: # 分配进程
Process(target=process_work,
@@ -176,7 +176,7 @@ def get_lyric_from_folder(self):
passed += 1
current_process -= 1
bar.print_onto_bar(Fore.YELLOW +
f"\"{r['musicName']} - "
f"\"{r['musicName']} by "
f"{''.join([x + ', ' for x in [x[0] for x in r['artist']]])[:-2]}"
"\"" + Fore.GREEN + " 已完成!")
bar.next()

View File

@@ -6,7 +6,6 @@ from modules.utils.inputs import rinput
from modules.functions.mainly.get_song import get_song_lyric
from modules.utils.bar import CompactArrowBar
def mdl(self):
"""多个歌词文件的下载
@@ -34,7 +33,7 @@ def mdl(self):
with CompactArrowBar(f"进度: %(index){len(str(len(ids)))}d/%(max)d",
suffix="", max=len(ids), color="yellow", width=9999) as bar:
for i in range(0, len(ids)):
r = get_song_lyric(ids[i], self.settings.lyric_path, self.settings.lyric_path, bar=bar)
r = get_song_lyric(ids[i], self.settings.lyric_path, self.settings.lyric_format, bar=bar)
if r == "dl_err_connection":
bar.print_onto_bar(Fore.RED + "下载发生错误!可能是连接被拒绝!请检查网络后再试\n按回车键继续任务(该任务会被跳过)...")
input()

View File

@@ -0,0 +1,3 @@
def mult_unlock(...)