YuriCosta / WhatsApp-GD-Extractor-Multithread

Allows WhatsApp users on Android to extract their backed up WhatsApp data from Google Drive.
GNU General Public License v3.0
179 stars 53 forks source link

{'Error': 'BadAuthentication'} #47

Closed LightYagami28 closed 5 months ago

LightYagami28 commented 1 year ago

I don’t know what is the problem i set the settings.cfg perfect.

Pls help

louisdoe commented 1 year ago

Same here. BadAuthentication

imponateado commented 7 months ago

getting same exact issue, seems like a malformation issue on gpsoauth

guysoft commented 6 months ago

Anyway around it?

fei0316 commented 6 months ago

Found a pretty ugly workaround but it works.

  1. Instead of installing the gpsoauth dependency as instructed, install it from this fork:
    pip install git+https://github.com/kiwiz/gpsoauth@master
  2. Make some changes to WhatsAppGDExtract.py:
    class WaBackup:
    """
    Provide access to WhatsApp backups stored in Google drive.
    """
    def __init__(self, gmail, password, android_id):
        #token = gpsoauth.perform_master_login(gmail, password, android_id)
        token = gpsoauth.exchange_token(gmail, "YOUR_TOKEN_HERE", android_id)
        if "Token" not in token:
            quit(token)
        self.auth = gpsoauth.perform_oauth(
            gmail,
            token["Token"],
            android_id,
  3. Get the token from here. After you click on "I agree" it will load forever, grab the content of the oauth_token cookie and replace YOUR_TOKEN_HERE.
  4. Proceed as normal, except you will need to repeat step 3 before each command as the token is single-use.

The problem is that the normal login routine of gpsoauth, using the gmail address and password, is not working, therefore we use the oauth token for login instead.

guysoft commented 6 months ago

Thanks for posting a workaround - even if it takes making a token, this is useful. I can confirm I can download it all using that. I guess some automation can be done with selenium or something like that. But for now as a one-off backup that is helpful.

BTW - does anyone know how to decrypt and view the messages?

fei0316 commented 6 months ago

@guysoft I don't think it's really worth it to automate this procedure as a fix to the master_login is being worked on already. If you still have a running WhatsApp installation and can backup again, the easiest way is to enable end-to-end encryption then decrypt the data with your own key: link. If you must extract the copy you have on GDrive, you can try WhatsApp-Key-DB-Extractor.

guysoft commented 6 months ago

The issue with the workaround is that after a while I get:

Http Error: 401 Client Error: Unauthorized for url: https://backup.googleapis.com/v1/clients/wa/backups/[number]/files

So I guess the token expires

guysoft commented 5 months ago

@fei0316 did anyone say that there is effort to fix the master_login anywhere? Could not see any mention

fei0316 commented 5 months ago

@fei0316 did anyone say that there is effort to fix the master_login anywhere? Could not see any mention

You can check out this.

YuriCosta commented 5 months ago

I'm using gpsoauth 1.0.2, everything works fine. BadAuthentication can be 2FA enabled on your account so you will need to get an app password from your google account.

fei0316 commented 5 months ago

My account does use 2FA but I am using the app password already. Though I think this issue is not related to this project at all but rather gpsoauth.

Sarmingsteiner commented 3 months ago

@fei0316 : You are my live safer, the only working solution I have found to get access to our Google Drive backup!

Only one thing has to be changed: pip install git+https://github.com/kiwiz/gpsoauth@master is not available any more, but it works with Simon's version as well: pip install git+https://github.com/simon-weber/gpsoauth@master

southall01 commented 3 months ago

Hello, if i double click on WhatsAppGDExtract is just open and closes....

azh97 commented 3 months ago

@fei0316 : You are my live safer, the only working solution I have found to get access to our Google Drive backup!

Only one thing has to be changed: pip install git+https://github.com/kiwiz/gpsoauth@master is not available any more, but it works with Simon's version as well: pip install git+https://github.com/simon-weber/gpsoauth@master

I tried the following workaround, but keeps getting the following error. Any suggestions? Already tried 2FA with app password and also the actual email password with 2FA disabled.

File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 258, in <module>
    main(sys.argv)
  File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 207, in main
    wa_backup = WaBackup(**getConfigs())
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\WhatsApp-GD-Extractor-Multithread-master\WhatsAppGDExtractRevised.py", line 64, in __init__
    token = gpsoauth.exchange_token(gmail, "oauth2_4/0AeaYSHDBw_SbkAavTf7T4P-OTKpCNMv1PO6dNAUZ5INodeOVj35LFwfuLes3m-xy6ZXXxxQ", android_id)
            ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gpsoauth' has no attribute 'exchange_token'
southall01 commented 3 months ago

I'm getting this; AttributeError: module 'gpsoauth' has no attribute 'exchange_token'

YuriCosta commented 3 months ago

I don't know why this thread is still getting so many comments, some even with unrelated problems. I just tried it again with my personal account from scratch.

  1. Download the script, the requirement and config.
  2. fill you info in the config file, if you have 2FA use app password
  3. create venv, activate it, pip install -r requirement.
  4. run the script.

Worked flawlessly with my 2FA account here.