whatsapp-framework icon indicating copy to clipboard operation
whatsapp-framework copied to clipboard

Yowsup have update v3, please update this framework

Open Sharissa90 opened this issue 5 years ago • 34 comments

Hi, I notice that yowsup have update their library to v3, this version use noise protocol so it fix some problem that raised lately. please update this framework, I tried just update yowsup v3 only, but many errors raised, I believe yowsup made some changes in their function so this framework need little adjustment to make it work..

Thank you for your great jobs make this framework easier to implemented yowsup

Sharissa90 avatar Apr 23 '19 04:04 Sharissa90

Yes please update the framework

itsVKT avatar Apr 23 '19 07:04 itsVKT

@danielcardeenas yes we need you to reply on this thread ASAP! Because even though Yowsup is updated we can't use this framework due to protocol changes...

x-frst avatar Apr 23 '19 07:04 x-frst

Because we did not help @danielcardeenas , and together we started to mount the compatibility of the library again?

devalexanderdaza avatar Apr 23 '19 13:04 devalexanderdaza

I already managed to solve so that the bot receives messages again, and sends them.

As I saw it, in run.py touch comment the line:

# except AuthError as e:
         # print ("Auth Error, reason% s"% e)

Because the AuthError library no longer exists in from yowsup.layers.auth

The

sudo ./setup.sh

of this repository should not be used since it will be installing the old version of yowsup that Daniel Cardenas has.

Therefore, you must first run the command

pip3 install yowsup

then install the library

pip3 install pycrypto

and

pip3 install blinker

Then when registering the number with the command

