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:
parent
064bc890fc
commit
1d7df9cef2
@ -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(
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user