Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Generic Media Decoder #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tiwarishrijan
Copy link
Contributor

#133

self.decodeMedia(mediaMessage=processedData[2][0]['message']) media decoder can be called here if message is media

sigalor#133 

self.decodeMedia(mediaMessage=processedData[2][0]['message']) media decoder can be called here if message is media
if extension is None or extension is '':
extension = '.ogg'
mediaData = urllib2.urlopen(media['url']).read()
mediaKeyExpanded = HKDF(base64.b64decode(media['mediaKey']), 112, "WhatsApp " + info + " Keys")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@@ -82,6 +83,7 @@ class WhatsAppWebClient:
onMessageCallback = None;
onCloseCallback = None;
activeWs = None;
location = r'''/usr/src/app/media/'''; ## Change Location of media as per requirement
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely need to set a sane default location for this to be safe to merge.

@@ -170,6 +200,7 @@ def onMessage(self, ws, message):
try:
processedData = whatsappReadBinary(decryptedMessage, True);
messageType = "binary";
##self.decodeMedia(mediaMessage=processedData[2][0]['message']) media decoder can be called here if message is media
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the lynchpin, we'll need to enable this before safely merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants