[mastodon] add "remote_instance" field (#3119)
Example Usage: If the url is "mastodon:https://mastodon.example.org/@VoteChess@botsin.space the "remote_instance" will be "botsin.space" ... "directory": ["mastodon", "{remote_instance|instance}", "{account[username]!l}"] ...
This commit is contained in:
@@ -44,6 +44,10 @@ class MastodonExtractor(BaseExtractor):
|
||||
del status["media_attachments"]
|
||||
|
||||
status["instance"] = self.instance
|
||||
acct = status["account"]["acct"]
|
||||
status["instance_remote"] = \
|
||||
acct.rpartition("@")[2] if "@" in acct else None
|
||||
|
||||
status["tags"] = [tag["name"] for tag in status["tags"]]
|
||||
status["date"] = text.parse_datetime(
|
||||
status["created_at"][:19], "%Y-%m-%dT%H:%M:%S")
|
||||
|
||||
Reference in New Issue
Block a user