[kemonoparty] fix DM dates

This commit is contained in:
Mike Fährmann
2023-10-15 19:54:28 +02:00
parent 6dfe200ae4
commit ade8347ead
2 changed files with 7 additions and 6 deletions

View File

@@ -197,11 +197,12 @@ class KemonopartyExtractor(Extractor):
dms = []
for dm in text.extract_iter(page, "<article", "</article>"):
footer = text.extr(dm, "<footer", "</footer>")
dms.append({
"body": text.unescape(text.extract(
"body": text.unescape(text.extr(
dm, "<pre>", "</pre></",
)[0].strip()),
"date": text.extr(dm, 'datetime="', '"'),
).strip()),
"date": text.extr(footer, 'Published: ', '\n'),
})
return dms

View File

@@ -117,9 +117,9 @@ __tests__ = (
"#options" : {"dms": True},
"dms": [{
"body" : r"re:Hi! Thank you very much for supporting the work I did in May. Here's your reward pack! I hope you find something you enjoy in it. :\)\n\nhttps://www.mediafire.com/file/\w+/Set13_tier_2.zip/file",
"date" : "2021-07-31 02:47:51.327865",
}],
"body": r"re:Hi! Thank you very much for supporting the work I did in May. Here's your reward pack! I hope you find something you enjoy in it. :\)\n\nhttps://www.mediafire.com/file/\w+/Set13_tier_2.zip/file",
"date": "2021-06",
}],
},
{