From 924cc0dd506e8026c6d0d9ad55c6debe58dc3127 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 28 Nov 2023 23:59:57 +0100 Subject: [PATCH] subs: when using --all-subtitles download all files that have a subfix --- lib/svtplay_dl/utils/stream.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/svtplay_dl/utils/stream.py b/lib/svtplay_dl/utils/stream.py index f0f7b3a..fbfc1d3 100644 --- a/lib/svtplay_dl/utils/stream.py +++ b/lib/svtplay_dl/utils/stream.py @@ -84,6 +84,8 @@ def subtitle_filter(subtitles) -> List: for sub in subtitles: if sub.subfix not in languages: if all_subs: + if sub.subfix is None: + continue subs.append(sub) languages.append(sub.subfix) else: @@ -101,13 +103,11 @@ def subtitle_decider(stream, subtitles): subtitles = subtitle_filter(subtitles) if stream.config.get("get_all_subtitles"): for sub in subtitles: - if stream.config.get("get_url"): - print(sub.url) - else: - sub.download() - if stream.config.get("merge_subtitle"): - if not sub.subfix: - stream.config.set("get_all_subtitles", False) + if sub.subfix: + if stream.config.get("get_url"): + print(sub.url) + else: + sub.download() else: if stream.config.get("get_url"): print(subtitles[0].url)