This is a Python3 script that uses the Twitter API to download your Twitter blocklist or mutelist and generate a HTML file with all usernames listed and clickable. You can use this list as a reference to share, mute or block unwanted accounts elsewhere.
This script was created because blocklist/mutelist exporting/importing, introduced on the platform in 2015, has been absent without notice since 2019.
python3 blocklist_exporter.py
. After the script has run, your exported blocklist can be found in blocklist.html
.--mutelist
to the command: python3 blocklist_exporter.py --mutelist
Python 3 with the Tweepy library is required. Install it using pip3 install tweepy
or through your distribution package manager. You also need Twitter API keys. Check the section below on how to generate them.
Twitter Blocklist exporter v0.2 - https://github.com/Forceflow/twitter_blocklist_exporter
---
Loading Twitter API keys from file
Authenticating with Twitter
Grabbing blocklist
279 blocked accounts found. Writing to blocklist.html
Done. Exiting.
In order to query and download your blocklist/mutelist, this script needs API tokens that you need to provide in a keys.json
file in the same directory as the script.
At the time of writing (10-03-2023), this is how you generate the tokens required to export your blocklist/mutelist. Also at the time of writing, this functionality still is free for a limited amount of requests. Tweepy batches the requests as much as possible.
API_KEY
and API_KEY_SECRET
. You will only be shown these once.ACCESS_TOKEN
and ACCESS_TOKEN_SECRET
keys.json.example
to keys.json
and fill in the API_KEY
, API_KEY_SECRET
, ACESS_TOKEN
and ACCESS_TOKEN_SECRET
values.