1234567891011121314151617181920212223242526272829303132333435 |
- from mastodon import Mastodon
- from config import *
- """
- following: account_unfollow
- followers: account_remove_from_followers
- lists: list_accounts_delete
- blocks: account_unblock
- mutes: account_unmute
- """
- def clean_accounts(mastodon, operations):
- for acc in operations.get("following", []):
- mastodon.account_unfollow(acc)
- for acc in operations.get("followers", []):
- mastodon.account_remove_from_followers(acc)
- for id, members in operations.get("lists_members", {}).items():
- mastodon.list_accounts_delete(id, members)
- for acc in operations.get("blocks", []):
- mastodon.account_unblock(acc)
- for acc in operations.get("mutes", []):
- mastodon.account_unmute(acc)
- if __name__ == "__main__":
- import json
- with open("operations.json", "r") as f:
- operations = json.load(f)
- mastodon = Mastodon(
- access_token=ACCESS_TOKEN, api_base_url=API_BASE_URL, ratelimit_method="pace"
- )
- #! are you sure? confirm again
- # clean_accounts(mastodon, operations)
|