[docs] update 'wikimedia' capabilities in supportedsites.md

pull/5071/merge
Mike Fährmann 3 weeks ago
parent bd932b6860
commit f52cf54e16
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1460,61 +1460,61 @@ Consider all listed sites to potentially be NSFW.
<tr> <tr>
<td>Wikimedia</td> <td>Wikimedia</td>
<td>https://www.wikimedia.org/</td> <td>https://www.wikimedia.org/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Wikispecies</td> <td>Wikispecies</td>
<td>https://species.wikimedia.org/</td> <td>https://species.wikimedia.org/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Wikimedia Commons</td> <td>Wikimedia Commons</td>
<td>https://commons.wikimedia.org/</td> <td>https://commons.wikimedia.org/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>MediaWiki</td> <td>MediaWiki</td>
<td>https://www.mediawiki.org/</td> <td>https://www.mediawiki.org/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Fandom</td> <td>Fandom</td>
<td>https://www.fandom.com/</td> <td>https://www.fandom.com/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>wiki.gg</td> <td>wiki.gg</td>
<td>https://www.wiki.gg/</td> <td>https://www.wiki.gg/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Super Mario Wiki</td> <td>Super Mario Wiki</td>
<td>https://www.mariowiki.com/</td> <td>https://www.mariowiki.com/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Bulbapedia</td> <td>Bulbapedia</td>
<td>https://bulbapedia.bulbagarden.net/</td> <td>https://bulbapedia.bulbagarden.net/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>PidgiWiki</td> <td>PidgiWiki</td>
<td>https://www.pidgi.net/</td> <td>https://www.pidgi.net/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Azur Lane Wiki</td> <td>Azur Lane Wiki</td>
<td>https://azurlane.koumakan.jp/</td> <td>https://azurlane.koumakan.jp/</td>
<td>Articles</td> <td>Articles, Categories, Files, Wikis</td>
<td></td> <td></td>
</tr> </tr>

@ -206,7 +206,7 @@ SUBCATEGORY_MAP = {
"redirect" : "Pixiv Redirects", "redirect" : "Pixiv Redirects",
}, },
"fapello": { "fapello": {
"path": "Videos, Trending Posts, Popular Videos, Top Models", "path": ["Videos", "Trending Posts", "Popular Videos", "Top Models"],
}, },
"furaffinity": { "furaffinity": {
"submissions": "New Submissions", "submissions": "New Submissions",
@ -240,9 +240,6 @@ SUBCATEGORY_MAP = {
"mangadex": { "mangadex": {
"feed" : "Followed Feed", "feed" : "Followed Feed",
}, },
"nana": {
"search": "Favorites, Search Results",
},
"nijie": { "nijie": {
"followed": "Followed Users", "followed": "Followed Users",
"nuita" : "Nuita History", "nuita" : "Nuita History",
@ -313,7 +310,7 @@ SUBCATEGORY_MAP = {
"uploads" : "", "uploads" : "",
}, },
"wallpapercave": { "wallpapercave": {
"image": "individual Images, Search Results", "image": ["individual Images", "Search Results"],
}, },
"weasyl": { "weasyl": {
"journals" : "", "journals" : "",
@ -326,6 +323,9 @@ SUBCATEGORY_MAP = {
"wikiart": { "wikiart": {
"artists": "Artist Listings", "artists": "Artist Listings",
}, },
"wikimedia": {
"article": ["Articles", "Categories", "Files"],
},
} }
BASE_MAP = { BASE_MAP = {
@ -441,12 +441,23 @@ def category_text(c):
return CATEGORY_MAP.get(c) or c.capitalize() return CATEGORY_MAP.get(c) or c.capitalize()
def subcategory_text(c, sc): def subcategory_text(bc, c, sc):
"""Return a human-readable representation of a subcategory""" """Return a human-readable representation of a subcategory"""
if c in SUBCATEGORY_MAP: if c in SUBCATEGORY_MAP:
scm = SUBCATEGORY_MAP[c] scm = SUBCATEGORY_MAP[c]
if sc in scm: if sc in scm:
return scm[sc] txt = scm[sc]
if not isinstance(txt, str):
txt = ", ".join(txt)
return txt
if bc and bc in SUBCATEGORY_MAP:
scm = SUBCATEGORY_MAP[bc]
if sc in scm:
txt = scm[sc]
if not isinstance(txt, str):
txt = ", ".join(txt)
return txt
if sc in SUBCATEGORY_MAP: if sc in SUBCATEGORY_MAP:
return SUBCATEGORY_MAP[sc] return SUBCATEGORY_MAP[sc]
@ -534,14 +545,14 @@ def build_extractor_list():
# define table columns # define table columns
COLUMNS = ( COLUMNS = (
("Site", 20, ("Site", 20,
lambda c, scs, d: category_text(c)), lambda bc, c, scs, d: category_text(c)),
("URL" , 35, ("URL" , 35,
lambda c, scs, d: d), lambda bc, c, scs, d: d),
("Capabilities", 50, ("Capabilities", 50,
lambda c, scs, d: ", ".join(subcategory_text(c, sc) for sc in scs lambda bc, c, scs, d: ", ".join(subcategory_text(bc, c, sc) for sc in scs
if subcategory_text(c, sc))), if subcategory_text(bc, c, sc))),
("Authentication", 16, ("Authentication", 16,
lambda c, scs, d: AUTH_MAP.get(c, "")), lambda bc, c, scs, d: AUTH_MAP.get(c, "")),
) )
@ -557,10 +568,10 @@ def generate_output(columns, categories, domains):
tbody = [] tbody = []
append = tbody.append append = tbody.append
for name, base in categories.items(): for bcat, base in categories.items():
if name and base: if bcat and base:
name = BASE_MAP.get(name) or (name.capitalize() + " Instances") name = BASE_MAP.get(bcat) or (bcat.capitalize() + " Instances")
append('\n<tr>\n <td colspan="4"><strong>' + append('\n<tr>\n <td colspan="4"><strong>' +
name + '</strong></td>\n</tr>') name + '</strong></td>\n</tr>')
clist = base.items() clist = base.items()
@ -571,7 +582,7 @@ def generate_output(columns, categories, domains):
append("<tr>") append("<tr>")
for column in columns: for column in columns:
domain = domains[category] domain = domains[category]
content = column[2](category, subcategories, domain) content = column[2](bcat, category, subcategories, domain)
append(" <td>" + content + "</td>") append(" <td>" + content + "</td>")
append("</tr>") append("</tr>")

Loading…
Cancel
Save