Skip to content

Media and storage

Where a post's video comes from — a public URL, or a file in mixetape storage.

Updated View as Markdown

A post has one file (mediaUrl) or several (media, a list in order) — a carousel on Instagram, Threads and Pinterest, a photo album on Facebook. Each file is either:

  • a public https URL that the platform can fetch, or
  • an r2:// URL of a file in mixetape storage.

Uploading a file

Uploading takes two calls around one PUT:

  1. create_upload returns a fileId and a presigned uploadUrl, valid for 6 hours.

  2. Send the whole file (up to 5 GB) in one PUT, with exactly the Content-Type it returns — no API key is needed for the PUT itself. The tool also returns a ready curl command:

    curl -X PUT "<uploadUrl>" -H "Content-Type: video/mp4" --data-binary @episode-12.mp4
  3. finish_upload with the fileId. mixetape finds the file and reads what it is.

Then schedule the post with the file’s url (r2://…), or put the file in a group item. An upload never finished is dropped after a day.

What mixetape knows about a file

Every file is read when it arrives, from the file itself rather than from what the uploader said: its kind (video, image or other), width and height in pixels (a phone video filmed upright counts as upright), orientation (vertical, horizontal or square) and a video’s durationMs. MP4 and MOV videos and JPEG, PNG, GIF and WebP images are understood; other files keep the kind their content type says.

So an agent can ask list_media for kind: ["video"] and pick the vertical ones for Shorts and Reels without downloading anything.

Importing from a URL

import_media copies a file from a public https URL (up to 5 GB, with a Content-Length) into storage — for example a render service’s link that expires. mixetape fetches it; nothing is sent from your machine.

Housekeeping

list_media lists your files, newest first; get_media answers one, by id or r2:// URL. delete_media refuses while a post that has not gone out yet points at the file.

Storage is a staging area, not an archive. A file goes as soon as every post with it is published (or cancelled before it went out). A file no post needs goes 24 hours after it was stored (expiresAt on every file) — one waiting in a group included, and an upload never finished. A file is never deleted while a post that has not gone out still needs it.

What each platform takes

list_accounts gives every channel’s formats: whether its platform takes videos and images, how many files a carousel holds and of which kinds, image types, video length, and whether it is made for upright media.

Platform Video Image Several files
YouTube Long videos and Shorts — —
Facebook Page video or Reel Photo Album of 2–10 images
Instagram Reel, 3 s–15 min Photo (JPEG; PNG, WebP, GIF sent as JPEG) Carousel of 2–10 images and videos
Threads Up to 5 min JPEG or PNG (WebP, GIF sent as JPEG) Carousel of 2–20 images and videos
TikTok 3 s–10 min — —
Pinterest 4 s–15 min Image Pin Carousel Pin of 2–5 images

Files in mixetape storage are checked against this when a post is created, so a post the platform cannot take is refused at once — not at go-live. A horizontal video where upright is expected is allowed; plan_group warns about it. An image in storage that a platform takes only as JPEG — a PNG for Instagram — is turned into JPEG on its way there (at the edge, at most 1440 px wide); the original stays as it is.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close