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.02k stars 797 forks source link

Audio client_url null #995

Open 3dluis opened 3 years ago

3dluis commented 3 years ago

When the audio format seems to have changed, the js_object client_url not found.

{ "accuracy":"None", "ack":0, "appStateSyncKeyRequest":"None", "appStateSyncKeyShare":"None", "author":"None", "backgroundColor":"None", "bizPrivacyStatus":"None", "body":"None", "broadcast":false, "broadcastId":"None", "broadcastParticipants":"None", "businessOwnerJid":"None", "buttons":"None", "buttonsResponse":"None", "canonicalUrl":"None", "caption":"None", "chat":{ "archive":false, "changeNumberNewJid":"None", "changeNumberOldJid":"None", "contact":{ "actualActors":"None", "formattedName":"+XDFDSFSFDSF", "hostStorage":"None", "id":{ "_serialized":"XXDDDDDD@c.us", "server":"c.us", "user":"XXXXXX" }, "isBusiness":false, "isEnterprise":false, "isHighLevelVerified":"None", "isMe":false, "isMyContact":false, "isPSA":false, "isUser":true, "isVerified":"None", "isWAContact":true, "labels":[

     ],
     "msgs":"None",
     "name":"None",
     "privacyModeTs":"None",
     "profilePicThumbObj":{

     },
     "pushname":"Luis Diaz",
     "sectionHeader":"None",
     "shortName":"None",
     "statusMute":false,
     "type":"in",
     "verifiedLevel":"None",
     "verifiedName":"None"
  },
  "ephemeralDuration":0,
  "ephemeralSettingTimestamp":0,
  "groupMetadata":"None",
  "id":{
     "_serialized":"XXDDDDDD2@c.us",
     "server":"c.us",
     "user":"XXXXXXXDDDSD"
  },
  "isAnnounceGrpRestrict":"None",
  "isGroup":false,
  "isReadOnly":false,
  "kind":"chat",
  "labels":"None",
  "lastReceivedKey":{
     "_serialized":"true_XXDDSD@c.us_3EB01761D2AFFFDFDSFSFD69E2AD",
     "fromMe":true,
     "id":"3EB01761D2AFFD69E2AD",
     "remote":{
        "_serialized":"FGFGFXXXX@c.us",
        "server":"c.us",
        "user":"FGFGFGCCC"
     }
  },
  "modifyTag":"None",
  "msgUnsyncedButtonReplyMsgs":"None",
  "msgs":"None",
  "muteExpiration":0,
  "name":"None",
  "notSpam":true,
  "pendingMsgs":false,
  "pin":0,
  "presence":{
     "chatstates":[

     ],
     "id":{
        "_serialized":"GFFGFGFG@c.us",
        "server":"c.us",
        "user":"YGFFGFGFG"
     }
  },
  "t":1612829661,
  "unreadCount":0

}, "chatId":{ "_serialized":"XXDDFDDSDSDS@c.us", "server":"c.us", "user":"18093220312" }, "clearMedia":"None", "clientUrl":"None", "comment":"None", "content":"None", "ctwaContext":"None", "currencyCode":"None", "degrees":"None", "deprecatedMms3Url":"https://mmg.whatsapp.net/d/f/AlRmME5Qlgfdgdgd46THraKOWsz7fY7676ZVlIcVXCI4bDgq_n_Vm0uE.enc", "description":"None", "devicesAdded":"None", "devicesRemoved":"None", "directPath":"/v/t62.7117-24/24328292_36739fg5472782719092_9005158939608816835_n.enc?oh=803f19cf6c746b98a6f41558fb914a40&oe=604D44EB", "doNotPlayInline":"None", "duration":"2", "dynamicReplyButtons":"None", "encFilehash":"Xx1UykOFsl4IEfbd84B5zD1mmj+UJmj+c878DW5Nans=", "ephemeralDuration":"None", "ephemeralOutOfSync":"None", "ephemeralSettingTimestamp":"None", "ephemeralSharedSecret":"None", "ephemeralStartTimestamp":"None", "filehash":"bb1nRQ5KN454eey4xMxc2WWru5aTpjw8t+hAKaBl8ezGaKe8=", "filename":"None", "finalAccuracy":"None", "finalDegrees":"None", "finalLat":"None", "finalLng":"None", "finalSpeed":"None", "finalThumbnail":"None", "finalTimeOffset":"None", "firstFrameLength":"None", "firstFrameSidecar":"None", "font":"None", "footer":"None", "forwardingScore":"None", "from":{ "_serialized":"xxxxcc@c.us", "server":"c.us", "user":"XXX" }, "gifAttribution":"None", "height":"None", "historySyncMetaData":"None", "hydratedButtons":"None", "id":"false_XXXXDS@c.us_3A4DTE4836C81402D8E7848", "interactiveAnnotations":"None", "invis":false, "inviteCode":"None", "inviteCodeExp":"None", "inviteGrp":"None", "inviteGrpJpegThum":"None", "inviteGrpName":"None", "isAnimated":"None", "isDynamicReplyButtonsMsg":false, "isForwarded":false, "isFromTemplate":false, "isGif":"None", "isGroupMsg":false, "isLink":"None", "isLive":"None", "isMMS":"None", "isMedia":false, "isNewMsg":true, "isNotification":false, "isPSA":false, "isThisDeviceAdded":"None", "isVcardOverMmsDocument":false, "isViewOnce":"None", "itemCount":"None", "labels":[

], "lat":"None", "list":"None", "listResponse":"None", "lng":"None", "loc":"None", "matchedText":"None", "mdDowngrade":"None", "mediaData":{ "_listeningToSwSupport":false, "_swStreamingSupported":false, "animatedAsNewMsg":false, "animationDuration":0, "aspectRatio":"None", "directPath":"None", "documentPreview":"None", "duration":"None", "durationFloat":"None", "emojis":"None", "encFilehash":"None", "filehash":"None", "filename":"None", "firstFrameLength":"None", "firstFrameSidecar":"None", "fullHeight":"None", "fullPreviewData":"None", "fullPreviewSize":"None", "fullWidth":"None", "gifAttribution":"None", "isAnimated":"None", "isGif":"None", "isVcardOverMmsDocument":false, "isViewOnce":false, "mediaBlob":"None", "mediaKey":"None", "mediaKeyTimestamp":"None", "mediaStage":"INIT", "mimetype":"None", "pageCount":"None", "parsedVcards":"None", "preview":"None", "progressiveStage":"None", "renderableUrl":"None", "rgbaBuffer":"None", "rgbaHeight":"None", "rgbaWidth":"None", "sidecar":"None", "singleLoopDuration":"None", "size":"None", "subtype":"None", "type":"unknown" }, "mediaKey":"qpRZeN8ZljxKU/krhGHGJuZggf7ARKEqwaALGg2Er1werM=", "mediaKeyTimestamp":1617782829673, "mentionedJidList":[

], "message":"None", "mimetype":"audio/ogg; codecs=opus", "multicast":"None", "notifyName":"", "orderId":"None", "orderTitle":"None", "pageCount":"None", "paymentAmount1000":"None", "paymentCurrency":"None", "paymentExpiryTimestamp":"None", "paymentMessageReceiverJid":"None", "paymentNoteMsg":"None", "paymentRequestMessageKey":"None", "paymentStatus":"None", "paymentTransactionTimestamp":"None", "priceAmount1000":"None", "productId":"None", "productImageCount":"None", "protocolMessageKey":"None", "quotedMsg":"None", "quotedMsgObj":"None", "quotedParticipant":"None", "quotedRemoteJid":"None", "quotedStanzaID":"None", "recipients":"None", "recvFresh":true, "retailerId":"None", "richPreviewType":"None", "scanLengths":"None", "scansSidecar":"None", "selectedId":"None", "selectedIndex":"None", "self":"in", "sellerJid":"None", "sender":{ "actualActors":"None", "formattedName":"+CCCXXXXXXX", "hostStorage":"None", "id":{ "_serialized":"FFGGGHHH@c.us", "server":"c.us", "user":"FFFGFRRTR" }, "isBusiness":false, "isEnterprise":false, "isHighLevelVerified":"None", "isMe":false, "isMyContact":false, "isPSA":false, "isUser":true, "isVerified":"None", "isWAContact":true, "labels":[

  ],
  "msgs":"None",
  "name":"None",
  "privacyModeTs":"None",
  "profilePicThumbObj":{

  },
  "pushname":"pRUEBA",
  "sectionHeader":"None",
  "shortName":"None",
  "statusMute":false,
  "type":"in",
  "verifiedLevel":"None",
  "verifiedName":"None"

}, "sequence":"None", "shareDuration":"None", "size":7025, "speed":"None", "star":false, "status":"None", "streamable":"None", "streamingSidecar":"None", "subtype":"None", "surface":"None", "t":1612829677, "templateParams":"None", "textColor":"None", "thumbnail":"None", "thumbnailDirectPath":"None", "thumbnailEncSha256":"None", "thumbnailHeight":"None", "thumbnailSha256":"None", "thumbnailWidth":"None", "timestamp":161282FF66559677, "title":"None", "to":{ "_serialized":"XXXXXXX@c.us", "server":"c.us", "user":"XXXXX" }, "token":"None", "totalAmount1000":"None", "totalCurrencyCode":"None", "type":"ptt", "url":"None", "urlNumber":"None", "urlText":"None", "vcardFormattedName":"None", "vcardList":"None", "verifiedBizName":"None", "width":"None" }

