[newgrounds] fix URLs produced by 'followng' extractors (#684)

pull/726/head
Mike Fährmann 4 years ago
parent baa877d853
commit c56a751dae
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,5 +1,7 @@
# Changelog
## Unreleased
## 1.13.5 - 2020-04-27
### Additions
- [500px] recognize `web.500px.com` URLs

@ -288,7 +288,7 @@ class NewgroundsMediaExtractor(NewgroundsExtractor):
class NewgroundsArtExtractor(NewgroundsExtractor):
"""Extractor for all images of a newgrounds user"""
subcategory = "art"
pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/art/?$"
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/art/?$"
test = ("https://tomfulp.newgrounds.com/art", {
"pattern": NewgroundsImageExtractor.pattern,
"count": ">= 3",
@ -298,7 +298,7 @@ class NewgroundsArtExtractor(NewgroundsExtractor):
class NewgroundsAudioExtractor(NewgroundsExtractor):
"""Extractor for all audio submissions of a newgrounds user"""
subcategory = "audio"
pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/audio/?$"
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/audio/?$"
test = ("https://tomfulp.newgrounds.com/audio", {
"pattern": r"https://audio.ngfiles.com/\d+/\d+_.+\.mp3",
"count": ">= 4",
@ -308,7 +308,7 @@ class NewgroundsAudioExtractor(NewgroundsExtractor):
class NewgroundsMoviesExtractor(NewgroundsExtractor):
"""Extractor for all movies of a newgrounds user"""
subcategory = "movies"
pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/movies/?$"
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/movies/?$"
test = ("https://tomfulp.newgrounds.com/movies", {
"pattern": r"https://uploads.ungrounded.net(/alternate)?/\d+/\d+_.+",
"range": "1-10",
@ -319,7 +319,7 @@ class NewgroundsMoviesExtractor(NewgroundsExtractor):
class NewgroundsUserExtractor(NewgroundsExtractor):
"""Extractor for a newgrounds user profile"""
subcategory = "user"
pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/?$"
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/?$"
test = (
("https://tomfulp.newgrounds.com", {
"pattern": "https://tomfulp.newgrounds.com/art$",
@ -414,6 +414,6 @@ class NewgroundsFollowingExtractor(NewgroundsFavoriteExtractor):
@staticmethod
def _extract_favorites(page):
return [
"https://" + user.rpartition('"')[2]
"https://" + user.rpartition('"')[2].lstrip("/:")
for user in text.extract_iter(page, 'class="item-user', '"><img')
]

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.13.5"
__version__ = "1.13.6-dev"

Loading…
Cancel
Save