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

svtplay: fix a crash while parsing timezone data

This commit is contained in:
Johan Andersson 2024-04-17 23:15:36 +02:00
parent c6e0b3124c
commit b65b45b471

View File

@ -404,10 +404,11 @@ class Svtplay(Service, MetadataThumbMixin):
validfrom = episode["item"]["validFrom"]
if "+" in validfrom:
timeformat = "%Y-%m-%dT%H:%M:%S.%f%z" if "." in episode["item"]["validFrom"] else "%Y-%m-%dT%H:%M:%S%z"
date = time.mktime(
datetime.datetime.strptime(
_fix_broken_timezone_implementation(episode["item"]["validFrom"].replace("Z", "")),
"%Y-%m-%dT%H:%M:%S%z",
timeformat,
).timetuple(),
)
else: