[kemonoparty] fix DM dates

pull/4674/head
Mike Fährmann 11 months ago
parent 6dfe200ae4
commit ade8347ead
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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

@ -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",
}],
},
{

Loading…
Cancel
Save