1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-12-12 12:54:18 +01:00

subs: when using --all-subtitles download all files that have a subfix

This commit is contained in:
Johan Andersson 2023-11-28 23:59:57 +01:00
parent 15a64cf198
commit 924cc0dd50

View File

@ -84,6 +84,8 @@ def subtitle_filter(subtitles) -> List:
for sub in subtitles: for sub in subtitles:
if sub.subfix not in languages: if sub.subfix not in languages:
if all_subs: if all_subs:
if sub.subfix is None:
continue
subs.append(sub) subs.append(sub)
languages.append(sub.subfix) languages.append(sub.subfix)
else: else:
@ -101,13 +103,11 @@ def subtitle_decider(stream, subtitles):
subtitles = subtitle_filter(subtitles) subtitles = subtitle_filter(subtitles)
if stream.config.get("get_all_subtitles"): if stream.config.get("get_all_subtitles"):
for sub in subtitles: for sub in subtitles:
if sub.subfix:
if stream.config.get("get_url"): if stream.config.get("get_url"):
print(sub.url) print(sub.url)
else: else:
sub.download() sub.download()
if stream.config.get("merge_subtitle"):
if not sub.subfix:
stream.config.set("get_all_subtitles", False)
else: else:
if stream.config.get("get_url"): if stream.config.get("get_url"):
print(subtitles[0].url) print(subtitles[0].url)