[mastodon] Add unit tests for various statuses URL formats on various fediverse software (mastodon/akkoma/pleroma)

Signed-off-by: Soblow "Opale" Xaselgio <113846014+Soblow@users.noreply.github.com>
This commit is contained in:
Soblow "Opale" Xaselgio
2025-05-09 11:50:06 +02:00
parent a94672bede
commit eba44b8f78

View File

@@ -8,6 +8,7 @@ from gallery_dl.extractor import mastodon
__tests__ = (
# Akkoma - /:user/:status_id
{
"#url" : "mastodon:https://donotsta.re/@elly/AcoUaA7EH1igiYKmFU",
"#category": ("mastodon", "donotsta.re", "status"),
@@ -29,4 +30,52 @@ __tests__ = (
"instance_remote": None,
},
# Akkoma - /notice/:status_id
{
"#url" : "mastodon:https://woem.space/notice/Aswds12sVGsm55NS2S",
"#category": ("mastodon", "woem.space", "status"),
"#class" : mastodon.MastodonStatusExtractor,
"#urls" : "https://nbg1.your-objectstorage.com/woem-space/261f4f482e1cb641db732dab91f0177b1f5ea0bcf008f4831c593ff718dff4fe.jpg",
"instance" : "woem.space",
"instance_remote": None,
},
# Note that Akkoma/Pleroma urls of type /objects/:UUID won't work,
# but attempting to access them will trigger a redirect.
# We could follow them
# Akkoma - /notice/:status_id
{
"#url" : "mastodon:https://labyrinth.zone/notice/Ai9Y2EijwN3gAil1nM",
"#category": ("mastodon", "labyrinth.zone", "status"),
"#class" : mastodon.MastodonStatusExtractor,
"#urls" : "https://media.labyrinth.zone/media/96e10a9e3b0f24f63713d8a03e939eec7f9e636cdef57a14c389163f58e60947.png",
"instance" : "labyrinth.zone",
"instance_remote": None,
},
# Pleroma - /notice/:status_id
{
"#url" : "mastodon:https://udongein.xyz/notice/Asl9hUpShUamlVAZiC",
"#category": ("mastodon", "udongein.xyz", "status"),
"#class" : mastodon.MastodonStatusExtractor,
"#urls" : "https://statics.udongein.xyz/udongein/cc3c7a8b749cd88298fda6553e10f81f9c4de280f03ad107ed25a439e6be23eb.jpg?name=Husky_1743801357069_6QIL5OZLXK.jpg",
"instance" : "udongein.xyz",
"instance_remote": None,
},
# Mastodon - /:user/:status_id
{
"#url" : "mastodon:https://freeradical.zone/@bitartbot/114477182939377350",
"#category": ("mastodon", "freeradical.zone", "status"),
"#class" : mastodon.MastodonStatusExtractor,
"#urls" : "https://nfts.freeradical.zone/media_attachments/files/114/477/182/897/690/030/original/96700c8ae9a79651.png",
"instance" : "freeradical.zone",
"instance_remote": None,
}
)