GithubHelp home page GithubHelp logo

itschasa / discord-backup Goto Github PK

View Code? Open in Web Editor NEW
268.0 6.0 22.0 330 KB

Backup and Restore your Discord Account (Servers, Friends + more) in minutes!

License: GNU General Public License v3.0

Python 100.00%
discord discord-backup discord-bot discord-bots discord-restore discord-selfbot discord-term

discord-backup's Introduction

Discord Backup

☁️ Backup and Restore your Discord Account in minutes.



⭐ star the repo pls <3

Support + Community

Discord Server | Telegram Chat | Website

Disclaimer

The automation of Discord Accounts also known as self-bots is a violation of Discord Terms of Service & Community Guidelines and will result in your account(s) being terminated. Discretion is adviced. I will not be responsible for your actions. Read about Discord Terms Of Service and Community Guidelines here.

Features:

Automatic

These can be done by the program:

  • Backup Servers
    • Save Server Invites.
  • Backup DM History
    • Save Users who have DMed you.
  • Backup Group Chats
    • Save Invites to Group Chats.
  • Backup Avatar, Banner and Bio
    • Saves 1 .txt and 2 .gif files.
  • Backup + Restore Server Folders
    • Saves the Order, Colour and Name of your Folders.
  • Backup Relationships
    • Save Friends, Blocked, Outgoing and Incoming Friends.
  • Auto-Backup on PC Startup
    • On Startup, automatically backup your Discord Account.
  • Colour Customisation
    • 12 different colours to choose from.

Manual

You will have to do this yourself:

  • Restore Servers
    • You will have to join the Servers by clicking on an invite on Discord.
  • Restore Group Chats
    • You will have to join the Group Chats by clicking on an invite on Discord.
  • Restore Avatar, Banner and Bio
    • You will have to add these back through the User Profile menu.
  • Restore Relationships
    • You will have to click on the @ of each user and add them back manually.

Installation

Using Binary EXE (Easier)

  1. Download the zip for your Operating System from Releases
  2. Unzip the contents into a folder
  3. Run the exe

Using Source

  1. Install Python 3.9.10 (should work with other versions)
  2. Download source with the green Code button, then Download ZIP
  3. Unzip the contents into a folder
  4. Run in your command prompt:
pip install -r requirements.txt
  1. Run main.py, either by double clicking or with command prompt (preferred way):
python main.py

How to Use

  1. Install using the instructions above and run the program.

Backing Up

  1. Select Option 1 to Backup a Discord Account.
  2. You can scan for tokens (Discord Accounts) on your PC, or you can enter it manually.
  • If you aren't experienced with Discord, we recommend scanning your PC for tokens.
  • However, if you don't want to let the program do that or the account didn't show up when scanning, you can enter the token manually.
  1. The program should now start to backup your account. This should take between 1m to 10m, depending on how many servers and group chats you are in.
  2. Once the program has finished, you will see an overview of the backup where you can see if any guilds failed to be backed up. At this point, the .bkup file would be saved in the backups folder.
  3. We also recommend you setup Auto-Backup, by selecting Option 3.

Restoring

  1. When you need to restore from a backup, select Option 2.
  2. Select Option 1: Restore Everything.
  3. You can now choose whether you want to restore your friends, outgoing, etc. Select y for yes or n for no on each one.
  4. A new window will open, prompting you to select the .bkup file. Find it, and select it.
  5. After you've checked the settings, select either y or n.
  6. Now, you can choose whether to scan for tokens, or enter manually. Same instructions from 3. in backing up apply here.
  7. After you have entered your token, you need to enter a Bot Token. You can get one from the Discord Developer Portal.
  • a. Go to https://discord.com/developers/applications
  • b. Click New Application and enter a random name.
  • c. On the sidebar, click Bot, then Add Bot, and Yes, do it!
  • d. Click Copy (located next to View Token). The Bot Token is now in your clipboard!
  1. The program will start to restore your account. Note: It's likely that this process will take longer then backing up, depending on how many relationships you had.
  2. Like with the backing up, you will get an overview of what happened during the restoring process after it has finished.
  3. After you have joined all the servers, you can go back into the program, and select Option 2: Restore Server Folders, to restore the server folders. Or, you can do this process manually.

Notes / FAQ:

Restoring Servers + Group Chats + Server Folders

Because of Discord's last resorts of using hCaptcha to stop people self-botting on Discord, I've decided its best to stop this program needing a captcha key.

  • The program will create a server with all the old server invites in them, sorted into the folders from the old account.
  • You simply just join them, when you need to.
  • After you have joined all the servers, you can use the restore module to only restore folders.

Group Chat Invites

Group Chat Invites are a bit scuffed on Discord.

  • Server Invites will still be active if you leave the server.
  • However, Group Chat Invites will not work if you leave the Group Chat.
  • Meaning, if you leave the group chat after a backup, and before a term, then you won't be able to join that group chat back.

