diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py index b3bb9a6..414cd65 100644 --- a/lib/svtplay_dl/service/svtplay.py +++ b/lib/svtplay_dl/service/svtplay.py @@ -281,18 +281,31 @@ class Svtplay(Service, MetadataThumbMixin): except KeyError: title = data["video"]["titleSlug"] self.output["title_nice"] = title + try: - # Get the image if size/format is not specified in the URL set it to large - url = data['state']["titleModel"]["thumbnail"].format(format="large") + t = data['state']["titleModel"]["thumbnail"] + except KeyError: + t = "" + if isinstance(t, dict): + url = "https://www.svtstatic.se/image/original/default/{id}/{changed}?format=auto&quality=100".format(**t) self.output["showthumbnailurl"] = url - except KeyError: - pass - try: - url = data["video"]["thumbnailXL"].format(format="large") - self.output["episodethumbnailurl"] = url - except KeyError: + elif t: # Get the image if size/format is not specified in the URL set it to large - url = data["video"]["thumbnail"].format(format="large") + url = t.format(format="large") + self.output["showthumbnailurl"] = url + try: + t = data["video"]["thumbnailXL"] + except KeyError: + try: + t = data["video"]["thumbnail"] + except KeyError: + t = "" + if isinstance(t, dict): + url = "https://www.svtstatic.se/image/original/default/{id}/{changed}?format=auto&quality=100".format(**t) + self.output["episodethumbnailurl"] = url + elif t: + # Get the image if size/format is not specified in the URL set it to large + url = t.format(format="large") self.output["episodethumbnailurl"] = url try: self.output["showdescription"] = data['state']["titleModel"]["description"]