All Projects → HexCodeFFF → mediaforge

HexCodeFFF / mediaforge

Licence: GPL-3.0 license
A Discord bot for editing and creating videos, images, GIFs, and more!

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Dockerfile
14818 projects
powershell
5483 projects

Projects that are alternatives of or similar to mediaforge

TragicSimpBot
TragicSimp is a discord bot that can send memes, facts, jokes, quotes, and track user stats. This bot has leveling system which rank user based on their commands in a channel created by Bot
Stars: ✭ 22 (-51.11%)
Mutual labels:  fun, meme, discord-bot, discord-py
birthday.py
🎉 A simple discord bot in discord.py that helps you understand the usage of SQL databases
Stars: ✭ 30 (-33.33%)
Mutual labels:  fun, discord-py
Discord-Study-Bot
Discord-Study-Bot is a Study-Time-based leaderboard system in discord servers. This features an Overall leaderboard and leaderboards based on a Daily, Weekly, and Monthly basis.
Stars: ✭ 20 (-55.56%)
Mutual labels:  fun, discord-py
Raid-Protect-Discord-Bot
A Discord Bot that allows you to protect your Discord server with captcha, anti profanity, anti nudity image, anti spam, account age required, logs...
Stars: ✭ 182 (+304.44%)
Mutual labels:  discord-bot, discord-py
Nitro
A discord bot
Stars: ✭ 56 (+24.44%)
Mutual labels:  fun, discord-bot
Calypsobot
A fully customizable bot built with discord.js
Stars: ✭ 131 (+191.11%)
Mutual labels:  fun, discord-bot
rainbot
rainbot is a moderation bot that has robust automod and logging features.
Stars: ✭ 62 (+37.78%)
Mutual labels:  discord-bot, discord-py
Loritta
💁 A multipurpose, multilanguage, customizable, modular, and very cute bot for Discord using JDA! ~Making your server more awesome~
Stars: ✭ 253 (+462.22%)
Mutual labels:  fun, discord-bot
Discord-Games
A library for making implementing conventional games into your discord bot, easier.
Stars: ✭ 31 (-31.11%)
Mutual labels:  discord-bot, discord-py
emojis
An emoji management bot for Discord.
Stars: ✭ 18 (-60%)
Mutual labels:  discord-bot, discord-py
ValorantStoreChecker-discord-bot
Valorant Utility Bot
Stars: ✭ 154 (+242.22%)
Mutual labels:  discord-bot, discord-py
tmerc-cogs
Cogs for the Red Discord bot.
Stars: ✭ 35 (-22.22%)
Mutual labels:  discord-bot, discord-py
Remixbot
A multifunctional Discord bot in development that allows you to easily control your discord server.
Stars: ✭ 39 (-13.33%)
Mutual labels:  fun, discord-bot
Instagram-Like-Comment-Bot
📷 An Instagram bot written in Python using Selenium on Google Chrome. It will go through posts in hashtag(s) and like and comment on them.
Stars: ✭ 53 (+17.78%)
Mutual labels:  chromedriver, selenium-webdriver
Discord bot.py
🍺 A simple discord bot that helps you getting started within discord.py
Stars: ✭ 313 (+595.56%)
Mutual labels:  fun, discord-bot
buttons
A simple to use interactive session and paginator with custom button support for discord.py.
Stars: ✭ 30 (-33.33%)
Mutual labels:  discord-bot, discord-py
memer-action
A GitHub Action for Programmer Memes xD
Stars: ✭ 21 (-53.33%)
Mutual labels:  fun, meme
neo
A Discord bot built to satisfy a multitude of needs
Stars: ✭ 16 (-64.44%)
Mutual labels:  discord-bot, discord-py
Corona-Tracker-Bot
Discord bot for coronavirus (COVID-19) , With Ai [Machine learning algorithms] integrated into it
Stars: ✭ 26 (-42.22%)
Mutual labels:  discord-bot, discord-py
ksoftapi.py
Official API Wrapper for KSoft.Si API
Stars: ✭ 31 (-31.11%)
Mutual labels:  discord-bot, discord-py

MediaForge

MediaForge Discord Discord Bots Discord Bots Discord Bots uptime

Total Lines stars built with immense swag

ko-fi

A Discord bot for editing and creating videos, images, GIFs, and more!

general technical info about the bot

  • inspired by esmBot
  • uses nextcord, a fork of discord.py
  • uses FFmpeg for most media functions
  • uses selenium and ChromeDriver to render captions in html with Chrome
    • although not the fastest approach, it is very simple and very powerful

self-host with docker

MediaForge inside docker is very new, please report any issues or unintended behavior.

to install

All you need to install yourself is Docker Desktop

as of writing, a working docker copy of MediaForge takes up ~2.5GB. if this is a concern and you are using some of the apt libraries MediaForge does, see to self-host natively

once that's installed, run these commands in your terminal of choice.

docker build -t melodyflorum/mediaforge https://github.com/HexCodeFFF/mediaforge.git
docker run -it --cap-add SYS_NICE melodyflorum/mediaforge

on linux, you may need to run docker with sudo

