From acd853f9c4e60877e640c666f032a5a81528e521 Mon Sep 17 00:00:00 2001 From: Jules-WinnfieldX Date: Wed, 15 May 2024 14:39:15 -0600 Subject: [PATCH] another date format for kemono --- cyberdrop_dl/__init__.py | 2 +- cyberdrop_dl/scraper/crawlers/kemono_crawler.py | 5 ++++- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index e599005c8..6a11acc81 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.3.14" +__version__ = "5.3.15" diff --git a/cyberdrop_dl/scraper/crawlers/kemono_crawler.py b/cyberdrop_dl/scraper/crawlers/kemono_crawler.py index c64ac9769..7675b69e7 100644 --- a/cyberdrop_dl/scraper/crawlers/kemono_crawler.py +++ b/cyberdrop_dl/scraper/crawlers/kemono_crawler.py @@ -155,7 +155,10 @@ async def handle_direct_link(self, scrape_item: ScrapeItem) -> None: async def parse_datetime(self, date: str) -> int: """Parses a datetime string into a unix timestamp""" - date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S") + try: + date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S") + except ValueError: + date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S.%f") return calendar.timegm(date.timetuple()) @error_handling_wrapper diff --git a/pyproject.toml b/pyproject.toml index 291873bd5..ce8bc27f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.3.14" +version = "5.3.15" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md"