1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-12-03 16:44:17 +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:
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 sub.subfix:
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)
else:
if stream.config.get("get_url"):
print(subtitles[0].url)