Skip to content

Commit

Permalink
Merge pull request #21 from TZFC/dev
Browse files Browse the repository at this point in the history
fix casting error from leading zeros
  • Loading branch information
TZFC authored Dec 4, 2023
2 parents 1bc9bd2 + 321dc3f commit ac170af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postReplayComment.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@
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:
# TODO: log error here. Only four and three part dates are allowed
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
Expand Down

0 comments on commit ac170af

Please sign in to comment.