1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[ao3] extract 'date_completed' and 'date_updated' metadata (#6013)

This commit is contained in:
Mike Fährmann 2024-09-17 17:19:05 +02:00
parent 064bc890fc
commit 1d7df9cef2
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,7 @@ class Ao3WorkExtractor(Ao3Extractor):
extr = text.extract_from(self.request(url).text)
fmts = {}
path = ""
download = extr(' class="download"', "</ul>")
for dl in text.extract_iter(download, ' href="', "</"):
path, _, type = dl.rpartition('">')
@ -95,6 +96,10 @@ class Ao3WorkExtractor(Ao3Extractor):
"series" : extr('<dd class="series">', "</dd>"),
"date" : text.parse_datetime(
extr('<dd class="published">', "<"), "%Y-%m-%d"),
"date_completed": text.parse_datetime(
extr('>Completed:</dt><dd class="status">', "<"), "%Y-%m-%d"),
"date_updated" : text.parse_timestamp(
path.rpartition("updated_at=")[2]),
"words" : text.parse_int(
extr('<dd class="words">', "<").replace(",", "")),
"chapters" : text.parse_int(

View File

@ -19,6 +19,8 @@ __tests__ = (
"chapters" : 27,
"comments" : range(800, 2000),
"date" : "dt:2023-06-11 00:00:00",
"date_completed": "dt:2024-05-10 00:00:00",
"date_updated" : "dt:2024-07-08 00:27:04",
"extension": "pdf",
"filename" : "The_Wildcard",
"id" : 47802076,