1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

SVT changed thumbnail path, fix for using the new path (and still old until we know it is completely gone).

This commit is contained in:
Harald Gustafsson 2018-09-26 16:39:58 +02:00 committed by Johan Andersson
parent 4fbf861985
commit 171bd25084

View File

@ -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"]