Giter Club home page Giter Club logo

discord-dl's Introduction

logo

Discord-dl is an utility that can be used to archive Discord channels and guilds.


It's safe to say that forums, the medium that has once acted as the internet's primary knowledge center, are dead. Communities are moving en-masse to information blackholes like Discord that cannot be indexed by search engines and are completely inaccesible by those who are not registered users. It is vital to have a way of preserving these communities so its content can remain openly accessible.


Note: While I recognize that there is no alternative to selfbots especially when it comes to archiving, it is unfortunately against Discord TOS. Use at your own discretion.

Master branch is experimental and unstable. Please use a stable release. The stable release is also highly experimental, unfortunately :^)

Installation

  1. Install Go

  2. Make a Bot account: https://discord.com/developers/applications

  3. git clone https://github.com/Yakabuff/discord-dl.git

    cd discord-dl

    make build

    cd bin

    go install discord-dl

  4. Invite the bot to the server: https://discordpy.readthedocs.io/en/stable/discord.html

  5. Daemonize the bot (optional) or run the bot

Features

  • Archives messages, edits, embeds, threads and attachments
  • Storing message history in an SQLite database
  • Listens for messages to archive in real time
  • Simple web API/frontend to display and query messages
  • Job queue for improved concurrency and the ability to pause/stop jobs/see progress

To-do

  • Ability to 'rebuild' the server in the event of deletion
  • Cloud object storage support
  • Postgres support

Instructions

  • Flags:

    • --t=token
      • Specify the token of your user agent. Prepend Bot to the token for bot tokens.
      • eg: --t='Bot <token>' or --t=<token>
    • --channel=channel_id
      • Mode that archives the specified channel ID
    • --guild=guild_id
      • Mode that archives the specified guild ID
    • --before=YYYY-MM-DD or --before=message_id
      • Specify the date or message ID to get messages before
    • --after=YYYY-MM-DD or --after=message_id
      • Specify the date or message ID to get messages after
    • --progress
      • Output your progress. (Not implemented)
    • --fast-update
      • Fetches messages until it reaches an already archived message
    • --listen
      • Listens for new messages (BOT only) in selected channels and guilds. Can be used in conjunction with other modes
      • Usage: --listen
    • --listen-guilds
      • Only listen for messages from specific guilds
      • Usage: --listen-guilds=guild1,guild2,guild3
    • --listen-channels
      • Only listen for messages from specific channels
      • Usage: --listen-channels=channelid1,channelid2
    • --download-media
      • Enable this flag to download attachments/files (Includes embedded files)
    • --deploy
      • Mode to start the web server. Can be used by itself or in conjunction with other modes.
    • --input="config_path"
      • Specify path to config file. Values from the input file (TOML) will precedence over values from CLI flags.
    • --output="path"
      • Specify path to database. Will fallback to default value (archive.db) if empty.
    • --media-location
      • Specify location where you want images, videos and attachments to be saved
    • --deployPort
      • Specify port you want the webserver to run on. Will default to 8080 if empty
    • --blacklisted-channels
      • Specify channels you which to exclude. Delimit the channels by a comma.
      • ex: --blacklisted-channels=channel1id,channel2id,channel3id
    • --export
      • Export channel to json if set to true. Defaults to false
      • Cannot be used in conjunction with a database connection
      • ex: --export=true
  • Examples:

    • Downloading messages and media from a channel after Jan 1st 2018:
      • discord-dl --channel="12371093817" --after="2018-01-01" --download-media=true --token="asdfasdfasdfasdf" --o="test.db" --media-location="~/pics"

Contributing

Pull requests are welcome. Please open an issue first to discuss what you would like to change.

License

GNU AGPL v3

discord-dl's People

Contributors

yakabuff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord-dl's Issues

Threads

Having checked, this doesn't download threads.

I'm not fluent in Go so I can't implement it myself. I haven't interacted with the threads part of the Discord API so I have no idea how easy or difficult it would be to fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.