From 0f71f038f4a08660e07edfd4a101b8964e033a97 Mon Sep 17 00:00:00 2001 From: Ulysses Zhan Date: Sun, 24 Mar 2024 09:54:48 -0700 Subject: [PATCH] support yt-dlp option `--paths subtitle:XXX` --- yt_dlp_danmaku/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yt_dlp_danmaku/__init__.py b/yt_dlp_danmaku/__init__.py index a4caa0e..c9c62a8 100644 --- a/yt_dlp_danmaku/__init__.py +++ b/yt_dlp_danmaku/__init__.py @@ -83,4 +83,9 @@ def run(self, info): with new_path.open('w') as f: f.write(ass) + files_to_move = info.get('__files_to_move', {}) + if str(path) in files_to_move: + files_to_move[str(new_path)] = str(Path(files_to_move[str(path)]).with_suffix('.ass')) + del files_to_move[str(path)] + return [path], info