Skip to content

A Discord bot that can scrape attachment links from a channel

License

Notifications You must be signed in to change notification settings

zenithpaws/discord-cdnlink-scraper-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Discord bot that can scrape attachment links from a channel

Do I really need to explain???
The code is probably a bit messy, but it works so :)

Prerequisites

How to use

  1. Clone the repo
git clone https://github.com/zenithpaws/discord-cdnlink-scraper-python.git
  1. Install dependencies
pip install -r requirements.txt
  1. Create a Discord bot here: https://discord.com/developers/applications

    1. Enable the option shown in the image below Option to Enable: Message Content Intent
    2. Copy the token and invite the bot to your server using this link (Replace CLIENT_ID with your bot's client ID): https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=274878008320&scope=bot
  2. Duplicate config.json.example rename it to config.json and fill in the values

  3. Run the bot

py bot.py
  1. Run the command(s)
/scrape [file_types] [amount of messages to scrape].

Both are optional, and are not needed
Default values are all and all

Bot Commands

scrape

Scrapes attachments and links from the current channel.

Description:

  • Scrapes messages from the current channel, extracting and saving links to a file.

Options:

  • file_types (default: "all")

    • Description: The types of files to scrape.
    • Choices: images, audio, videos, all
  • message_amount (default: "all")

    • Description: The number of messages to scrape. If "all", it scrapes all messages.

serverwidescrape

Scrapes attachments and links from all text channels in the server.

Description:

  • Scrapes messages from all text channels in the server, extracting and saving links to a file.

Options:

  • file_types (default: "all")

    • Description: The types of files to scrape.
    • Choices: images, audio, videos, all
  • message_amount (default: "all")

    • Description: The number of messages to scrape. If "all", it scrapes all messages.

download

Downloads attachments from the current channel.

Description:

  • Downloads attachments from messages in the current channel, organizing them into folders based on file types.

Options:

  • file_types (default: "all")

    • Description: The types of files to download.
    • Choices: images, audio, videos, all
  • message_amount (default: "all")

    • Description: The number of messages to scrape. If "all", it scrapes all messages.

serverwidedownload

Downloads attachments from all text channels in the server.

Description:

  • Downloads attachments from all text channels in the server, organizing them into folders based on file types.

Options:

  • file_types (default: "all")

    • Description: The types of files to download.
    • Choices: images, audio, videos, all
  • message_amount (default: "all")

    • Description: The number of messages to scrape. If "all", it scrapes all messages.

Want to see features added?

Open an issue and I'll take a look and see if I can add it.

License

MIT
Made by spinfal
Converted to Python by zenithpaws

About

A Discord bot that can scrape attachment links from a channel

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 100.0%