mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.03k stars 795 forks source link

Impossible to restore whatsapp from localstorage #967

Open janke184 opened 3 years ago

janke184 commented 3 years ago

Hi everyone!

From today we are having problems restoring the WhatsApp sessions from the localstorage.

The session begins by displaying the progress bar but ends by displaying the QR code.

Is the same thing happening to someone?

Thanks and regards.

andreashp commented 3 years ago

same here someone have the solution?

renatomaximo1984 commented 3 years ago

@janke184 did you find any solution?

janke184 commented 3 years ago

Hi!

Yes, we have found the solution.

You need to remove the indexedDB before pasting the localstorage.

Javascript:

indexedDB.deleteDatabase ('wawc');

I hope that this solutions works you too.

Regards.

renatomaximo1984 commented 3 years ago

Thank you @janke184 , let's try it here.

iaron commented 3 years ago

Hi!

Yes, we have found the solution.

You need to remove the indexedDB before pasting the localstorage.

Javascript:

indexedDB.deleteDatabase ('wawc');

I hope that this solutions works you too.

Regards.

It worked here, thank you man!! :)

renatomaximo1984 commented 3 years ago

Hi!

Yes, we have found the solution.

You need to remove the indexedDB before pasting the localstorage.

Javascript:

indexedDB.deleteDatabase ('wawc');

I hope that this solutions works you too.

Regards.

It worked here too, thank you man!! :)

andreashp commented 3 years ago

thanks @janke184, work for me. I implemented this way in file webwhatsapi__init__.py change the function set_local_storage

def set_local_storage(self, data): self.driver.execute_script('indexedDB.deleteDatabase(\'wawc\');'.join(["window.localStorage.setItem('{}', '{}');".format(k, v.replace("\n","\\n") if isinstance(v, str) else v) for k, v in data.items()]))

dekkardnexus5 commented 3 years ago

Thanks, it worked for me!

pailus commented 3 years ago

thanks @janke184 its work for me

takshalykov commented 3 years ago

Thx @andreashp for the complete function code, everything works.