Skip to main content

Module media

Module media 

Source
Expand description

Bounded native CDN transport. This uses the observed HTTP carrier on port 443, not HTTPS. Media encryption and advertised size/digests are checked separately.

Structs§

CdnClient
CdnConfig
CdnLocation
ChannelsDownloadFacts
What the CDN delivered, kept for checks and failure diagnostics. Holds no address, token or key.
ChannelsDownloadFailure
A downloaded video failed a check. Its message is the stable code channels_integrity_failed; check names which check and facts say what arrived.
ChannelsVideo
A downloaded Channels video: the decoded bytes and what the CDN delivered.
DownloadedMedia
ImageInspection
MediaDescriptor
PreparedImageUpload
PreparedUpload
PreparedVariant
PreparedVideoUpload
SourceEvidence
How an optional reply value relates to the selected message tuple and to the bytes actually delivered. Values are compared, never retained.
StickerDescriptor
UploadedImage
Uploaded copies offered by an image message, with an optional original.
UploadedMedia
UploadedVideo
VideoRepresentationMismatch
A complete video transfer at or below the ordinary transfer threshold decrypted successfully but did not match the selected message tuple. The download is still rejected. Only fixed numeric controls and comparison results are kept, so a caller can store a diagnostic without reply bytes or digests. Fields use wire key names; their meanings are not established.

Enums§

LargeCdnRoute
LargeFileDownloadControl
Only these fixed, nonsecret numeric controls can enter a stored diagnostic.
LargeFileDownloadError
Strict rejection details. Unknown keys and response bytes are never retained.
MediaQuality

Constants§

MAX_CDN_TRANSFER_BYTES
MAX_CHANNELS_VIDEO_BYTES
Upper bound on a Channels video download.
MAX_LARGE_FILE_BYTES
MAX_LINK_THUMBNAIL_BYTES
MAX_NATIVE_UPLOAD_BYTES
MAX_VIDEO_DOWNLOAD_BYTES
Incoming video plaintext limit, matching the ordinary-file download and automatic-download ceiling. Every such transfer stays bound to the advertised length and MD5. Outgoing preparation keeps the separate wechat_media::MAX_VIDEO_SOURCE_BYTES source limit.
STICKER_HOSTS
Sticker bytes come from Tencent CDN hosts. Classic stored and pack emoji carry a wxapp.tc.qq.com source, while shared stickers use snsvideo.c2c.wechat.com; both are reachable directly, unlike the encrypted attachment channels. Any other host stays refused so a crafted message cannot turn this into an arbitrary fetch.

Functions§

adler32_zero
channels_box_type
The four-byte box type at offset 4, when it is printable ASCII.
channels_video_url
Build the download address the way the official player does: the returned address with its token appended, over HTTPS, on the video host.
decode_cdn_config
decode_large_cdn_config
Decode the safe C2C routing table in an authenticated GetCDNDns response. The safe CDN UIN belongs to that routing table and may differ from the account UIN.
decrypt_cdn
download_advertised_avatar
encrypt_recipient
fetch_channels_video
Download the post’s video and return the decoded MP4 bytes.
fetch_link_thumbnail
fetch_sticker
fetch_sticker_original
Fetch an original whose metadata has no advertised length. Enforces the same host, DNS, stream-size, MD5 and image checks without inventing a source length.
inspect_image
Inspect the retained source. For WXGF, dimensions describe its still preview; frames does not establish the source’s animation frame count.
pack_cdn
unpack_cdn
validate_avatar_url
validate_link_thumbnail_url
validate_shared_link_url
validate_sticker_url

Type Aliases§

CdnFields