Skip to content

Commit

Permalink
[wikimedia] support 'pidgi.net' and 'bulbapedia.bulbagarden.net' (#5205
Browse files Browse the repository at this point in the history
…, #5206)
  • Loading branch information
mikf committed Feb 17, 2024
1 parent 7033cc1 commit ccb413d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,18 @@ Consider all listed sites to potentially be NSFW.
<td>Articles</td>
<td></td>
</tr>
<tr>
<td>Bulbapedia</td>
<td>https://bulbapedia.bulbagarden.net/</td>
<td>Articles</td>
<td></td>
</tr>
<tr>
<td>PidgiWiki</td>
<td>https://www.pidgi.net/</td>
<td>Articles</td>
<td></td>
</tr>

<tr>
<td colspan="4"><strong>Moebooru and MyImouto</strong></td>
Expand Down
10 changes: 10 additions & 0 deletions gallery_dl/extractor/wikimedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ def _pagination(self, params):
"root": "https://www.mariowiki.com",
"pattern": r"(?:www\.)?mariowiki\.com",
},
"bulbapedia": {
"root": "https://bulbapedia.bulbagarden.net",
"pattern": r"(?:bulbapedia|archives)\.bulbagarden\.net",
"api-path": "/w/api.php",
},
"pidgiwiki": {
"root": "https://www.pidgi.net",
"pattern": r"(?:www\.)?pidgi\.net",
"api-path": "/wiki/api.php",
},
})


Expand Down
1 change: 1 addition & 0 deletions scripts/supportedsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"nsfwalbum" : "NSFWalbum.com",
"paheal" : "rule #34",
"photovogue" : "PhotoVogue",
"pidgiwiki" : "PidgiWiki",
"pixeldrain" : "pixeldrain",
"pornimagesxxx" : "Porn Image",
"pornpics" : "PornPics.com",
Expand Down
28 changes: 28 additions & 0 deletions test/results/bulbapedia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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://bulbapedia.bulbagarden.net/wiki/Jet",
"#category": ("wikimedia", "bulbapedia", "article"),
"#class" : wikimedia.WikimediaArticleExtractor,
"#pattern" : r"http://archives\.bulbagarden\.net/media/upload/\w+/\w+/[^/?#]+",
"#count" : range(10, 30),
},

{
"#url" : "https://archives.bulbagarden.net/wiki/File:0460Abomasnow-Mega.png",
"#category": ("wikimedia", "bulbapedia", "file"),
"#class" : wikimedia.WikimediaArticleExtractor,
"#pattern" : r"http://archives\.bulbagarden\.net/media/upload/\w+/\w+/[^/?#]+",
"#count" : range(8, 12),
"#archive" : False,
},

)
24 changes: 24 additions & 0 deletions test/results/pidgiwiki.py
Original file line number Diff line number Diff line change
@@ -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.pidgi.net/wiki/File:Key_art_-_Fight_Knight.png",
"#category": ("wikimedia", "pidgiwiki", "file"),
"#class" : wikimedia.WikimediaArticleExtractor,
"#urls" : "https://cdn.pidgi.net/images/0/0c/Key_art_-_Fight_Knight.png",
},

{
"#url" : "https://pidgi.net/wiki/File:Key_art_-_Fight_Knight.png",
"#category": ("wikimedia", "pidgiwiki", "file"),
"#class" : wikimedia.WikimediaArticleExtractor,
},

)

0 comments on commit ccb413d

Please sign in to comment.