Locally hosted DC message scraper and search for DC, takes scraped DC messages in .json format (you scrape with scrape.py) and turns it searchable with a web interface (search.py)
Find a file
hax 66e88aa5ee README.md aktualisiert
Signed-off-by: hax <hax@lainlounge.org>
2025-10-17 00:16:21 +00:00
LICENSE Initial commit 2025-09-20 02:25:45 -05:00
README.md README.md aktualisiert 2025-10-17 00:16:21 +00:00
scrape.py Update scrape.py 2025-09-20 17:03:57 -05:00
search.py Update search.py 2025-09-20 04:04:18 -05:00

SC

SC is a two-part tool for collecting and searching through DC messages.
It includes:

  • scrape.py → A scraper that collects messages from servers or DMs into .json files.
  • search.py → A Flask-based web app that lets you search across all scraped datasets with a clean, user-friendly interface.

Features

  • Collect messages into per-channel JSON datasets.
  • Automatically saves images and message timestamps.
  • Simple, modern web interface with blue/pink styling.
  • Search by username or message text.
  • Results displayed in chat-style message cards.
  • Load more button to paginate results in batches of 50.
  • Supports multiple datasets from multiple servers.

Project Structure

SC/ │ ├── scrape.py # Scraper script ├── search.py # Web interface (Flask app) ├── data.json # Example JSON dataset (created by scraper) └── README.txt


Installation

  1. Make sure you have Python 3.9+ installed.

  2. Install required dependencies:

    pip install flask requests

  3. (Optional) Use a virtual environment to keep things clean:

    python3 -m venv venv source venv/bin/activate


Usage

  1. Scraping Messages

Run the scraper to collect messages into JSON files.

python3 scrape.py

  • Choose whether to scrape servers or DMs.

  • Select a channel or conversation.

  • Provide a timeframe (e.g. 5h, 2d, 1m).

  • A JSON file will be created with the name format:

    servername_channelname.json

  1. Searching Messages

Once you have scraped data, start the web interface:

python3 search.py

Then open your browser and go to:

http://127.0.0.1:5000


Web Interface

  • Enter a username or part of a message in the search bar.
  • Up to 50 messages are shown at first.
  • Click "Display More" to load additional results.
  • Each message card shows:
    • Username
    • Message text
    • Image (if attached)
    • Source file (server/channel it came from)

Design

The interface is styled with:

  • Blue + Pink gradient header
  • Dark theme background
  • Rounded, shadowed message cards
  • Embedded images styled with borders and rounded corners

Disclaimer

This project is for educational and personal archival purposes only.
Do not use it in violation of Discords Terms of Service.
You are responsible for how you use this software.