From f189660deff69200c3b83b03337948c111b53681 Mon Sep 17 00:00:00 2001 From: Misaka13514 Date: Fri, 16 Feb 2024 01:02:02 +0800 Subject: [PATCH] fix: fromisoformat in bluesky prior to python 3.11 --- nazurin/sites/bluesky/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nazurin/sites/bluesky/api.py b/nazurin/sites/bluesky/api.py index 527a5c07..4b1a9b5d 100644 --- a/nazurin/sites/bluesky/api.py +++ b/nazurin/sites/bluesky/api.py @@ -1,11 +1,11 @@ import os -from datetime import datetime from typing import List, Tuple from nazurin.models import Caption, Illust, Image from nazurin.utils import Request from nazurin.utils.decorators import network_retry from nazurin.utils.exceptions import NazurinError +from nazurin.utils.helpers import fromisoformat from .config import DESTINATION, FILENAME @@ -88,7 +88,7 @@ def get_storage_dest(item: dict, pic: dict, index: int = 0) -> Tuple[str, str]: """ url = pic["fullsize"] - created_at = datetime.fromisoformat(item["record"]["createdAt"]) + created_at = fromisoformat(item["record"]["createdAt"]) basename = os.path.basename(url) filename, extension = basename.split("@") context = {