[aryion] provide correct 'date' independent of dst

This commit is contained in:
Mike Fährmann 2022-03-24 22:41:59 +01:00
parent 0744cad6d6
commit b03ca7f10c
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -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(
"<title>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,