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

[wikimedia] fix non-English Fandom/wiki.gg articles (#6370)

This commit is contained in:
Mike Fährmann 2024-10-24 13:00:02 +02:00
parent 7877f8cf1a
commit 8f0b0b0735
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 21 additions and 1 deletions

View File

@ -193,7 +193,10 @@ class WikimediaArticleExtractor(WikimediaExtractor):
def __init__(self, match):
WikimediaExtractor.__init__(self, match)
path = match.group(match.lastindex)
path = self.groups[-1]
if path[2] == "/":
self.root = self.root + "/" + path[:2]
path = path[3:]
if path.startswith("wiki/"):
path = path[5:]

View File

@ -92,6 +92,14 @@ __tests__ = (
"metadata" : {},
},
{
"#url" : "https://discogs.fandom.com/zh/wiki/File:CH-0430D2.jpg",
"#comment" : "non-English language prefix (#6370)",
"#category": ("wikimedia", "fandom-discogs", "file"),
"#class" : wikimedia.WikimediaArticleExtractor,
"#urls" : "https://static.wikia.nocookie.net/discogs/images/a/ab/CH-0430D2.jpg/revision/latest?cb=20241007150151&path-prefix=zh",
},
{
"#url" : "https://projectsekai.fandom.com/wiki/Project_SEKAI_Wiki",
"#category": ("wikimedia", "fandom-projectsekai", "article"),

View File

@ -21,4 +21,13 @@ __tests__ = (
"#class" : wikimedia.WikimediaArticleExtractor,
},
{
"#url" : "https://terraria.wiki.gg/de/wiki/Golem",
"#comment" : "non-English language prefix (#6370)",
"#category": ("wikimedia", "wikigg-terraria", "article"),
"#class" : wikimedia.WikimediaArticleExtractor,
"#count" : "> 45",
"#archive" : False,
},
)