This Python script allows you to post frames from a film (or TV show) to a mastodon account. The script is customizable, allowing you to set the number of frames per second and the time interval between posts.
- Python 3
- FFmpeg
- A Mastodon account
- Install the required Python packages:
pip install Mastodon.py
-
Create a Mastodon account on your desired instance (e.g., mastodon.social) and log in.
-
Visit the "Development" section under your account settings and create a new application. Take note of the generated
client_id
,client_secret
, andaccess_token
. -
Replace the placeholders in the script with the appropriate values:
your_client_id
: Your Mastodon application's client IDyour_client_secret
: Your Mastodon application's client secretyour_access_token
: Your Mastodon account's access tokeninstance_url
: The URL of your Mastodon instance (e.g., 'https://mastodon.social')path/to/your/video/file
: The path to your video filepath/to/your/subtitle/file
: The path to your subtitle file
- Customize the following variables as desired:
frames_per_second
: The number of frames to extract from each second of the videoframe_interval
: The time interval (in minutes) between each postfilm_name
: The name of the film being processed
Run the script using Python:
python frames_bot.py
The script will start posting frames to your Mastodon account according to the specified settings. To stop the script, press Ctrl + C
in the terminal.
I have this on a server running continuously but I know another way is to make the code post one frame and task schedule it to run every x minutes