From 321dc3feb9571ebc0554b8a6a011796d8c44cd4b Mon Sep 17 00:00:00 2001 From: TZFC <51830440+TZFC@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:09:21 +0800 Subject: [PATCH] fix casting error from leading zeros --- postReplayComment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postReplayComment.py b/postReplayComment.py index f3447d5..450fb12 100644 --- a/postReplayComment.py +++ b/postReplayComment.py @@ -71,7 +71,7 @@ four_part_date = re.search(r"(\d+)年(\d+)月(\d+)日(\d+)点", title) if four_part_date: year, month, day, hour = four_part_date.groups() - video_date = datetime(year=eval(year), month=eval(month), day=eval(day), hour=eval(hour)) + video_date = datetime(year=int(year), month=int(month), day=int(day), hour=int(hour)) else: three_part_date = re.search(r"(\d+)-(\d+)-(\d+)", title) if not three_part_date: @@ -79,7 +79,7 @@ continue year, month, day = three_part_date.groups() hour = None - video_date = datetime(year=eval(year), month=eval(month), day=eval(day)) + video_date = datetime(year=int(year), month=int(month), day=int(day)) for start, summary in summaries: if (start, summary) in success: continue