fix(UKTV): Fix episode duration

This commit is contained in:
stabbedbybrick 2024-07-08 11:41:58 +02:00
parent 1e4730070f
commit fea45c5ed6

View File

@ -186,8 +186,8 @@ class UKTV(Service):
period_duration = manifest.get("mediaPresentationDuration") period_duration = manifest.get("mediaPresentationDuration")
period_duration = DASH.pt_to_sec(period_duration) period_duration = DASH.pt_to_sec(period_duration)
_, minutes, seconds = str(timedelta(seconds=period_duration - 6)).split(":") hours, minutes, seconds = str(timedelta(seconds=period_duration - 6)).split(":")
new_duration = f"PT{int(minutes)}M{float(seconds):.3f}S" new_duration = f"PT{hours}H{minutes}M{seconds}S"
manifest.set("mediaPresentationDuration", new_duration) manifest.set("mediaPresentationDuration", new_duration)
return etree.tostring(manifest, encoding="unicode") return etree.tostring(manifest, encoding="unicode")