[mastodon] support '/@USER/following' URLs

Previously, only '/users/USER/following' got matched.
pull/4539/head
Mike Fährmann 1 year ago
parent 9f75713e00
commit 24a1d46391
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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"),

Loading…
Cancel
Save