[wikimedia] handle 'File:' paths

This commit is contained in:
Mike Fährmann
2024-01-19 03:05:45 +01:00
parent 93b4120e77
commit 44f2c15a04

View File

@@ -34,7 +34,8 @@ class WikimediaExtractor(BaseExtractor):
prefix = pre.lower() if sep else None
self.title = path = text.unquote(path)
self.subcategory = prefix
if prefix:
self.subcategory = prefix
if prefix == "category":
self.params = {
@@ -42,6 +43,10 @@ class WikimediaExtractor(BaseExtractor):
"gcmtitle" : path,
"gcmtype" : "file",
}
elif prefix == "file":
self.params = {
"titles" : path,
}
else:
self.params = {
"generator": "images",