tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.03k stars 2.23k forks source link

Login failed, reason: not authorized #2482

Closed ande4485 closed 5 years ago

ande4485 commented 6 years ago

Hi. I know there're issues about this problem. But I can't figure out. Could you explain how to fix it. I registered with env=android And after sending a message I have this error.

I work with rapsberry pi. Thanks

vjyanand commented 6 years ago

Probably got banned. Try re-registration.

3dluis commented 6 years ago

WhatsApp has implemented some automatic processes to detect bot and a human team for possible behavior. The bad management in the implementation of bot has it that the platform of whatsapp was blackoff for this reason, it does not matter if you implement a Bot by Whatsapp Web or direct connection to the server funxmpp and your behavior is like a Bot is 100% that your number and IP be banned.

3dluis commented 6 years ago

I see that the community of Yowsup is very growing, my recommendation is that we adapt to the library to avoid excessive abuse of the tool. Limiting shipping quantities for a limited time, avoid sending images with marketing reasons, do not initialize conversations with people who do not have you as a contact, do not initialize conversations with a number that is not within your contacts. I understand that giving a good use to this tool can evolve until you get to look for financing to become an official API. This has a lot of potential for doing business both for whatsapp and for the Yowsup community.

Nacho223 commented 6 years ago

I've done some tests and come to some conclusions:

1 - If you register a number directly via yowsup, the number is banned after one message (tested with 3 numbers)

2 - If you register a phone in your android, chat a bit, and then, after 12 - 14h you close whatsapp client and register the number on yowsup, it works.

3 - ONLY ONE TEST: 72h after registration on Android, and created profile via WApp Web, it fully worked for two weeks until I sent a friend one link that was banned in FB (and I didn't know).

Nacho223 commented 6 years ago

The key, as I have been able to deduce, is that you must let whatsapp make the first start and synchronization of contacts. Then contacts can be extracted with applications like:

https://play.google.com/store/apps/details?id=com.ebizzinfotech.whatsappCE

Or:

https://play.google.com/store/apps/details?id=plugin.checkwhats.com.checkwhatsapp

First one let you extract only 100, second claims it has no limit (I've exported almost 2000 from my phone, no further tests made).

Then, you can load your db and use it with your yowsup client.

BenSchZA commented 6 years ago

I've added the solution of @Nacho223 to the yowsup Wiki at https://github.com/tgalal/yowsup/wiki/yowsup-cli-2.0. I successfully used this method to avoid black-listing, and have done some stress testing sending multiple successive and parallel messages to multiple numbers.

andreazevedobauru commented 6 years ago

@BenSchZA I had to learn it after blocked five numbers. I was always tried to register before installing on mobile device. Thank you.

Nacho223 commented 6 years ago

Just in case, to be safer, I also modified the env_android.py (and recompiled) with this data:

_MD5_CLASSES = "YlajJPPGUUP1Ptcic2XKNA=="

_VERSION = "2.18.105"

leocsg commented 6 years ago

@Nacho223 how do you get new _MD5_CLASSES and _VERSION?

Nacho223 commented 6 years ago

Version is on Whatsapp app in the menu where you can stop/unistall it. For MD5 Classes, use this:

https://github.com/mgp25/classesMD5-64

vjyanand commented 6 years ago

This gets latest APK https://gist.github.com/vjyanand/92c062f26b2235bc150062731ae2da63

andresmmujica commented 6 years ago

I followed the workaround procedure but I got a unavailable message. Didn't retry from yowsup but from an actual wp cliente and it says the number is suspended (not blocked) I'm gonna wait a few days to retry again.

However I want to have clearer the contacts sync workaround and the md5sum and version one.

I mean, which would be the steps in order to minimize the risk of getting banned??

Thanks!

BenSchZA commented 6 years ago

Despite the workaround by @Nacho223 working initially, after a few days of using yowsup for a bot WhatsApp banned my number. The risk I think is impossible to avoid - WhatsApp will find out if they want to, probably just depends on how you're using the bot and how natural it seems.

andresmmujica commented 6 years ago

hmm.. ok, I just want to send key alerts from nagios.

Nacho223 commented 6 years ago

Yes, Whatsapp has it very easy to block, as we are registering with Android and sending as a S40. And bots must be "natural", I agree with that: Login, send typing, send pause, etc.

brunaoalx commented 6 years ago

I think the problem may be the md5_classes.

So I looked at the site where I updated my md5: https://coderus.openrepos.net/whitesoft/whatsapp_scratch

Note that on this site the whats version points to 2.18.154, equal to: https://www.whatsapp.com/android/

But I looked at some devices and the installed version is 2.18.156, even the version available in the play store is version 2.18.156.

I generated the following MD5 for version 2.18.156 (GwmuFlEWPMKg9ojOJn4HLA ==).

But I still have not had success registering.

anoopgpr commented 6 years ago

Thanks Nacho223 and vjyanand i am able to fix old version issues..vjyanand your code is awesome to get version and _mds_classes

andresmmujica commented 6 years ago

@anoopgpr how?

anoopgpr commented 6 years ago

Just by changing env_android.py as per Nacho223 suggestion.

wz343450860 commented 6 years ago

Hi , I registered the phonenum but I tried to login it return yowsup.layers.auth.autherror.AuthError: not-authorized, how can I solve this issue?

leobrines commented 5 years ago

Hi! I updated the @vjyanand script because I had problems with that. https://gist.github.com/leopoldobrines7/cd0ac04a8427dcf6f01deebb10af89eb

My script use other method to get WhatsApp version, via AndroidManifiest.xml Enjoy!

aHVzY2g commented 5 years ago

@Nacho223 can you confirm that your method is still working? I followed your advice but got blocked after two messages

aHVzY2g commented 5 years ago

@BenSchZA Thanks I will have look into it

isccha commented 5 years ago

Is there any chance that using this library for testing won't get my number banned from Whatsapp? Has someone tried using this recently? Thanks!