[wikimedia] fix name of files without extension

This commit is contained in:
ClosedPort22
2025-10-04 15:24:41 +08:00
parent 4d9b30bcb0
commit 5e33f9981f
2 changed files with 14 additions and 3 deletions

View File

@@ -74,9 +74,7 @@ class WikimediaExtractor(BaseExtractor):
m["name"]: m["value"]
for m in image["commonmetadata"] or ()}
filename = image["canonicaltitle"]
image["filename"], _, image["extension"] = \
filename.partition(":")[2].rpartition(".")
text.nameext_from_url(image["canonicaltitle"].partition(":")[2], image)
image["date"] = text.parse_datetime(
image["timestamp"], "%Y-%m-%dT%H:%M:%SZ")