diff --git a/worker/danmaku.py b/worker/danmaku.py index f37336d..6a2cc1a 100644 --- a/worker/danmaku.py +++ b/worker/danmaku.py @@ -1,3 +1,4 @@ +import argparse import os.path from datetime import datetime @@ -23,3 +24,12 @@ def do_workflow(video_file, danmaku_base_file, *danmaku_files): print(result) encode_video_with_subtitles(video_file, result, new_file_name) quick_split_video(new_file_name) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument("video", help="视频标准") + parser.add_argument("base", help="弹幕标准") + parser.add_argument("files", nargs="+", help="弹幕需要对齐") + args = parser.parse_args() + do_workflow(args.video, args.base, args.files)