Automation tool to scrape and download videos from a Discord channel directly to your local/server media directory for Plex, Jellyfin, or local storage.
- Auto-downloads
.mp4,.mkv,.webm,.mov,.avifiles 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_VIDEOStest mode for quick verification.
- Python 3.10+
- uv (recommended package manager)
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=10Warning: Never share your Discord token with anyone. It gives full access to your account.
- Open Discord in your Web Browser (Chrome, Brave, Firefox, etc.) and log in.
- Press
F12orCmd + Option + I(Mac) to open Developer Tools. - Switch to the Console tab.
- 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);
}
}
}
}]);- Copy the generated token string into your
.envfile.
Scrapes channel history and downloads direct .mp4, .mkv, .mov, etc. file attachments.
uv run discord_scraper.pyScrapes channel history for https://streamable.com/... links and downloads them via yt-dlp.
uv run streamable_scraper.pyOfficial 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.pyStandardizes 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