miniproto.media.download.download_media
miniproto.media.download.download_media
Section titled “miniproto.media.download.download_media”download_media(invoke: RawInvoker, media: object, destination: Destination = None, **kwargs: Any) -> MediaDownloadResultResolve media and materialize it through :func:download_file.
Parameters:
- invoke (
RawInvoker) – Async raw-RPC invoker used for file requests. - media (
object) – A :class:Media, file ID, raw document/photo/message, or input file location. - destination (
Destination) – In-memory, path, or binary-stream destination forwarded to :func:download_file. - kwargs (
Any) – Remaining forwarded**kwargsdownload options; cache identity and total size are inferred when possible.
Returns:
MediaDownloadResult– The same result and destination-ownership semantics as :func:download_file.
Raises:
MediaDownloadError– The supplied media cannot produce a download location.MediaIntegrityError– CDN or enabled plain-file verification fails.CancelledError– The transfer is cancelled and destination cleanup runs.