WhatsApp media connection lookup and CDN upload helpers.
Summary
Functions
Encode a base64 media hash into WhatsApp's URL-safe token form.
Request a fresh media_conn record from WhatsApp's w:m namespace.
Upload an encrypted media file to the WhatsApp CDN.
Types
@type media_conn() :: %{ auth: String.t(), ttl: non_neg_integer(), fetch_date: DateTime.t(), hosts: [media_host()] }
@type media_host() :: %{ hostname: String.t(), max_content_length_bytes: non_neg_integer() | nil }
Functions
Encode a base64 media hash into WhatsApp's URL-safe token form.
@spec refresh_media_conn( GenServer.server() | function(), keyword() ) :: {:ok, media_conn()} | {:error, term()}
Request a fresh media_conn record from WhatsApp's w:m namespace.
@spec upload( GenServer.server() | function(), String.t(), BaileysEx.Media.Types.media_type(), keyword() ) :: {:ok, upload_result()} | {:error, term()}
Upload an encrypted media file to the WhatsApp CDN.