if the installation succeeded, you should be prompted with some options. you'll need to select "Edit Config". this will open a text editor within your terminal. the 2 required config settings to change for proper functionality are the discord and tenor tokens. be sure not to add or remove quotes. press CTRL+S to save and CTRL+X to exit.

if you don't want to use the built-in text editor, you can get the example config from GitHub, hold down CTRL+K to clear the file and then use CTRL+V to paste in your config.

to run

run docker ps -a in your terminal to see the created docker image. your container should have a 12 character "ID", which you'll need to run it.

run in your favorite terminal:

docker start -ia <ID>

replacing <ID> with the aforementioned ID. run this every time you want to start MediaForge.

to stop

killing the terminal window/CTRL+C won't kill the bot, because docker runs in the background.

to kill the bot, run

docker stop <ID>

replacing <ID> with the ID from the previous step (you can always re-run the command to get it)

to limit resource consumption

since docker is very containerized, you can easily limit the amount of resources it's allowed to consume.

the main command to do this is docker update, though most of these arguments can be passed verbatim to docker run during setup.

the most useful options are --memory and --cpus.

for example, this is (as of writing) what the official MediaForge bot uses:

docker update --memory 9000M --memory-swap -1 --cpus "3.9" <containerid>
  • --memory 9000M: this limits it to 9gb (9000mb) of physical memory
  • --memory-swap -1: this allows it to use as much swap memory as it wants (swap memory is temporarily storing memory on disk)
  • --cpus "3.9": the host server has 4 cores, so this allows it to use "3.9"/4 (97.5%) of the PC's CPU time.

Automode

this is designed to work with hosting providers where terminal control is not possible. There are 3 arguments to this mode that can be set as docker build arguments or environment variables . AUTOMODE: set to "ON" to enable automode AUTOUPDATE: set to "ON" to update code and packages every run CONFIG: base64 encoded version of your config file.

to encode base 64

on linux:
  • base64 config.py prints the output to terminal
  • base64 config.py > config.txt writes the output to config.txt
with python:
import base64

with open("config.py", "rb") as f:
    out = base64.b64encode(f.read())
print(out)  # write to terminal
# write to file
with open("config.txt", "wb+") as f:
    f.write(out)

to self-host natively

MediaForge is a complex application and manually installing all dependencies is a headache. for almost all use cases, the docker distribution is much better.

summary

ensure your OS is one of the supported OSes, then install the python libraries and the non-python libraries, set up the config, and run

supported OSes

built and tested on windows 10/11 and ubuntu 18/20, and these 2 OSes (and their successors) will continue to be officially supported.

will probably work on macos and other linux/unix distros if the below libraries are available but theyre untested and unsupported. just replace apt-get with your system's preferred package manager (brew for macos)

python libraries

  • This project uses poetry, run poetry install to install the required dependencies.
    • install poetry with pip install poetry
    • aubio and PyAutoTune are built from source on installation.
      • on Windows this will require the MSVC compiler, which is an optional component of Visual Studio
      • on Linux this will require gcc, installable by sudo apt-get install gcc

non-python libraries

the bot uses many external CLI programs for media processing.

  • FFmpeg - not included but easily installable on windows and linux
    • Ensure that ffmpeg version >= 5
  • gifski - windows executable is included. linux version downloadable from the website
  • pngquant - windows executable is included. installable on linux with sudo apt-get install pngquant
  • ChromeDriver - ChromeDriver is automatically downloaded to match the chrome installation on your system when the bot starts.
    • if on linux, chrome must be in the system bin/path
    • if on windows, chrome must be in one of the default locations
    • (specifically the win10 ones)
  • ImageMagick - not included but downloadable here
  • ExifTool - windows executable is included. installable on linux with sudo apt-get install exiftool https://exiftool.org/
  • apngasm - windows executable is included. installable on linux with sudo apt-get install apngasm
  • TTS
    • on linux, this uses mimic. a pre-compiled binary is included.
      • the male and female voices are downloaded from mimic's repo on bot start if they are not detected. if you want to re-download for some reason, delete the 2 files ending in .flitefox in tts/
    • on windows, powershell is used to access Windows's native TTS . Both are included in modern versions of Windows, but ensure powershell is in the system path.
    • the "retro" voice uses sam-cli. it is included, but it requires node.js to be installed and added to the system path
      • pretty sure both the windows & linux installers add it to path on installation but cant hurt to check

config

  • create a copy of config.example.py and name it config.py.
  • insert/change the appropriate config settings such as your discord api token. be sure not to add or remove quotes.
  • the 2 required config settings to change for proper functionality are the discord and tenor tokens.

python

  • developed and tested on python 3.8. use that or a later compatible version
  • python 3.10 is NOT compatible (yet) 3.9 should work

to run

  • once you've set up all of the libraries, just run the program with poetry run python main.py ( or poetry run python3.8 main.py or whatever your python is named). make sure it can read and write to the directory it lives in and also access/execute all the aforementioned libraries
    • if poetry isn't installing on the right python version, run <yourpython> -m pip instead of pip and <yourpython> -m poetry instead of poetry
  • terminate the bot by running the shutdown command, this will probably close better than a termination
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].