From 012cc366095a13937c1c77ae3499afbc5ebab99d Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Tue, 14 May 2024 15:54:50 +0100 Subject: [PATCH] removes deprecated datetime method --- src/auto_archiver/archivers/youtubedl_archiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/archivers/youtubedl_archiver.py b/src/auto_archiver/archivers/youtubedl_archiver.py index 3b2f17f..9a42bdf 100644 --- a/src/auto_archiver/archivers/youtubedl_archiver.py +++ b/src/auto_archiver/archivers/youtubedl_archiver.py @@ -98,11 +98,12 @@ class YoutubeDLArchiver(Archiver): result.set("comments", [{ "text": c["text"], "author": c["author"], - "timestamp": datetime.datetime.utcfromtimestamp(c.get("timestamp")).replace(tzinfo=datetime.timezone.utc) + "timestamp": datetime.datetime.fromtimestamp(c.get("timestamp"), tz = datetime.timezone.utc) } for c in info.get("comments", [])]) if (timestamp := info.get("timestamp")): - timestamp = datetime.datetime.utcfromtimestamp(timestamp).replace(tzinfo=datetime.timezone.utc).isoformat() + #TODO: fix deprecated timestamp, + timestamp = datetime.datetime.fromtimestamp(timestamp, tz = datetime.timezone.utc).isoformat() result.set_timestamp(timestamp) if (upload_date := info.get("upload_date")): upload_date = datetime.datetime.strptime(upload_date, '%Y%m%d').replace(tzinfo=datetime.timezone.utc)