1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-23 19:55:38 +01:00

viafree: check if we have any subtitles

fixes a crash where we expected to see subs but the list is empty
This commit is contained in:
Johan Andersson 2020-11-13 11:30:42 +01:00
parent ef557cb9fb
commit bf1f9c545a

View File

@ -75,7 +75,7 @@ class Viaplay(Service, OpenGraphThumbMixin):
)
for n in list(streams.keys()):
yield streams[n]
if "subtitles" in janson["embedded"]:
if "subtitles" in janson["embedded"] and len(janson["embedded"]["subtitles"]) > 0:
yield subtitle(copy.copy(self.config), "wrst", janson["embedded"]["subtitles"][0]["link"]["href"], output=self.output)
def find_all_episodes(self, config):