V4NSH4J / discord-mass-DM-GO

The most powerful Discord selfbot written in GO allowing users to automate their campaigns & send low-cost mass messages to Discord users!
https://t.me/tosviolators
GNU Affero General Public License v3.0
2.17k stars 638 forks source link

My Python script isn't working (Need help) #438

Closed Koala3353 closed 2 years ago

Koala3353 commented 2 years ago

Error: image Code:

import platform
import random
import secrets
import time

import httpx
from twocaptcha import TwoCaptcha
import requests
from aiohttp import ClientHttpProxyError
import json

from token_gen import core
from token_gen.core.Realistic import Faker
from token_gen.core import Log4p

try:
    import selfcord
    from selfcord.ext import commands
except:
    import os

    os.system("pip install git+https://github.com/dolfies/discord.py-self@renamed")
    from selfcord.context_properties import ContextProperties
    from selfcord.http import *
    import selfcord
    from selfcord.ext import commands
import json
import sys
import os

if not os.path.isfile("config.json"):
    sys.exit("'config.json' not found! Please add it and try again.")
else:
    with open("config.json") as file:
        config = json.load(file)
import asyncio

try:
    from multiprocessing import Process
except:
    os.system('pip install multiprocessing')
    from multiprocessing import Process
import token_gen.core.Solver4d

class Settings:
    capmonster = "CAPMONSTER-KEY"
    onlinesimru = "ONLINESIMRU"
    # random select proxy
    proxy = open("proxies.txt","r").read().split("\n")

    def get_proxy(self):
        proxies = {
    "https":"http://"+random.choice(self.proxy),
    "http":"http://"+random.choice(self.proxy)
            }
        return proxies
    # random select proxy
    proxy = open("proxies.txt","r").read().split("\n")

    def get_proxy(self):
        if open("proxies.txt","r").read() == '':
                proxies = {
                    "https":"http://127.0.0.1",
                    "http":"http://127.0.0.1"
                }
        else:
            proxies = {
                    "https":"http://"+random.choice(self.proxy),
                    "http":"http://"+random.choice(self.proxy)
                }
            return proxies

class Main:
    def __init__(self):

        # init Logger
        self.Logger = Log4p.Logger()

        self.Faker = core.Realistic.Faker.FDiscord()

        self.Solver = core.Solver4d.Solver(Settings.capmonster)

        # introduces the banner
        # print(banner) i dont we need banner

        self.Settings = Settings()

    async def joiner(self, invite, token: str):
        print("Detected Captcha...")
        header1 = {
            "Host": "discord.com",
            "Connection": "keep-alive",
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
            "Sec-Fetch-Site": "none",
            "Sec-Fetch-Mode": "navigate",
            "Sec-Fetch-User": "?1",
            "Sec-Fetch-Dest": "document",
            "sec-ch-ua": '"Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"',
            "sec-ch-ua-mobile": "?0",
            "Upgrade-Insecure-Requests": "1",
            "Accept-Encoding": "gzip, deflate, br",
            "Accept-Language": "en-us,en;q=0.9",
        }

        getcookie = httpx.get("https://discord.com/register").headers['set-cookie']
        sep = getcookie.split(";")
        sx = sep[0]
        sx2 = sx.split("=")
        dfc = sx2[1]
        split = sep[6]
        split2 = split.split(",")
        split3 = split2[1]
        split4 = split3.split("=")
        sdc = split4[1]

        # Get Fingerprint

        header2 = {
            "Host": "discord.com",
            "Connection": "keep-alive",
            "sec-ch-ua": '"Chromium";v="92", " Not A;Brand";v="99", "Microsoft Edge";v="92"',
            "X-Super-Properties": "eyJvcyI6Ik1hYyBPUyBYIiwiYnJvd3NlciI6IkNocm9tZSIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJlbi1VUyIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChNYWNpbnRvc2g7IEludGVsIE1hYyBPUyBYIDEwXzE1XzcpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS85Mi4wLjQ1MTUuMTMxIFNhZmFyaS81MzcuMzYiLCJicm93c2VyX3ZlcnNpb24iOiI5Mi4wLjQ1MTUuMTMxIiwib3NfdmVyc2lvbiI6IjEwLjE1LjciLCJyZWZlcnJlciI6IiIsInJlZmVycmluZ19kb21haW4iOiIiLCJyZWZlcnJlcl9jdXJyZW50IjoiIiwicmVmZXJyaW5nX2RvbWFpbl9jdXJyZW50IjoiIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6OTI3OTIsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9",
            "X-Context-Properties": "eyJsb2NhdGlvbiI6IlJlZ2lzdGVyIn0=",
            "Accept-Language": "en-US",
            "sec-ch-ua-mobile": "?0",
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
            "Authorization": "undefined",
            "Accept": "*/*",
            "Sec-Fetch-Site": "same-origin",
            "Sec-Fetch-Mode": "cors",
            "Sec-Fetch-Dest": "empty",
            "Referer": "https://discord.com/channels/@me",
            "Accept-Encoding": "gzip, deflate, br"
        }

        fingerprintres = httpx.get("https://discord.com/api/v9/experiments", timeout=10)

        while True:
            if fingerprintres.text != "":
                fingerprint = fingerprintres.json()['fingerprint']
                break
            else:
                return True

        param = {'captcha_key': self.Solver.get_captcha_key("mine")}

        headers = {
            "accept" : "*/*",
            "accept-encoding" : "gzip, deflate, br",
            "accept-language" : "zh-CN,zh;q=0.9,en;q=0.8",
            "content-length":"4797",
            "content-type":"application-json",
            "cookie":f"__dcfduid={dfc}; __sdcfduid={sdc}; _gcl_au=1.1.33345081.1647643031; _ga=GA1.2.291092015.1647643031; _gid=GA1.2.222777380.1647643031; OptanonConsent=isIABGlobal=false&datestamp=Fri+Mar+18+2022+18%3A53%3A43+GMT-0400+(%E5%8C%97%E7%BE%8E%E4%B8%9C%E9%83%A8%E5%A4%8F%E4%BB%A4%E6%97%B6%E9%97%B4)&version=6.17.0&hosts=&landingPath=https%3A%2F%2Fdiscord.com%2F&groups=C0001%3A1%2CC0002%3A1%2CC0003%3A1; __cf_bm=.fksdoBlzBs1zuhiY0rYFqFhDkstwwQJultZ756_yrw-1647645226-0-AaluVZQHZhOL5X4GXWxqEIC5Rp3/gkhKORy7WXjZpp5N/a4ovPxRX6KUxD/zpjZ/YFHBokF82hLwBtxtwetYhp/TSrGowLS7sC4nnLNy2WWMpZSA7Fv1tMISsR6qBZdPvg==; locale=en-US",
            "origin":"https://discord.com",
            "referer":"https://discord.com/channels/@me",
            "sec-ch-ua" : "Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\", \"Google Chrome\";v=\"99",
            "sec-ch-ua-mobile":"?0",
            "sec-ch-ua-platform":"macOS",
            "sec-fetch-dest":"empty",
            "sec-fetch-mode":"cors",
            "sec-fetch-site":"same-origin",
            "user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36",
            "x-discord-locale": "en-US",
            "x-fingerprint": fingerprint,
            "x-super-properties": "eyJvcyI6Ik1hYyBPUyBYIiwiYnJvd3NlciI6IkNocm9tZSIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJ6aC1DTiIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChNYWNpbnRvc2g7IEludGVsIE1hYyBPUyBYIDEwXzE1XzcpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS85OS4wLjQ4NDQuNzQgU2FmYXJpLzUzNy4zNiIsImJyb3dzZXJfdmVyc2lvbiI6Ijk5LjAuNDg0NC43NCIsIm9zX3ZlcnNpb24iOiIxMC4xNS43IiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6IiIsInJlZmVycmluZ19kb21haW5fY3VycmVudCI6IiIsInJlbGVhc2VfY2hhbm5lbCI6InN0YWJsZSIsImNsaWVudF9idWlsZF9udW1iZXIiOjExOTc2MSwiY2xpZW50X2V2ZW50X3NvdXJjZSI6bnVsbH0=",
            "Authorization": token,
        }

        resp = requests.post(f"https://discord.com/api/v9/invites/{invite}",json=param,headers=headers,proxies=self.Settings.get_proxy())
        print(resp.content)
        print("Captcha Bypassed.")