Can I backup/restore an account which is already termed?

No. You can't, and never will be able to. Stop asking this.

There's a feature I want to suggest.

Suggest it in the issues tab. I will probably add it.

I keep getting an error, help!

Make an issue in the issue tab, or ask in the Community Servers.

discord-backup's People

Contributors

cloudzik1337 avatar infamouskoala avatar itschasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

discord-backup's Issues

Crypto.cipher requirement

image
Why would a 'Discord backup tool' need 'Crypto.cipher' package for backup and restore discord account ?

No module named 'yaml'

File "C:\Users\humum\Desktop\Discord-Backup-main\cfgload.py", line 8, in
import yaml
ModuleNotFoundError: No module named 'yaml'

Unable to create

I run this program daily and I daily get Unable to create. Is there a way to solve this ?

is this a virus?

on virustotal I got a bunch of hits and also bitdefender quarantined your app

Trojan LMAO

Hmm, fetches token by it self on the windows release and saves 2 little exe files in the temp folder nice lmaooooooo

Linux Support

Hello, it seems to me that itonly works for windows (it uses winddl lib) would be nice if you could also make it work for linux (by using os.name checks for example)

Linux Support - Puppeteer for Token Fetching

Collect discord tokens with puppeteer for linux users.

Install these in the same directory as Discord-Backup!

  • npm install puppeteer @gilgames/discord-detours

Make a javascript file in the same directory as Discord-Backup.

  • sudo nano index.js

Initial login script

  • Place this script in index.js and log in to discord via a non-headless browser:
let puppeteer = require('puppeteer');
const detours = require("@gilgames/discord-detours");

(async () => {
    const browser = await puppeteer.launch({ userDataDir: './user_data', headless: false });
    const page = await browser.newPage();
    await page.goto('https://discord.com/channels/@me');
    await page.setViewport({ width: 1080, height: 1024 });
    const serializedAPI = detours.serializeModule(detours.api);
    await page.evaluate(detours.injectModule, serializedAPI);
    const token = await page.evaluate(() => window.discordDetours.findFunctionByName("getToken")());
    console.log(token);
    await browser.close(); 
})();
  • After logging in, replace the initial login script in index.js with this one to automatically fetch the token on subsequent runs:
let puppeteer = require('puppeteer');
const detours = require("@gilgames/discord-detours");

(async () => {
    const browser = await puppeteer.launch({ userDataDir: './user_data' });
    const page = await browser.newPage();
    await page.goto('https://discord.com/channels/@me');
    await page.setViewport({ width: 1080, height: 1024 });
    const serializedAPI = require("@gilgames/discord-detours").serializeModule(require("@gilgames/discord-detours").api);
    await page.evaluate(detours.injectModule, serializedAPI);
    const token = await page.evaluate(() => window.discordDetours.findFunctionByName("getToken")());
    const user_info = await page.evaluate(() => {
        const usernameElement = document.querySelector('span[class="text-gray-400 font-semibold"]');
        const username = usernameElement ? usernameElement.innerText.split('#')[0] : 'Unknown';
        const discriminator = usernameElement ? usernameElement.innerText.split('#')[1] : '0000';
        return { username, discriminator };
    });
    console.log(JSON.stringify({ token, username: user_info.username, discriminator: user_info.discriminator }));
    await browser.close();
})();
  • Modified fetch_tokens.py
import subprocess
import json

def fetch():
    try:
        result = subprocess.run(['node', 'index.js'], capture_output=True, text=True, check=True)
        token_data = json.loads(result.stdout)
        return [[token_data['token'], f"{token_data['username']}#{token_data['discriminator']}", token_data['token'], "Discord"]]
    except subprocess.CalledProcessError as e:
        print(f"Failed to execute script: {e}")
        return []
    except json.JSONDecodeError as e:
        print(f"Error decoding JSON from script output: {e}")
        return []
  • This will now allow you to automatically backup and restore using the built in choices in main.py without having to manually get your token.

Relationships are not restored if using old backup data with a new version

I dont know if its a bug or something when i weeks ago i created a backup of my main using the 1.2.1 version and today when i used it, i downloaded the 1.2.3 since update etc and i started restored servers and stuff worked perfectly except for the relations. It sent me all my relationships in the backup server but did not send any friend request.

Just wanted to let you know about this, no idea if it can help but yea also congrats for your tool its really cool, lmk if there is any way to tip or something

Help

Traceback (most recent call last):
File "main.py", line 182, in
File "restore.py", line 17, in init
AttributeError: 'restore' object has no attribute 'c'
[9764] Failed to execute script 'main' due to unhandled exception!

Malware

Windows detects this as a trojan.

JSON Decode Error on Requests

When I put token, this error occur.
I put verified token.

Manual input

