devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
943 stars 283 forks source link

Feature Request: Disable downloading media #195

Closed dv336699 closed 10 months ago

dv336699 commented 1 year ago

We only care about text messages, is it possible to skip any processing for messages with media?

Maybe a config to stop here? https://github.com/devlikeapro/whatsapp-http-api-plus/blob/07ecca03a357237712f353a5421f7de42e23e6f0/src/plus/session.noweb.plus.ts#L80

Thanks

allburov commented 1 year ago

Hi! You can set WHATSAPP_FILES_MIMETYPES environment variable yo something like "never-will-exist" value, so it doesn't download files (because they don't match the mimetype) https://waha.devlike.pro/docs/how-to/config/

But it's good to have a new one to just disable downloading, we'll add it!

allburov commented 1 year ago

I see one problem tho - setting WHATSAPP_FILES_MIMETYPES to some random value still will download and dencrypt file content, just won't save the file on a disk.

You can use it as a small fix, we'll provide a better solution later!

allburov commented 1 year ago

Just found that you created similar issue https://github.com/devlikeapro/whatsapp-http-api/issues/128 Sure, we'll handle it right soon!

allburov commented 10 months ago

HI! Fixed, will be released in 2023.12.1 (1-4 December)


💡 Even if WAHA doesn't process the message media because of WHATSAPP_FILES_MIMETYPES or WHATSAPP_DOWNLOAD_MEDIA you'll get a webhook event with hasMedia: True field, but with no mediaUrl.

{
  "event": "message",
  "session": "default",
  "payload": {
    "hasMedia": true,
    "mediaUrl": null,
    "mimetype": "image/jpeg"
  }
}