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.04k stars 794 forks source link

How to send PTT? #791

Open Eduardowm opened 4 years ago

Eduardowm commented 4 years ago

There is a way to send PTT through the API?

Eduardowm commented 4 years ago

Or send audio/mp3?

marcelocecin commented 4 years ago

did you try to use send_media ?

Eduardowm commented 4 years ago

Yes, but is crashing the whole application. Looks like its something with Firefox vs codecs... some related errors appears on the browser console.

gushome7 commented 4 years ago

I never tried yet but note that PTT must be encoded with OGG Vorbis codec.

Eduardowm commented 4 years ago

Oh yes, I made it, just like WhatsApp, the same encoding. The ptt was sent, but within 'document' type.

When I use the send_media with mp3, the type become 'sound', but it doenst send at all.

marcelocecin commented 4 years ago

https://github.com/mukulhase/WebWhatsapp-Wrapper/blob/c579c97ea53f8d2879b927e13bffbd6539bcb18e/sample/flask/webapi.py

ALLOWED_EXTENSIONS = ('avi', 'mp4', 'png', 'jpg', 'jpeg', 'gif', 'mp3', 'doc', 'docx', 'pdf')

please include the print with the error

Eduardowm commented 4 years ago

Example: image

gushome7 commented 4 years ago

Example: image

Eduardowm did you test this audio player with an ogg audio file produced by whatsapp?

Eduardowm commented 4 years ago

No, I am now showing an example of an error that occurs related to codecs. It is exactly the same.

marcelocecin commented 4 years ago

the OGG extension is not supported

andersondeoliveiramachado commented 4 years ago

https://support.mozilla.org/en-US/kb/fix-common-audio-and-video-issues

https://stackoverflow.com/questions/40760864/how-to-play-mp4-video-in-firefox/40784948

apt -y install ffmpeg apt -y install gstreamer1-plugins-bad-freeworld apt install libdvdnav4 libdvdread4 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg apt install ubuntu-restricted-extras