Replace CC with your country code (See https://countrycode.org)

yowsup-cli registration --requestcode sms --phone CCXXXXXXXX --cc CC -E Android

After getting the sms code (in this example: 123456)

yowsup-cli registration --register 123456 --phone CCXXXXXXXX --cc CC -E Android

the password does not exist anymore, now there is one called

client_static_keypair

which would be the new password, which is what you must add to the config.py.

I will continue reviewing possible problems. I will be updating this issue

jhonarodriguez avatar Apr 23 '19 15:04 jhonarodriguez

TypeError: pushDefaultLayers() takes 1 positional argument but 2 were given

Remove parameter in line 24 of run.py

OLD

.pushDefaultLayers(encryption)\

NEW

.pushDefaultLayers()\

jhonarodriguez avatar Apr 23 '19 15:04 jhonarodriguez

Thank you @elchory96 I can running this framework again, but can you solve how to send image? I tried but always failed to send image

Sharissa90 avatar Apr 23 '19 16:04 Sharissa90

What error do you get?

jhonarodriguez avatar Apr 23 '19 17:04 jhonarodriguez

Yes @elchory96 media sending is not working I mean I didn't try it on this framework I tried on terminal yowsup demos /image send <number> <location> and I got yowsup.demos.cli.layer - Request upload for file /path/to/pic.png for [email protected] failed

x-frst avatar Apr 23 '19 18:04 x-frst

Also I tried all things step by step but getting error after starting Mac

[Whatsapp] Mac started

W 2019-04-24 00:11:54,612 yowsup.layers.protocol_ib.layer - ignoring edge_routing ib node for now
Traceback (most recent call last):
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/network/dispatcher/dispatcher_socket.py", line 42, in connectAndLoop
    self.connectionCallbacks.onRecvData(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/network/layer.py", line 82, in onRecvData
    self.receive(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/network/layer.py", line 85, in receive
    self.toUpper(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/noise/layer_noise_segments.py", line 39, in receive
    self.toUpper(bytes(data))
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/noise/layer.py", line 149, in receive
    self._flush_incoming_buffer()
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/noise/layer.py", line 137, in _flush_incoming_buffer
    self.toUpper(self._wa_noiseprotocol.receive())
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/coder/layer.py", line 19, in receive
    node = self.reader.getProtocolTreeNode(bytearray(data))
  File "/home/amitgamingking/.local/lib/python3.6/site-packages/yowsup/layers/coder/decoder.py", line 11, in getProtocolTreeNode
    raise ValueError("deflate payloads are not supported")
ValueError: deflate payloads are not supported
E 2019-04-24 00:11:55,288 yowsup.layers.network.dispatcher.dispatcher_socket - deflate payloads are not supported

x-frst avatar Apr 23 '19 18:04 x-frst

bot will crash if receiving media file, any idea how ignore this type of message temporary before yowsup update their code?

Sharissa90 avatar Apr 24 '19 14:04 Sharissa90

@Sharissa90 are you able to run bot normally for receiving and sending text messages?

x-frst avatar Apr 24 '19 14:04 x-frst

@Sharissa90 are you able to run bot normally for receiving and sending text messages?

Able to send and recived....

jesusvalverde avatar Apr 24 '19 20:04 jesusvalverde

bot will crash if receiving media file, any idea how ignore this type of message temporary before yowsup update their code?

Error on reciving one image

AttributeError: 'ImageDownloadableMediaMessageProtocolEntity' object has no attribute 'getMediaKey' E 2019-04-24 14:30:31,109 yowsup.layers.network.dispatcher.dispatcher_socket - 'ImageDownloadableMediaMessageProtocolEntity' object has no attribute 'getMediaKey'

jesusvalverde avatar Apr 24 '19 20:04 jesusvalverde

Not able to send Images....seems to be a thing from youwsup 3

jesusvalverde avatar Apr 24 '19 20:04 jesusvalverde

@Sharissa90 are you able to run bot normally for receiving and sending text messages?

@AmitGamingKing yes, but not stable like yowsup2. sometimes it crashing, I think yowsup V3 still buggy

Sharissa90 avatar Apr 24 '19 22:04 Sharissa90

I have trick to solve bot crashing on receiving media file, edit file app/layer.py find @ProtocolEntityCallback("message") and edit like this

@ProtocolEntityCallback("message") def on_message(self, message_entity): mac.receive_message(self, message_entity) if message_entity.getType() == 'text': message = Message(message_entity) if message.valid: signals.message_received.send(message) if helper.is_command(message.message): signals.command_received.send(message) elif message_entity.getType() == 'media': pass # if message_entity.getMediaType() == "location": # message = Message(message_entity) # if message.valid: # signals.message_received.send(message) # if hasattr(message_entity, 'getMediaType'): # self.onMediaMessage(message_entity) mac.disconnect(self)

Sharissa90 avatar Apr 24 '19 23:04 Sharissa90

sword, which is what you must add to the config.py.

I will continue reviewing possible problems. I will be updating this iss

hello, i am newbie on this, i ran the commands of library into whatsapp framework but it wont taking my phone number, just giving me errors, first when i try to register with: yowsup-cli registration --requestcode sms --phone CCXXXXXXXX --cc CC -E Android

it says invalid argument 'Android' choose from "android" without uppercase, but when i run it this gives me many errors

gabrieru avatar May 01 '19 18:05 gabrieru

Still waiting for update no response for @danielcardeenas :(

x-frst avatar May 05 '19 13:05 x-frst

Hello, seeing that @danielcardeenas has not appeared, I decided to start a new hybrid project between yowsup3 and whatsapp-framework. Although the installation of yowsup3 does not generate errors, and the first connection with whatsapp is established correctly, there are errors that I think the community can help solve.

The repository link is: https://github.com/devalexanderdaza/yowsapp-framework

devalexanderdaza avatar May 06 '19 22:05 devalexanderdaza

@devalexanderdaza do you able send image?

Sharissa90 avatar May 07 '19 11:05 Sharissa90

@devalexanderdaza puedes enviar la imagen?

In a while I will create an incidence in the repository to manage the support of the community. Follow the instructions contained in the repository so that you can reach the error and between all of us we can solve it and use the library again

devalexanderdaza avatar May 07 '19 13:05 devalexanderdaza

Update yowsup-cli v3.2.0 yowsup v3.2.3

Made the modificacion on top and .... got this error

Traceback (most recent call last): File "run.py", line 9, in from app.layer import MacLayer File "/home/ubuntu/whatsapp-framework/app/init.py", line 1, in import modules File "/home/ubuntu/whatsapp-framework/modules/init.py", line 1, in from modules import start File "/home/ubuntu/whatsapp-framework/modules/start.py", line 2, in from app.mac import mac, signals File "/home/ubuntu/whatsapp-framework/app/mac/mac.py", line 14, in from yowsup.common.optionalmodules import PILOptionalModule, AxolotlOptionalModule ImportError: cannot import name 'AxolotlOptionalModule'

used to work with yowsup v3.0

jesusvalverde avatar May 10 '19 02:05 jesusvalverde

nano app/mac/mac.py

delete 'AxolotlOptionalModule' from yowsup.common.optionalmodules import PILOptionalModule

nano app/utils/downloader.py comment #from yowsup.layers.protocol_media.mediadownloader import MediaDownloader

#return MediaDownloader().download(url.decode('ASCII')) sudo app/layer.py

comment #from yowsup.layers.protocol_media.mediadownloader import MediaDownloader

sudo ./clean.sh

./start.sh

but Errors

line 63, in on_auth assert type(local_static) is KeyPair

yowsup-cli v3.2.0 yowsup v3.2.3

jesusvalverde avatar May 10 '19 02:05 jesusvalverde

@Gabrieru, U need to provide your country code in place of CC.

navasonline2015 avatar May 17 '19 16:05 navasonline2015

Hi,

I installed the next packages in my raspberry with pip3: -python-axolotl -protobuf -six -argparse -readline -pillow -tqdm -requests -yowsup -pycrypto -blinker

next, I download your repository (today is 2019-May-17), I live in Colombian, so I intent send the registration with: yowsup-cli registration --requestcode sms --phone 57317509xxx --cc 57 -E android

but the console print a error:

Traceback (most recent call last): File "/usr/local/bin/yowsup-cli", line 4, in import('pkg_resources').run_script('yowsup2==2.5.2', 'yowsup-cli') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 739, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1494, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 368, in if not parser.process(): File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 189, in process self.handleRequestCode(self.args["requestcode"], config) File "/usr/local/lib/python3.5/dist-packages/yowsup2-2.5.2-py3.5.egg/EGG-INFO/scripts/yowsup-cli", line 198, in handleRequestCode from yowsup.registration import WACodeRequest File "/usr/local/lib/python3.5/dist-packages/yowsup/registration/init.py", line 1, in from .coderequest import WACodeRequest File "/usr/local/lib/python3.5/dist-packages/yowsup/registration/coderequest.py", line 1, in from yowsup.common.http.warequest import WARequest File "/usr/local/lib/python3.5/dist-packages/yowsup/common/http/init.py", line 2, in from .warequest import WARequest File "/usr/local/lib/python3.5/dist-packages/yowsup/common/http/warequest.py", line 8, in from yowsup.common.tools import WATools File "/usr/local/lib/python3.5/dist-packages/yowsup/common/tools.py", line 10, in from consonance.structs.keypair import KeyPair File "/usr/local/lib/python3.5/dist-packages/consonance/structs/keypair.py", line 4, in from dissononce.dh.x25519.x25519 import X25519DH File "/usr/local/lib/python3.5/dist-packages/dissononce/dh/x25519/x25519.py", line 1, in from cryptography.hazmat.primitives.asymmetric import x25519 ImportError: cannot import name 'x25519'

The Version is: yowsup-cli v2.0.15 Using yowsup v3.2.3

#could help me, please?

wisrovi avatar May 17 '19 19:05 wisrovi

yowsup-cli registration --requestcode sms --phone 57317509xxx --cc 57 -E android

@wisrovi just type yowsup-cli registration --requestcode sms --config-phone 57317509xxx --cc 57

Sharissa90 avatar May 18 '19 14:05 Sharissa90

ok, I executed this: yowsup-cli registration --requestcode sms --config-phone 57317509xxx --cc 57

But the console printed: usage: registration [-h] [-v] [-d] [--help-config] [-c CONFIG] [-E {android}] [-m MCC] [-n MNC] [-p PHONE] [-C CC] [-r (sms|voice) | -R code] registration: error: unrecognized arguments: --config-phone 57317509xxxx

The version for youwsup version -v is: yowsup-cli v2.0.15 Using yowsup v3.2.3

wisrovi avatar May 20 '19 16:05 wisrovi

someone got it working? i can pay for that if can help me to fix

gabrieru avatar May 22 '19 04:05 gabrieru

ok, I executed this: yowsup-cli registration --requestcode sms --config-phone 57317509xxx --cc 57

But the console printed: usage: registration [-h] [-v] [-d] [--help-config] [-c CONFIG] [-E {android}] [-m MCC] [-n MNC] [-p PHONE] [-C CC] [-r (sms|voice) | -R code] registration: error: unrecognized arguments: --config-phone 57317509xxxx

The version for youwsup version -v is: yowsup-cli v2.0.15 Using yowsup v3.2.3

my mistake use --config-cc not just --cc

yowsup-cli registration --requestcode sms --config-phone 57317509xxx --config-cc 57

Sharissa90 avatar May 22 '19 15:05 Sharissa90

I tried this: yowsup-cli registration --requestcode sms --config-phone 57317509xxxx --config-cc 57

but, The console: error: unrecognized arguments: --config-phone 573175098360 --config-cc 57

could could help me, please?

Thanks a lot

wisrovi avatar May 23 '19 12:05 wisrovi