Also is there any reason why the phone number isnt receiving any message? Or how do u fix it. (Token Generator)

import requests
import token_gen.core.Log4p

class Solver:
    def __init__(self, token):

        # inits the capmonster token
        self.token = token

        # prepares logger
        self.Logger = token_gen.core.Log4p.Logger()

        self.Logger.info(__name__,"Solver loaded")

    def get_captcha_key(self,isPhone):
        print("Attempting to bypass captcha...")
        if isPhone == True:
            token = "f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34"
        elif isPhone == "mine":
            token = "a9b5fb07-92ff-493f-86fe-352a2803b3df"
        else:
            token = "4c672d35-0701-42b2-88c3-78380b0db560"
        json = {
            "clientKey" : self.token,
            "task" : {
                "type" : "HCaptchaTaskProxyless",
                "websiteURL" : "https://discord.com/",
                "websiteKey" : token,
                "minScore" : 0.3
            }
        }
        with requests.post("https://api.capmonster.cloud/createTask", json=json) as response:
            task_id = response.json().get("taskId")

        json = {
            "clientKey" : self.token,
            "taskId" : task_id
        }

        # keep on looping until getting the token, time efficient.
        while True:
            with requests.get("https://api.capmonster.cloud/getTaskResult", json = json) as response:
                 if "processing" in response.text:
                     pass
                 else:
                    return response.json()["solution"]["gRecaptchaResponse"]
                    break
Koala3353 commented 2 years ago

I have a feeling that I need to update the headers to fix the invite joiner. And for the verification, i need to find another phone sms thing. Can you suggest a phone sms verification?

Koala3353 commented 2 years ago

The invite joiner still doesnt work after editing the code

Koala3353 commented 2 years ago

How do you fix captcha-required error?

V4NSH4J commented 2 years ago

I have a feeling that I need to update the headers to fix the invite joiner. And for the verification, i need to find another phone sms thing. Can you suggest a phone sms verification?

You should update your headers. But chances are even using the most updated headers you still get the "You need to update your app" thing. This new captcha key a9b5fb07-92ff-493f-86fe-352a2803b3df comes with additional parameters rqdata and rqtoken, some captcha services like capmonster.cloud and anti-captcha.com allow sending this under the data parameter. When sending this parameter, you also need to send the service your user agent. Even still chances are sometimes it won't be solved by the captcha services.

Koala3353 commented 2 years ago

Aight ty