Closed dv336699 closed 10 months 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!
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!
Just found that you created similar issue https://github.com/devlikeapro/whatsapp-http-api/issues/128 Sure, we'll handle it right soon!
HI! Fixed, will be released in 2023.12.1
(1-4 December)
WHATSAPP_DOWNLOAD_MEDIA
flag which you can set to WHATSAPP_DOWNLOAD_MEDIA=false
to disable downloading for all incoming files.WHATSAPP_FILES_MIMETYPES
or WHATSAPP_FILES_MIMETYPES
: This variable can be used to download only specific mimetypes from messages.
By default, all files are downloaded. The mimetypes must be separated by a comma, without spaces.
For example: audio,image/png,image/gif
. To choose a specific type, use a prefix (like audio,image
). See usage below.WHATSAPP_DOWNLOAD_MEDIA=true
- this variable can be used to completely disable downloading media files. By default, all files are downloaded.
Set this variable to WHATSAPP_DOWNLOAD_MEDIA=false
to disable downloading media files.
WHATSAPP_FILES_MIMETYPES=mimetype/ignore-all-media
to ignore all media files.💡 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"
}
}
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