From b03ca7f10c2a4b0ecfd10e98a6f2f369a2d33e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 24 Mar 2022 22:41:59 +0100 Subject: [PATCH] [aryion] provide correct 'date' independent of dst --- gallery_dl/extractor/aryion.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gallery_dl/extractor/aryion.py b/gallery_dl/extractor/aryion.py index 06ec5715..fa590b90 100644 --- a/gallery_dl/extractor/aryion.py +++ b/gallery_dl/extractor/aryion.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2020-2021 Mike Fährmann +# Copyright 2020-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -11,6 +11,8 @@ from .common import Extractor, Message from .. import text, util, exception from ..cache import cache +from email.utils import parsedate_tz +from datetime import datetime BASE_PATTERN = r"(?:https?://)?(?:www\.)?aryion\.com/g4" @@ -144,7 +146,8 @@ class AryionExtractor(Extractor): title, _, artist = text.unescape(extr( "g4 :: ", "<")).rpartition(" by ") - data = { + + return { "id" : text.parse_int(post_id), "url" : url, "user" : self.user or artist, @@ -152,7 +155,7 @@ class AryionExtractor(Extractor): "artist": artist, "path" : text.split_html(extr( "cookiecrumb'>", '</span'))[4:-1:2], - "date" : extr("class='pretty-date' title='", "'"), + "date" : datetime(*parsedate_tz(lmod)[:6]), "size" : text.parse_int(clen), "views" : text.parse_int(extr("Views</b>:", "<").replace(",", "")), "width" : text.parse_int(extr("Resolution</b>:", "x")), @@ -167,12 +170,6 @@ class AryionExtractor(Extractor): "_mtime" : lmod, } - d1, _, d2 = data["date"].partition(",") - data["date"] = text.parse_datetime( - d1[:-2] + d2, "%b %d %Y %I:%M %p", -5) - - return data - class AryionGalleryExtractor(AryionExtractor): """Extractor for a user's gallery on eka's portal""" @@ -249,7 +246,7 @@ class AryionPostExtractor(AryionExtractor): "title" : "I'm on subscribestar now too!", "description": r"re:Doesn't hurt to have a backup, right\?", "tags" : ["Non-Vore", "subscribestar"], - "date" : "dt:2019-02-16 19:30:00", + "date" : "dt:2019-02-16 19:30:34", "path" : [], "views" : int, "favorites": int,