Skip to content

Commit

Permalink
[newgrounds] add 'games' extractor (#2955)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 24, 2022
1 parent 68f11e0 commit 0393e59
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ Description
when processing a user profile.

Possible values are
``"art"``, ``"audio"``, ``"movies"``.
``"art"``, ``"audio"``, ``"games"``, ``"movies"``.

You can use ``"all"`` instead of listing all values separately.

Expand Down
2 changes: 1 addition & 1 deletion docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Consider all sites to be NSFW unless otherwise known.
<tr>
<td>Newgrounds</td>
<td>https://www.newgrounds.com/</td>
<td>Art, Audio, Favorites, individual Images, Media Files, Movies, Search Results, User Profiles</td>
<td>Art, Audio, Favorites, Games, individual Images, Media Files, Movies, Search Results, User Profiles</td>
<td>Supported</td>
</tr>
<tr>
Expand Down
12 changes: 12 additions & 0 deletions gallery_dl/extractor/newgrounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ class NewgroundsMoviesExtractor(NewgroundsExtractor):
})


class NewgroundsGamesExtractor(NewgroundsExtractor):
"""Extractor for a newgrounds user's games"""
subcategory = _path = "games"
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/games/?$"
test = ("https://tomfulp.newgrounds.com/games", {
"pattern": r"https://uploads.ungrounded.net(/alternate)?/\d+/\d+_.+",
"range": "1-10",
"count": 10,
})


class NewgroundsUserExtractor(NewgroundsExtractor):
"""Extractor for a newgrounds user profile"""
subcategory = "user"
Expand All @@ -454,6 +465,7 @@ def items(self):
return self._dispatch_extractors((
(NewgroundsArtExtractor , base + "art"),
(NewgroundsAudioExtractor , base + "audio"),
(NewgroundsGamesExtractor , base + "games"),
(NewgroundsMoviesExtractor, base + "movies"),
), ("art",))

Expand Down

0 comments on commit 0393e59

Please sign in to comment.