Fix YouTube upcoming stream's embed not being timezone-agnostic (#6527)

This commit is contained in:
Karlo Prikratki 2025-02-15 23:33:15 +01:00 committed by GitHub
parent 73958d87f1
commit 4558b72082
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,7 +221,7 @@ class YoutubeStream(Stream):
if vid_data["liveStreamingDetails"].get("scheduledStartTime", None) is not None: if vid_data["liveStreamingDetails"].get("scheduledStartTime", None) is not None:
if "actualStartTime" not in vid_data["liveStreamingDetails"]: if "actualStartTime" not in vid_data["liveStreamingDetails"]:
start_time = parse_time(vid_data["liveStreamingDetails"]["scheduledStartTime"]) start_time = parse_time(vid_data["liveStreamingDetails"]["scheduledStartTime"])
start_time_unix = time.mktime(start_time.timetuple()) start_time_unix = start_time.timestamp()
start_in = start_time - datetime.now(timezone.utc) start_in = start_time - datetime.now(timezone.utc)
if start_in.total_seconds() > 0: if start_in.total_seconds() > 0:
embed.description = _("This stream will start <t:{time}:R>").format( embed.description = _("This stream will start <t:{time}:R>").format(