tgalal / yowsup

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

How to send image and video in yowsup.. any Example.. #2225

Open galaxyitcenter opened 7 years ago

galaxyitcenter commented 7 years ago

Thanks in advance

dietzi commented 7 years ago

https://github.com/tgalal/yowsup/wiki

galaxyitcenter commented 7 years ago
I used this command
/image send 91972745XXXX "F:\IMAGES & PHOTOS\MIX\Photo0007.jpg"

<iq from="s.whatsapp.net" type="error" id="2">
<error code="501" text="feature-not-implemented">
</error>
</iq>

ERROR:yowsup.demos.cli.layer:Request upload for file F:\IMAGES & PHOTOS\MIX\Photo0007.jpg for 91972745XXXX@s.whatsapp.net failed

DEBUG:yowsup.layers.logger.layer:rx:
<iq from="s.whatsapp.net" type="error" id="2">
<error code="501" text="feature-not-implemented">
</error>
</iq>
            DEBUG:yowsup.layers.protocol_iq.layer:ping queue size: 1
DEBUG:yowsup.layers.logger.layer:tx:
<iq id="3" type="get" xmlns="w:p">
</iq>

DEBUG:yowsup.layers.logger.layer:rx:
<iq from="91932824XXXX@s.whatsapp.net" type="result" id="3" t="1504172722">
</iq>

**Media is not uploading this is my debug log**
dietzi commented 7 years ago

https://github.com/tgalal/yowsup/issues/2149

hgc2002 commented 7 years ago

We have an issue here since several days. That is what issue 2149 is about. You'll have to wait a little bit while it gets solved.

azizasm commented 7 years ago

Sending Image require encryption which is new requirement for Whatsup. Fixes are available in https://github.com/dietzi/yowsup

galaxyitcenter commented 7 years ago

@azizasm Have you tested this. Actually i am using this but still unable to send images. If you have any working example please share.

Thanks

azizasm commented 7 years ago

@galaxyitcenter yes tested and able to send image.

git clone https://github.com/dietzi/yowsup.git sudo python setup.py install

./yowsup-cli demos -y -c whatsapp_config.txt

/L /image send 6012XXXXXXX ./us.jpeg

galaxyitcenter commented 7 years ago

Getting Problem

DEBUG:yowsup.env.env:Current env changed to android Traceback (most recent call last): File "./yowsup-cli", line 368, in if not parser.process(): File "./yowsup-cli", line 268, in process self.startCmdline() File "./yowsup-cli", line 290, in startCmdline from yowsup.demos import cli File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/demos/cli/init.py", line 1, in from .stack import YowsupCliStack File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/demos/cli/stack.py", line 1, in from yowsup.stacks import YowStackBuilder File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/stacks/init.py", line 1, in from .yowstack import YowStack, YowStackBuilder File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/stacks/yowstack.py", line 10, in from yowsup.layers.protocol_media import YowMediaProtocolLayer File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/layers/protocol_media/init.py", line 1, in from .layer import YowMediaProtocolLayer File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/layers/protocol_media/layer.py", line 2, in from .protocolentities import ImageDownloadableMediaMessageProtocolEntity File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/layers/protocol_media/protocolentities/init.py", line 3, in from .message_media_downloadable_image import ImageDownloadableMediaMessageProtocolEntity File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/layers/protocol_media/protocolentities/message_media_downloadable_image.py", line 4, in from yowsup.layers.protocol_messages.proto.wa_pb2 import ImageMessage File "/home/ubuntu/Documents/whatsapp/yowsup/yowsup/layers/protocol_messages/proto/wa_pb2.py", line 570, in module = 'wa_pb2' File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 162, in init _AttachFieldHelpers(cls, field) File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 288, in _AttachFieldHelpers is_map_entry = _IsMapField(field_descriptor) File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 265, in _IsMapField field.message_type.has_options and AttributeError: 'NoneType' object has no attribute 'has_options'

galaxyitcenter commented 7 years ago

@azizasm PLEASE SHARE YOUR PYTHON CONFIG. Because it works in my only one system in other system it doesnt works.

azizasm commented 7 years ago

Based on the error seems you dont have Imaging library installed. Please install by

sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
                     libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
sudo pip install -I pillow
galaxyitcenter commented 7 years ago

@azizasm Thanks

tgrymatt commented 7 years ago

@azizasm have the same error like @galaxyitcenter .

My environment is:

Raspberry Pi with Raspbian Stretch. I tried to install the packages like you are listed above, but not all of them are available in this versions. I have these versions installed:

ii libtiff5-dev:armhf 4.0.8-2+deb9u1 armhf Tag Image File Format library (TIFF), development files ii libjpeg-dev 1:1.5.1-2 all Development files for the JPEG library [dummy package] ii libjpeg62-turbo-dev:armhf 1:1.5.1-2 armhf Development files for the libjpeg-turbo JPEG library ii zlib1g-dev:armhf 1:1.2.8.dfsg-5 armhf compression library - development ii libfreetype6-dev 2.6.3-3.2 armhf FreeType 2 font engine, development files ii liblcms2-dev:armhf 2.8-4 armhf Little CMS 2 color management library development headers ii libwebp-dev:armhf 0.5.2-1 armhf Lossy compression of digital photographic images. ii tcl8.5-dev:armhf 8.5.19-2 armhf Tcl (the Tool Command Language) v8.5 - development files ii tk8.5-dev:armhf 8.5.19-1 armhf Tk toolkit for Tcl and X11, v8.5 - development files ii python-tk 2.7.13-1 armhf Tkinter - Writing Tk applications with Python

After running /usr/local/bin/yowsup-cli demos -y -c /home/pi/yowsup/config I got this 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/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 748, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 1517, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 368, in if not parser.process(): File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 268, in process self.startCmdline() File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 290, in startCmdline from yowsup.demos import cli File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/demos/cli/init.py", line 1, in from .stack import YowsupCliStack File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/demos/cli/stack.py", line 1, in from yowsup.stacks import YowStackBuilder File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/stacks/init.py", line 1, in from .yowstack import YowStack, YowStackBuilder File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/stacks/yowstack.py", line 10, in from yowsup.layers.protocol_media import YowMediaProtocolLayer File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/layers/protocol_media/init.py", line 1, in from .layer import YowMediaProtocolLayer File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/layers/protocol_media/layer.py", line 2, in from .protocolentities import ImageDownloadableMediaMessageProtocolEntity File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/layers/protocol_media/protocolentities/init.py", line 3, in from .message_media_downloadable_image import ImageDownloadableMediaMessageProtocolEntity File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/layers/protocol_media/protocolentities/message_media_downloadable_image.py", line 4, in from yowsup.layers.protocol_messages.proto.wa_pb2 import ImageMessage File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.5.2-py2.7.egg/yowsup/layers/protocol_messages/proto/wa_pb2.py", line 570, in module = 'wa_pb2' File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 162, in init _AttachFieldHelpers(cls, field) File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 288, in _AttachFieldHelpers is_map_entry = _IsMapField(field_descriptor) File "/usr/local/lib/python2.7/dist-packages/protobuf-3.4.0-py2.7.egg/google/protobuf/internal/python_message.py", line 265, in _IsMapField field.message_type.has_options and AttributeError: 'NoneType' object has no attribute 'has_options'

Any hint for me?

carlos-angulo commented 7 years ago

I have the same problem and I have installed pillow

acircuit commented 6 years ago

Any solution to this? I am facing the same problem after installing pillow also.