[4archive] fix 'TypeError' (#8217)

update 'date' & 'filename' extraction
This commit is contained in:
Mike Fährmann
2025-09-14 21:00:17 +02:00
parent 8583883b4d
commit 858d209b17

View File

@@ -62,7 +62,8 @@ class _4archiveThreadExtractor(Extractor):
data = {
"name": extr('class="name">', "</span>"),
"date": text.parse_datetime(
extr('class="dateTime postNum" >', "<").strip(),
(extr('class="dateTime">', "<") or
extr('class="dateTime postNum" >', "<")).strip(),
"%Y-%m-%d %H:%M:%S"),
"no" : text.parse_int(extr(">Post No.", "<")),
}
@@ -70,8 +71,7 @@ class _4archiveThreadExtractor(Extractor):
extr('class="fileText"', ">File: <a")
data.update({
"url" : extr('href="', '"'),
"filename": extr(
'rel="noreferrer noopener"', "</a>").strip()[1:],
"filename": extr('alt="Image: ', '"'),
"size" : text.parse_bytes(extr(" (", ", ")[:-1]),
"width" : text.parse_int(extr("", "x")),
"height" : text.parse_int(extr("", "px")),