Discord bot for automated media tools, with features ported and improved from the original After Effects extension.
Queue-based Remove Background, Duplicate Deadframes Remover, and YouTube Downloader (Video/WebM + MP3) all features from the extension, now in bot form!
The Precut Script Bot is a Discord bot that helps editors by automating common AE extension tasks.
The bot began as an After Effects extension, and its features were transferred and expanded for Discord:
- Remove Background (RMBG /
rembgCPU) for a single image - Remove Duplicate/Dead Frames for short videos (Discord upload-limit friendly)
- YouTube Downloader (separate Video/WebM + MP3 channels)
- Queue system (MySQL): runs jobs one-at-a-time for Remove BG / Dedup / YouTube
- System channels: users can only submit the correct content (auto-deletes free chat)
- Results channels: optionally post output into a separate channel, show “Requested by @user”
- Component Containers (V2): Dedup + YouTube video use enhanced, interactive layouts (as in the extension)
- Discord limits aware: checks file sizes vs server boost limits (Ryujin-style 8MB / 50MB)
- Admin runs
/managesysteminside a channel to set it as a submit channel:- Remove Background submit channel (image uploads)
- Dedup submit channel (video uploads)
- YouTube Download (MP4) channel (YouTube links, delivered as WebM for speed)
- YouTube Download (MP3) channel (YouTube links)
- Users drop an attachment/link in the configured channel.
- The bot enqueues it in MySQL and processes jobs sequentially.
- The result is posted in the same or in a results channel (mimicking the extension's workflow).
- Python 3.10+
- FFmpeg available on the machine (required for YouTube merge/copy + MP3 conversion)
- MySQL (required for channel config + queue)
Runs on CPU; heavy workloads (e.g., background removal) should be throttled via .env limits.
- Install dependencies:
pip install -r requirements.txt- Configure
.env:
- Copy
.env.example→.env - Set
DISCORD_TOKEN - Set MySQL:
MYSQL_HOSTMYSQL_USERMYSQL_PASSWORDMYSQL_DATABASE
- Run the bot:
python bot.py- Open Discord Developer Portal → your app → OAuth2 → URL Generator
- Scopes:
bot,applications.commands - Required permissions (recommended):
- View Channels, Send Messages, Read Message History
- Attach Files, Embed Links
- Manage Messages (pin setup messages + delete invalid submissions)
- In Bot → Privileged Gateway Intents, enable Message Content Intent (needed for channel-based submission workflows as in the extension)
/helpcommand list/pingstatus / latency/infoabout/removebgone-off remove background (attachment)/dedupone-off dedup (attachment)/managesystemconfigure submit channels (admin)
- Remove BG submit channel: upload 1 image → bot returns PNG
- Dedup submit channel: upload 1 video → bot returns processed clip
- YouTube video channel (labeled “MP4” in setup): post a YouTube URL → bot returns WebM video (fast method)
- YouTube MP3 channel: post a YouTube URL → bot returns MP3 (320 kbps)
All major extension features are supported as channels or commands.
Duplicate Deadframes Remover (feature originally from the extension)
YouTube Audio Downloader
YouTube Video Downloader
Help Command
This project is licensed under the MIT License with Commons Clause. Commercial sale or monetized distribution of this software is not allowed. See the LICENSE file for details.




