photo using the media id, access hash, and file reference?
- client.downloadMedia() expects a whole message object
- client.downloadFile(InputPhotoFileLocation()) wants a thumb size to be supplied?
- InputPhoto() seems to only be used to send messages, not download images?
download_media doesn't need message. Photo object would do, they all translate to InputPhotoFileLocation eventually, so it's the only efficient way, you need to know the thumb size since images have many specific resolutions, there should be a wildcard thumb to downalod medium size but don't know the reliability, it's better you save it yourself from Photo.sizes[-1].type
That one works, thank you! I assumed document would be easier, but hitting the same kind of problem.. InputDocumentFileLocation wants a thumb size, but non-image documents don't have that... Can't pass InputDocument to download_file() And passing InputDocument to download_media() just means nothing happens
thumb is empty string in case of documents with no thumbnail
you also don't store or pass thumb for documents at all, to downalod full document including images always pass empty string, unless you explicitly want a preview jpg thumbnail
Обсуждают сегодня