Warning
The previous version of this project faced significant issues with maintainability and scope. Instead of continuing to fix those issues, I have re-written the main features into a new program called DiscordTorrentManager. This new version allows you to search and download content directly to a movie folder from a Discord application, making it compatible with Plex, Jellyfin, VLC, etc.
DiscordMovieBot is a simple Discord bot created to provide users with a robust set of tools for efficient torrent management and seamless online stream searching, all within the confines of a Discord server. The bot establishes a connection with a qbittorrent seedbox, providing your Discord users with an intuitive interface to effortlessly explore and obtain movies, TV shows, books, or add existing torrents via magnet links. DiscordMovieBot is simple in its design and does not use the Radarr/Jackett suite of software as a torrent collection management system. Instead, it utilizes custom api wrappers of popular trackers such as 1337x.to, YIFY, torrentdownload, Library Genesis, and others, in conjunction with the qbittorrent Python API. This approach enables seamless, automated management of torrents directly to and from a qBittorrent instance.
-
Ensure that qBittorrent WebUI access with authentication is configured on the seedbox by enabling the webui feature and adding a user with a password.
-
Add qBittorrent categories for each media type that can be torrented via the leftmost ui panel: "movie", "tv", "fitgirl repack" each with a specified path to their desired download location.
-
Create a bot via the Discord developer portal making sure to enable message content intents.
-
Go to the OAuth URL generation page and give the bot the "bot" scope and all necessary permissions to send messages, reactions, embeds, read messages, embed links, add slash commands, and manage messages. Simply invite the bot to a server.
-
Clone and cd into the repo:
git clone https://github.com/JakeTurner616/DiscordMovieBot && cd DiscordMovieBot
-
Setup a venv:
python -m venv discordmoviebot
-
Activate the discordmoviebot venv:
On Windows:
.\discordmoviebot\Scripts\activate
On macOS/Linux:
source discordmoviebot/bin/activate
-
Install the requirements:
pip install -r requirements.txt
-
Customize local configuration values within
config.ini
.
After configuring, DiscordMovieBot can be deployed by running bot.py within the venv. The backend Flask application is in non-production mode, and its port 5000 should not be forwarded unless a WSGI is used.
-
/search <Movie Title>
- Searches the yts torrent search engine API and displays movie results as selectable embeds.
-
/altsearch <Movie Title>
- Searches the 1337x torrent search engine API and displays movie results as selectable embeds.
-
/magnet <Magnet link> <category>
- Manually adds a magnet link to the torrent client. Must include a torrent category.
-
/delete <optional_delete_index>
- Deletes either all active torrents or a select active torrent.
-
/epsearch <TV Show Title>
- Searches for and displays an episode list for each season of a given TV show.
-
/tvsearch <TV Show Title SnnEnn>
- Searches a torrent search engine API and displays TV results as selectable embeds.
-
/advtvsearch <Movie Title>
- Searches torrent search engine on torrentdownload.info and displays TV results as selectable embeds.
-
/status <optional_delete_index>
- Shows all active torrents and allows for individual deletion of torrents.
-
/youtube <YouTube title or link>
- Downloads a video from YouTube either from a link or through a search.
-
/pbsdownload <video_url>
- Downloads content from pbs.org or any PBS site.
Note
If you're looking for code to programmatically find and download e-books and pdf files with more control, check out Infinity Library. It's a Java desktop program designed to easily locate and obtain e-textbooks in a variety of formats from mirrors across the internet.
-
/booksearch <title> <fiction/non-fiction>
- Searches and downloads books from libgen.
-
/simplebooksearch <title>
- Searches books from annas-archive without downloading them.
-
/pdfdownload <link> <filename>
- download books from a direct download link with a filename excluding the extension.
-
/suggest <Genre>
- Suggests a random movie based on genre by calling an API.
-
/diceroll <[optional int]d[int]>
- Rolls dice based on user input and displays result.
/debug
- Displays the debug menu.