Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanbohacek/mastodon-domain-block-exporter-script
A simple script for exporting a trusted Mastodon server's domain block list.
https://github.com/stefanbohacek/mastodon-domain-block-exporter-script
fediverse mastoadmins mastodon
Last synced: 11 days ago
JSON representation
A simple script for exporting a trusted Mastodon server's domain block list.
- Host: GitHub
- URL: https://github.com/stefanbohacek/mastodon-domain-block-exporter-script
- Owner: stefanbohacek
- Created: 2024-06-27T00:07:22.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-08T22:20:28.000Z (3 months ago)
- Last Synced: 2024-11-07T18:12:07.106Z (2 months ago)
- Topics: fediverse, mastoadmins, mastodon
- Language: Python
- Homepage: https://stefanbohacek.com/project/mastodon-domain-block-exporter-script/
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![A screenshot of a command prompt with the output of the script: python script.py mastodon.social true false true, downloading domain blocks from mastodon.social...processing...saving to mastodon.social-domain-blocks.csv...done!](thumbnail-small.png)
# Mastodon domain block exporter script
Export domain blocks from a Mastodon server into an importable CSV file.
To use the script, download and run `script.py` following the format:
```sh
python script.py domain reject_media reject_reports obfuscate
```From Mastodon's [documentation](https://docs.joinmastodon.org/methods/admin/domain_blocks/#form-data-parameters):
- `reject_media`: Whether media attachments should be rejected.
- `reject_reports`: Whether reports from this domain should be rejected.
- `obfuscate`: Whether to partially censor the domain when shown in public.An example command to download domain blocks from mastodon.social with `reject_media` and `obfuscate` set to `false`, and `reject_reports` set to true.
```sh
python script.py mastodon.social true false true
```Running this command will create a file `mastodon.social-domain-blocks.csv` which you can then import from the `/admin/export_domain_blocks/new` page on your server (eg. `https://mastodon.social/admin/export_domain_blocks/new`).
You will be prompted to confirm each individual domain before it's imported, and you will also be warned about any existing follow relationships that would be severed.
Note that not all Mastodon servers make their domain block lists publicly available. In those cases you will see a `403: Forbidden` error.