From d8f5e5157bda6c39908faeeccdebca73c369bc74 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 20 Oct 2021 15:00:24 +0200 Subject: [PATCH] dr: dont crash on files without subs --- lib/svtplay_dl/service/dr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/svtplay_dl/service/dr.py b/lib/svtplay_dl/service/dr.py index 8a35ecc..beb4af1 100644 --- a/lib/svtplay_dl/service/dr.py +++ b/lib/svtplay_dl/service/dr.py @@ -59,7 +59,8 @@ class Dr(Service, OpenGraphThumbMixin): yield ServiceError("Can't play this because the video is geoblocked or not available.") else: yield from hlsparse(self.config, res, video["url"], output=self.output) - yield subtitle(copy.copy(self.config), "wrst", video["subtitles"][0]["link"], output=self.output) + if len(video["subtitles"]) > 0: + yield subtitle(copy.copy(self.config), "wrst", video["subtitles"][0]["link"], output=self.output) def find_all_episodes(self, config): episodes = []