vivinano / MudaeAutoBot

python bot that uses strictly the **Discord API** to Roll,Claim,and Kakera Snipe in Mudae. 5/10/21 project converted over to discum library
Apache License 2.0
143 stars 47 forks source link

binascii.Error: Incorrect padding #195

Closed Idiot1183 closed 2 years ago

Idiot1183 commented 2 years ago

C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe C:/Users/user/OneDrive/Desktop/random/Norton/norton.py Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discum\importmanager.py", line 10, in func return globals()[name](*args, **kwargs) KeyError: 'Login'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\user\OneDrive\Desktop\random\Norton\norton.py", line 37, in bot = discum.Client(token=settings["token"], log={"console": False, "file": False}) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discum\discum.py", line 104, in init self.xfingerprint = self.getXFingerprint(generateIfNone=True) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discum\discum.py", line 216, in getXFingerprint return imports.Login(self.s, self.discord, self.log).getXFingerprint(generateIfNone) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discum\importmanager.py", line 13, in func return globals()[name](*args, **kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discum\start\login.py", line 26, in init__ self.userID = base64.b64decode(token.split('.')[0]).decode('utf-8') File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding

Process finished with exit code 1

I think the issue lies in the user token for this account

vivinano commented 2 years ago

? Did you enter your user token ?

Idiot1183 commented 2 years ago

? Did you enter your user token ?

Yes

Idiot1183 commented 2 years ago

If fixed it by changing

    if '.' in token:
        self.userID = base64.b64decode(token.split('.')[0]).decode('utf-8')

in discum\start\login.py to

    if '.' in token:
        userId = token.split('.')[0] + '=' * (-len(token.split('.')[0]) % 4)
        self.userID = base64.b64decode(userId).decode('utf-8')
    #   self.userID = base64.b64decode(token.split('.')[0]).decode('utf-8')
Idiot1183 commented 2 years ago

image

to

image