MegaApiClient icon indicating copy to clipboard operation
MegaApiClient copied to clipboard

retrieve thumbnail uri but do not download

Open schealex opened this issue 3 years ago • 6 comments

Description:

I would like to just receive the thumbnail url but not actually have to download it. Is that possible at all? I couldn't find any method to do that.

MegaApiClient Version: 1.10.2

schealex avatar Sep 09 '22 14:09 schealex

Hello,

There is no public method in MegaApiClient to retrieve only the thumbnail URL because it simply doesn't exist. When requesting the thumbnail, MegaApiClient receives a blob of encrypted data and needs to extract/decrypt its content to get the actual image: https://github.com/gpailler/MegaApiClient/blob/master/MegaApiClient/MegaApiClient.cs#L964-L1024

gpailler avatar Sep 11 '22 02:09 gpailler

Hey @gpailler thanks for the response. When looking at https://github.com/gpailler/MegaApiClient/blob/master/MegaApiClient/MegaApiClient.cs#L993 so downloadResponse.Url is not the url of the image right? It's a url where the blob data comes from?

schealex avatar Sep 14 '22 09:09 schealex

Yes correct. It's not the thumbnail itself but a handle + blob size + blob content. The blob content is the thumbnail but encrypted

gpailler avatar Sep 14 '22 13:09 gpailler

Is there a way to generate the url in some other way? I wasn't even able to reverse engineer the path where the image gets loaded from in the browser version of mega.nz :/ i'm building a sortof crawling tool and i don't want to have to download the thumbnails on the server side just to send them to the clients if i can avoid the traffic this causes

schealex avatar Sep 16 '22 17:09 schealex

The url with the thumbnail content already decrypted just doesn't exist. As you can see in the DownloadFileAttribute method, the thumbnail is decrypted in memory.

gpailler avatar Sep 18 '22 23:09 gpailler

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 08 '23 01:01 stale[bot]