whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

Download document thumbnail

Open gushome7 opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe.

If the message type is a document, it has an associated image (thumbnail). The information is in the thumbnailDirectPath, thumbnailSha256, thumbnailEncSha256 properties. I did not find a method to get that file.

Describe the solution you'd like.

A good feature would be to have a function like downloadMedia() that allows you to download it.

Describe an alternate solution.

No response

Additional context

No response

gushome7 avatar Dec 02 '22 13:12 gushome7

I think the thumbnail is provided in the message raw data. Try using that, there is no plans to implement thumbnail downloads right now :D

purpshell avatar Dec 29 '22 12:12 purpshell

Thanks for your comment @PurpShell !

Thumbnail references are in msgdata, but by now I cannot understand how to use. Asap I discovered I will post here my aproach. Thanks again for your time!

thumbnailDirectPath: '/v/t62.36145-24/31077419_877580720045625_3890474881285585356_n.enc?ccb=11-4&oh=01_AdSag5ZwgY2Vti0V3wcnvQxdYORLnGCcqoLXB1XYq14Ggg&oe=63D52BBD', thumbnailSha256: '9hBfj2Ayatjbv7+7/oWd3m75RMxwD4wQ4lQ2QvQvicc=', thumbnailEncSha256: 'VXJdGnyynNf72ucTOLVYMZkH06E1VaTzrk9iiXA1exA=', thumbnailHeight: 480, thumbnailWidth: 271,

gushome7 avatar Dec 29 '22 19:12 gushome7