From 6f4d5df705fc626fca378296a3409540a210c536 Mon Sep 17 00:00:00 2001 From: pcgaldo Date: Mon, 28 Oct 2024 19:59:28 +0100 Subject: [PATCH] Adicionar Readme.md --- Readme.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..01b99d2 --- /dev/null +++ b/Readme.md @@ -0,0 +1,41 @@ +# Mastodon Screenshot Detection Bot + +## Overview + +This script is a bot designed to monitor your personal Mastodon instance for potential screenshots of your posts. It utilizes Optical Character Recognition (OCR) to analyze images shared in toots and checks if they contain any fragments of your username or other specified text. This is particularly useful for individuals who want to track unauthorized sharing or reposting of their content across their instance. + +## Features + +- **Image Monitoring**: The bot listens for images shared in toots across your Mastodon instance, including posts from multiple accounts you manage. +- **Text Recognition**: It employs the `pytesseract` library to extract text from images using OCR, allowing it to detect your username or any specified text. +- **Real-Time Notifications**: When a potential screenshot of your post is detected, the bot sends a direct notification to your Mastodon account, ensuring you're always informed about how your content is being used. +- **Customizable Usernames**: You can easily modify the list of usernames or keywords the bot should look for, making it adaptable to your specific needs. + +## Dependencies + +To run this script, you need to have the following dependencies installed on your server: + +1. **Python 3.x** +2. **Pillow**: For image processing. + - `pip3 install pillow` +3. **pytesseract**: For Optical Character Recognition. + - `pip3 install pytesseract` +4. **requests**: For making HTTP requests. + - `pip3 install requests` +5. **Mastodon.py**: The Mastodon API wrapper for Python. + - `pip3 install Mastodon.py` +6. **Tesseract OCR**: Ensure Tesseract is installed on your system. Installation instructions vary by operating system: + - **Ubuntu/Debian**: + - `sudo apt install tesseract-ocr` + +## Implementation + +1. **Configure the Script**: Open the script file and replace the placeholders with your actual Mastodon API token and instance URL: + ```python + mastodon = Mastodon( + access_token='YOUR_API_TOKEN', + api_base_url='https://YOUR_MASTODON_INSTANCE' + ) +2. **Run the bot**: Execute the script to start monitoring for screenshots. + + - `python3 bot_mastodon.py`