Sending audio and video files work in the same way as sending images. It begins with a call to media_requestUpload with the hash, a string of the type of file to upload, and the filesize as arguments, and once the request succeeds, the client has to use MediaUploader to upload the local file, and finally when the upload completes the client can then send the URL to friends using the method message_imageSend, message_audioSend, and message_videoSend for images, audio files and video files respectively. The only difference in the API for these 3 methods are: message_audioSend does not have a preview as argument, while message_videoSend and message_imageSend both have a argument for the preview (which can be None).
Please note that most of the audio and video uploader code is copy-pasted from the image uploader, and I haven't wrote in preview code for the video uploader due to the infinite variety of video formats out there. This code is more for people to look at and see how it works than to be used in production.
Examples\AudioUploaderClient.py
Examples\VideoUploaderClient.py
yowsup-cli
Tested with .mp3 and .wav for audio, and .mp4 for video.
yowsup-cli
Tested with .mp3 and .wav for audio, and .mp4 for video.
Using Yowsup to send audio and video files |
This comment has been removed by the author.
ReplyDeleteJust getting:
ReplyDeleteSending picture 3146.jpg of size 310914 with name 3146.jpg
Sending media_requestUpload
Request Fail: hash: Wupcov2VxdVmkYdyol+nJjZfd9ChIlTrwZcUJ+bf8OM=
How to fix that? :D
What's the command that you're using?
Deletecd /whatsfap/ && ./yowsup-cli --config fap.conf --sendAudio 49151xxxxxxxx /www/whatsfap/audios/franz.mp3 -a
Deletecd /whatsfap/ && ./yowsup-cli --config fap.conf --sendImage 49151xxxxxxxx /www/whatsfap/images/1.jpg -a
No idea...
DeleteI've made a large post about the problem. Can you check out this?
ReplyDeletehttps://github.com/tgalal/yowsup/issues/332
I am getting success URL but the image is not delivered . any luck ?
ReplyDeleteit Works!! Thank you!!
ReplyDeletecan u plz help me with the steps to be followed for above code
ReplyDelete