feat: accomodate subtitle streams

This commit is contained in:
Benex254
2024-08-18 23:53:36 +03:00
parent 528be74194
commit fc7efebc8d
11 changed files with 107 additions and 38 deletions

View File

@@ -55,6 +55,7 @@ def run_mpv(
ytdl_format="",
custom_args=[],
headers={},
subtitles=[],
):
# Determine if mpv is available
MPV = shutil.which("mpv")
@@ -108,6 +109,8 @@ def run_mpv(
for header_name, header_value in headers.items():
mpv_headers += f"{header_name}:{header_value},"
mpv_args.append(mpv_headers)
for subtitle in subtitles:
mpv_args.append(f"--sub-file={subtitle['url']}")
if start_time != "0":
mpv_args.append(f"--start={start_time}")
if title: