工作流,去除cmd弹框

This commit is contained in:
2022-05-03 13:39:10 +08:00
parent 12504b9cf5
commit a393639ac1
2 changed files with 21 additions and 23 deletions

View File

@ -1,8 +1,6 @@
import datetime
import os
import argparse
import subprocess
from hashlib import md5
from typing import Union
from bs4 import BeautifulSoup
@ -43,19 +41,6 @@ def diff_danmaku_files(base_file: Union[os.PathLike[str], str], file: Union[os.P
return get_file_start(file) - get_file_start(base_file)
def danmaku_to_subtitle(file: Union[os.PathLike[str], str], time_shift: float):
new_subtitle_name = md5(file.encode("utf-8")).hexdigest() + ".ass"
process = subprocess.Popen((
DANMAKU_FACTORY_EXEC, "--ignore-warnings",
"-r", str(VIDEO_RESOLUTION), "-s", str(DANMAKU_SPEED), "-f", "5",
"-S", "40", "-N", str(DEFAULT_FONT_NAME), "--showmsgbox", "FALSE",
"-O", "255", "-L", "1", "-D", "0",
"-o", "ass", new_subtitle_name, "-i", file, "-t", str(time_shift)
))
process.wait()
return new_subtitle_name
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("base", help="以此为标准")