[mastodon] support '/@USER/following' URLs
Previously, only '/users/USER/following' got matched.
This commit is contained in:
@@ -131,8 +131,8 @@ class MastodonBookmarkExtractor(MastodonExtractor):
|
||||
class MastodonFollowingExtractor(MastodonExtractor):
|
||||
"""Extractor for followed mastodon users"""
|
||||
subcategory = "following"
|
||||
pattern = BASE_PATTERN + r"/users/([^/?#]+)/following"
|
||||
example = "https://mastodon.social/users/USER/following"
|
||||
pattern = BASE_PATTERN + r"/(?:@|users/)([^/?#]+)/following"
|
||||
example = "https://mastodon.social/@USER/following"
|
||||
|
||||
def items(self):
|
||||
api = MastodonAPI(self)
|
||||
|
||||
@@ -70,6 +70,12 @@ __tests__ = (
|
||||
"#extractor": False,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://mastodon.social/@0x4f/following",
|
||||
"#category": ("mastodon", "mastodon.social", "following"),
|
||||
"#class" : mastodon.MastodonFollowingExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://mastodon.social/users/id:10843/following",
|
||||
"#category": ("mastodon", "mastodon.social", "following"),
|
||||
|
||||
Reference in New Issue
Block a user