From eed16043bdd4643d01d5e2c3b4798af93544ee4e Mon Sep 17 00:00:00 2001 From: Reza Jelveh Date: Mon, 3 Apr 2023 19:53:23 +0800 Subject: [PATCH] mpv: fix WebVTT subtitles The subtitles are passed separated by ':' as a result it will consider https and // to be different files and therefore failing to load. --- animdl/core/cli/helpers/players/mpv.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/animdl/core/cli/helpers/players/mpv.py b/animdl/core/cli/helpers/players/mpv.py index ca48b13e..ee3a7081 100644 --- a/animdl/core/cli/helpers/players/mpv.py +++ b/animdl/core/cli/helpers/players/mpv.py @@ -51,12 +51,14 @@ def play( ) if subtitles is not None: + subtitles_result = map( + lambda subtitle: subtitle.replace("https:", "https\:"), subtitles + ) args += ( - f"{self.opts_spec['subtitles']}={self.path_joiner.join(subtitles)}", + f"{self.opts_spec['subtitles']}={self.path_joiner.join(subtitles_result)}", ) if chapters: - # NOTE: This could be achieved with a PIPE. # This is not done in this case because you # only PIPE one argument at a time, and this