Traceback (most recent call last):
  File "C:\Users\odont\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Program Files\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\~~백업~~\Discord-Account-Backup\main.py", line 91, in <module>
    bkup = backup.backup(token_info[0], c)
  File "D:\~~백업~~\Discord-Account-Backup\backup.py", line 20, in __init__
    self.user_me = token_check.json()
  File "C:\Users\odont\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError

Auto scan

Traceback (most recent call last):
  File "C:\Users\odont\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Program Files\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\~~백업~~\Discord-Backup-main\main.py", line 69, in <module>
    tokens = fetch_tokens.fetch()
  File "D:\~~백업~~\Discord-Backup-main\fetch_tokens.py", line 109, in fetch
    tknid = r.json()["id"]
  File "C:\Users\odont\AppData\Roaming\Python\Python310\site-packages\requests\models.py", line 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError

Incorrect headers for discord requests

Friend request error.

You should change eyJsb2NhdGlvbiI6IlVzZXIgUHJvZmlsZSJ9 to eyJsb2NhdGlvbiI6IkFkZCBGcmllbmQifQ==

and change eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEwMC4wLjQ4OTYuMTI3IFNhZmFyaS81MzcuMzYiLCJicm93c2VyX3ZlcnNpb24iOiIxMDAuMC40ODk2LjEyNyIsIm9zX3ZlcnNpb24iOiIxMCIsInJlZmVycmVyIjoiIiwicmVmZXJyaW5nX2RvbWFpbiI6IiIsInJlZmVycmVyX2N1cnJlbnQiOiIiLCJyZWZlcnJpbmdfZG9tYWluX2N1cnJlbnQiOiIiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfYnVpbGRfbnVtYmVyIjoxMjY0NjIsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9 to eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwic3lzdGVtX2xvY2FsZSI6ImtvIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEwMi4wLjUwMDUuMTA4IFdoYWxlLzMuMTUuMTM2LjE4IFNhZmFyaS81MzcuMzYiLCJicm93c2VyX3ZlcnNpb24iOiIxMDIuMC41MDA1LjEwOCIsIm9zX3ZlcnNpb24iOiIxMCIsInJlZmVycmVyIjoiIiwicmVmZXJyaW5nX2RvbWFpbiI6IiIsInJlZmVycmVyX2N1cnJlbnQiOiIiLCJyZWZlcnJpbmdfZG9tYWluX2N1cnJlbnQiOiIiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfYnVpbGRfbnVtYmVyIjoxMzI2NDcsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9

Else, idk what should i change :(

I mean this is clearly a virus...

You have got Plague Stealer, Clip Banker, DiscordNitroMiner all binded into this file

Then you have about 15 files dropped onto the victims computer

Any People Who Have Ran This File Please Do "WINDOWSKEY + R" then type "%temp%" and then do "CTRL + A" and then "DELETE"

You Also Should Run This In A VirtualMachine or A Sandbox (sandbox's can be bypassed so i reccomend a VirtualMachine)

what

image
excuse me sir, i input number 3.14 and its no work?

Add guild backups (roles/channels)

Can we please get a Server-Backup version of this which backups all the server/roles/categories anything on that server and saves them to folder. So you can restore your old server settings etc when your server gets termed.

Failed to create guild

**> Failed to create guild: 403

{"message": "Unknown Message", "code": 10008}**

I got this error when I try to restore :/

More Backup Stuff

User settings: show activity, gif auto play, animate emoji, theme, dev mode, custom status, afk timeout, server order
Account information: username, nsfw allowed

Build Number Fix

updated regex is r'assets/(sentry\.\w+)\.js' and buildNumber\D+(\d+)"

<3

Thanks man, your tool helped me A LOT! <3<3<3

Error

Traceback (most recent call last):
File "D:\Backup acc discord\cc\main.py", line 99, in
bkup = backup.backup(token_info[0], c, clnt.version)
File "D:\Backup acc discord\cc\backup.py", line 38, in init
f = open(f"backups\{self.user_me['username']}#{self.user_me['discriminator']} @ {datetime.utcfromtimestamp(int(time.time())).strftime('%Y-%m-%d %H-%M-%S')}.bkup", "w", encoding="utf-8")
FileNotFoundError: [Errno 2] No such file or directory: 'backups\.....#0000 @ 2023-04-25 00-39-57.bkup'

KeyError: 'id'

I am aware of the issue, this issue only affects the restoring capability.
A fix will be released in v2.0 of this program, so please be patient.

This program has gotten more attention then I thought it would, so I feel like I should do it justice and recode the tool, making it more stable and fixable if any more issues arise.

Thank you <3

image

Backup DM Contents [Open for Suggestions]

Add option that can only be backed up from chats separately in the list
Or from all friends or just dm that are open
And Group Chat Message Back Too
or you can create another program with some choise for only chat backups and more

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.