Skip to content

About

Automation tool to scrape and download videos from a Discord channel directly to your local/server media directory for Plex, Jellyfin, or local storage.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Discord2Plex

Automation tool to scrape and download videos from a Discord channel directly to your local/server media directory for Plex, Jellyfin, or local storage.

Features

  • Auto-downloads .mp4, .mkv, .webm, .mov, .avi files from Discord channel history.
  • Prevents duplicate downloads automatically.
  • Smart anti-spam delay between downloads (30–60s) to avoid Discord rate-limits or bans.
  • Includes MAX_VIDEOS test mode for quick verification.

Setup Instructions

1. Requirements

  • Python 3.10+
  • uv (recommended package manager)

2. Configuration (.env)

Create a .env file in the root folder with the following variables:

DISCORD_TOKEN="YOUR_DISCORD_TOKEN_HERE"
DISCORD_CHANNEL_ID="YOUR_CHANNEL_ID_HERE"
DOWNLOAD_DIR="/path/to/your/Plex/DiscordVideos"

# Optional: Set to 1 for quick test, or 0 (or omit) for full download
MAX_VIDEOS=0

# Time parameters (in seconds)
DOWNLOAD_DELAY_MIN=30
DOWNLOAD_DELAY_MAX=60
STREAMABLE_DELAY_MIN=2
STREAMABLE_DELAY_MAX=5
PAGE_DELAY=10

How to Get Your Discord Token

Warning: Never share your Discord token with anyone. It gives full access to your account.

  1. Open Discord in your Web Browser (Chrome, Brave, Firefox, etc.) and log in.
  2. Press F12 or Cmd + Option + I (Mac) to open Developer Tools.
  3. Switch to the Console tab.
  4. Paste the snippet below and press Enter:
window.webpackChunkdiscord_app.push([[Symbol()],{},e=>{
  for(let m of Object.values(e.c)){
    let x = m?.exports?.default || m?.exports;
    if(x?.getToken && typeof x.getToken === 'function'){
      let t = x.getToken();
      if(typeof t === 'string' && t.length > 30){
        console.log("%cTOKEN DISCORD KAMU:", "color: lime; font-size: 20px; font-weight: bold;", t);
      }
    }
  }
}]);
  1. Copy the generated token string into your .env file.

Available Scripts & Usage

1. Direct Attachments Scraper (discord_scraper.py)

Scrapes channel history and downloads direct .mp4, .mkv, .mov, etc. file attachments.

uv run discord_scraper.py

2. Streamable Links Scraper (streamable_scraper.py)

Scrapes channel history for https://streamable.com/... links and downloads them via yt-dlp.

uv run streamable_scraper.py

3. Real-Time Bot for New Episodes (discord_bot.py)

Official Discord Bot listener for 100% legal, real-time downloads of new episodes auto-forwarded to your channel with zero risk of account ban.

Additional .env Configuration:

DISCORD_BOT_TOKEN="YOUR_OFFICIAL_DISCORD_BOT_TOKEN"
DISCORD_BOT_CHANNEL_ID="YOUR_BOT_CHANNEL_ID"

Run the Real-Time Bot:

uv run discord_bot.py

4. Episode Renamer (rename_episodes.py)

Standardizes all messy downloaded filenames into Plex-compatible format (e.g. Chiikawa - S01E096.mp4).

Preview changes (Dry-Run):

uv run rename_episodes.py --folder "/home/amfakh/media/TV Shows/Chiikawa"

Apply changes:

uv run rename_episodes.py --folder "/home/amfakh/media/TV Shows/Chiikawa" --apply

About

Automation tool to scrape and download videos from a Discord channel directly to your local/server media directory for Plex, Jellyfin, or local storage.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages