open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.14k stars 600 forks source link

sendLinkWithAutoPreview thumbnail doesn't work #3067

Open dmzoneill opened 1 year ago

dmzoneill commented 1 year ago

Are you using the latest version of the library?

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Personal account (normal)

Mode

My own code

Current Behavior

provided thumbnail does not display with using sendLinkWithAutoPreview

Expected Behavior

thumbnail to show

Steps To Reproduce

Trying sendLinkWithAutoPreview with a base64 image (data URL or non data URL) does not work.

original image

https://scontent-dub4-1.xx.fbcdn.net/v/t15.5256-10/323944436_897224378085210_3907977215867544111_n.jpg?_nc_cat=107&ccb=1-7&_nc_sid=f2c4d5&_nc_ohc=QCRfFypjImUAX-16X9t&_nc_ht=scontent-dub4-1.xx&oh=00_AfDtmVdd5V_EiGYAkaBeJjvE-BJ8B3Miq_WrBekeYCFf5A&oe=64113E6A

base64 image

https://pastebin.com/rZSSHsdk

You can paste the base64 image into https://base64-to-image.com/ and see it works perfectly fine.

client.sendLinkWithAutoPreview(message.from, message.body, "test", ^^ above pastebin ^^ )

create() code OR full CLI command + CONFIG

client.sendLinkWithAutoPreview(message.from, message.body, "test", *data_url + base64_image)

### DEBUG INFO

```markdown
Debug info: {
"WA_VERSION": "2.2311.5",
"PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
"WA_AUTOMATE_VERSION": "4.58.0",
"BROWSER_VERSION": "HeadlessChrome/110.0.5481.177",
"OS": "Linux 6.1",
"START_TS": 1678559736318,
"RAM_INFO": "Total: 101.12 GB | Free: 17.66 GB",
"PPTR_VERSION": "19.7.2"
}

Environment

- OS: Debian

$ npm --version
9.2.0
$ node --version
v18.13.0

Screenshots/Logs

No response

Anything else?

thank you

smashah commented 1 year ago

@dmzoneill the pastebin has dataurl, can you try again with just the base64 portion please:

just remove data:image/jpeg;base64, from the start

dmzoneill commented 1 year ago

hi @smashah

As indicated above, i've tried it with and without the dataurl.