[mastodon] Support non-numeric status IDs (#4936)

This commit is contained in:
Mike Fährmann
2023-12-16 01:52:31 +01:00
parent 2852404e49
commit 3f9c113d78
2 changed files with 22 additions and 1 deletions

View File

@@ -152,7 +152,7 @@ class MastodonFollowingExtractor(MastodonExtractor):
class MastodonStatusExtractor(MastodonExtractor):
"""Extractor for images from a status"""
subcategory = "status"
pattern = BASE_PATTERN + r"/@[^/?#]+/(\d+)"
pattern = BASE_PATTERN + r"/@[^/?#]+/(?!following)([^/?#]+)"
example = "https://mastodon.social/@USER/12345"
def statuses(self):

21
test/results/mastodon.py Normal file
View File

@@ -0,0 +1,21 @@
# -*- 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 mastodon
__tests__ = (
{
"#url" : "mastodon:https://donotsta.re/@elly/AcoUaA7EH1igiYKmFU",
"#category": ("mastodon", "donotsta.re", "status"),
"#class" : mastodon.MastodonStatusExtractor,
"#urls" : "https://asdf.donotsta.re/media/917e7722dd30d510686ce9f3717a1f722dac96fd974b5af5ec2ccbc8cbd740c6.png",
"instance": "donotsta.re",
"instance_remote": None,
},
)