DiscordScraper

Scrape all messages and timestamps in a Discord channel or DM and save to a JSON file (Latest to First)

Aŭtoro
Ghosty-Tongue
Ĉiutagaj instaloj
0
Tutaj instaloj
1
Ratings
0 0 0
Versio
1.3
Kreita
2025/10/30
Ĝisdatigita
2025/11/01
Size
55,4 kb
Licenco
MIT
Aplikiĝas al

DiscordScraper: Scrape and Save Discord Messages

This script is a modification of the popular Undiscord tool, repurposed to safely scrape messages from a Discord channel or Direct Message (DM) and save the data to a local JSON file. It does not perform any deletion.

The scraped data includes the message content, author (username and discriminator), timestamp, ID, and attachments information. Messages are saved in reverse chronological order (latest message first).

Functionality:

  1. Scraping: Fetches messages using the Discord Search API.
  2. Filtering: Allows filtering by Author ID, content text, links, files, message ID range, and date range.
  3. JSON Output: Automatically triggers a download of a .json file containing all scraped message data upon completion or stopping.
  4. Rate Limit Handling: Automatically handles Discord's 429 Rate Limit responses and adjusts the search delay.

⚠️ Important Prerequisites and Instructions

To use this script, you must provide your Authorization Token. This is a private key used by your browser to authenticate with Discord's API. Do not share it!

1. Quick Setup (Using the Fill Buttons)

  1. Enable Developer Mode in Discord:
    • Go to User Settings (⚙️).
    • Go to Advanced.
    • Toggle Developer Mode on.
  2. Navigate to the Discord channel or DM you wish to scrape.
  3. Open the DiscordScraper window and click the following buttons:
    • me button next to Author ID (if you only want to scrape your own messages).
    • current button next to Server ID.
    • current button next to Channel ID.
    • fill button next to Authorization Token (in Advanced Settings).
  4. Adjust any filters (Content, Date range, etc.) as needed.
  5. Click the ▶︎ Scrape button to begin.

2. Manual Token Entry (Fallback)

If the fill button fails to retrieve your token, follow these steps:

  1. Open Discord in your browser (not the desktop client).
  2. Press F12 to open the Developer Tools.
  3. Go to the Network tab.
  4. Send any message in a channel.
  5. In the Network tab, find the entry for the messages API call.
  6. Click this entry, then go to the Headers tab.
  7. Scroll down to Request Headers and find the authorization header.
  8. Copy the entire token string (usually starting with MFA.) and manually paste it into the Authorization Token field.

3. Final Step

When the scraping is complete, a JSON file will automatically download to your browser's default download folder.


Credit

This script is heavily based on the original Undiscord (Delete Messages) tool by @victornpb (Victor N.). https://github.com/victornpb/undiscord Original Undiscord GitHub Repository The user interface framework and core message fetching logic are derived from Undiscord. This modification isolates the scraping logic and removes all message deletion functionality.