1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-21 18:22:30 +01:00

[wikimedia] support wiki.gg wikis

This commit is contained in:
Mike Fährmann 2024-04-09 19:24:01 +02:00
parent 40c1a8e471
commit b57051719f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 38 additions and 3 deletions

View File

@ -1499,6 +1499,12 @@ Consider all listed sites to potentially be NSFW.
<td>Articles</td>
<td></td>
</tr>
<tr>
<td>wiki.gg</td>
<td>https://www.wiki.gg/</td>
<td>Articles</td>
<td></td>
</tr>
<tr>
<td>Super Mario Wiki</td>
<td>https://www.mariowiki.com/</td>

View File

@ -27,9 +27,9 @@ class WikimediaExtractor(BaseExtractor):
if self.category == "wikimedia":
self.category = self.root.split(".")[-2]
elif self.category == "fandom":
self.category = \
"fandom-" + self.root.partition(".")[0].rpartition("/")[2]
elif self.category in ("fandom", "wikigg"):
self.category = "{}-{}".format(
self.category, self.root.partition(".")[0].rpartition("/")[2])
if path.startswith("wiki/"):
path = path[5:]
@ -152,6 +152,10 @@ BASE_PATTERN = WikimediaExtractor.update({
"root": None,
"pattern": r"[\w-]+\.fandom\.com",
},
"wikigg": {
"root": None,
"pattern": r"\w+\.wiki\.gg",
},
"mariowiki": {
"root": "https://www.mariowiki.com",
"pattern": r"(?:www\.)?mariowiki\.com",

View File

@ -143,6 +143,7 @@ CATEGORY_MAP = {
"webmshare" : "webmshare",
"webtoons" : "Webtoon",
"wikiart" : "WikiArt.org",
"wikigg" : "wiki.gg",
"wikimediacommons": "Wikimedia Commons",
"xbunkr" : "xBunkr",
"xhamster" : "xHamster",

24
test/results/wikigg.py Normal file
View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from gallery_dl.extractor import wikimedia
__tests__ = (
{
"#url" : "https://www.wiki.gg/wiki/Title",
"#comment" : "for scripts/supportedsites.py",
"#category": ("wikimedia", "wikigg-www", "article"),
"#class" : wikimedia.WikimediaArticleExtractor,
},
{
"#url" : "https://hearthstone.wiki.gg/wiki/Flame_Juggler",
"#category": ("wikimedia", "wikigg-hearthstone", "article"),
"#class" : wikimedia.WikimediaArticleExtractor,
},
)