edsondasilva commented 3 years ago

Luis in file messages.py:

self.client_url = self._js_obj.get("clientUrl") > self.client_url = self._js_obj.get("deprecatedMms3Url")

anandsork commented 3 years ago

I had same error & resolved with the solution above.. :thumbsup:

It seems that the way of download media is changing and old way is getting deprecated... Any idea or way out to support new way? (so that things will not break when this deprecatedMms3Url is removed)

3dluis commented 3 years ago

It is happening with all the multimedia messages that have a link.

3dluis commented 3 years ago

Can solve. If someone can apply pull request for this project.

webwhatsapi/objects/message.py

image

hchiapella commented 3 years ago

Hi 3dluis, your code fix the issue? :-)

3dluis commented 3 years ago

Yes

edsondasilva commented 3 years ago

Very good Luis!

hchiapella commented 3 years ago

Yes

Thanksssssss! Genius!

jeanRibeiro commented 3 years ago

Yesterday I updated the receipt for the parameter "deprecatedMms3Url" and today it started to give a problem.

jeanRibeiro commented 3 years ago

I managed to solve the problem by changing the line below:

xhr.open ("GET", messageObj.deprecatedMms3Url, true); to: xhr.open ("GET", messageObj.clientUrl, true);

dekkardnexus5 commented 3 years ago

I managed to solve the problem by changing the line below:

xhr.open ("GET", messageObj.deprecatedMms3Url, true); to: xhr.open ("GET", messageObj.clientUrl, true);

Hi Jean, this change is in wapi.js? Wich lines? I cant find the referenced code

dekkardnexus5 commented 3 years ago

Can solve. If someone can apply pull request for this project.

webwhatsapi/objects/message.py

image

Hi Luis, Could you please post the code? The first image seems incomplete? Tks

Elintondm commented 3 years ago

@3dluis , could you please post the complete code of wapi.js?

Please!!!!

erm3nda commented 3 years ago

@dekkardnexus5 solution seems cleaner, not to change value of a property, use the right property in the xhr. @3dluis post code not images, thank you.

Im not sure that the first part of wapi code is needed.

Confirm I've made changes only to message.py, working again.

wherculano commented 2 years ago

Hey guys please, are you able to download any media? I'm also getting the error about client_url with value None. I've tried the solutions above, but nothing changed.