From bf1f9c545a6ac592d3afa6745fc24af582059312 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Fri, 13 Nov 2020 11:30:42 +0100 Subject: [PATCH] viafree: check if we have any subtitles fixes a crash where we expected to see subs but the list is empty --- lib/svtplay_dl/service/viaplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index 31c7f4a..819e06a 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -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):