40 claimed Shorts, 40 trims to 59 seconds: $0.80 with a Python loop
Cut 40 claimed Shorts to 59 seconds with Sume Video trim at $0.02 each, $0.80 in total, using a Python loop with one Idempotency-Key per clip.

Forty trims cost 40 x $0.02 = $0.80 on Sume (as of 2026-10-08). YouTube's help page says a Short over one minute with an active copyright claim is blocked globally, with no monetization and no channel penalty, while one under a minute sees no change. A 59-second cut of each claimed Short gets it back under that line. The script below sends one trim per clip with its own Idempotency-Key.
The loop
It uses only the Python standard library, reads the key from SUME_API_KEY, and refuses to run when that is empty. Replace the URLs with your own media.sume.com artifacts. Video trim needs the clip on media.sume.com, accepts a source up to 1800 seconds and an output of 0.2 to 900 seconds, and defaults to async mode, so each call returns a job to poll.
import json, os, urllib.request
KEY = os.environ.get("SUME_API_KEY", "")
if not KEY:
raise SystemExit("set SUME_API_KEY")
CLIPS = [
"https://media.sume.com/artifacts/artf_demo/short-1.mp4",
"https://media.sume.com/artifacts/artf_demo/short-2.mp4",
]
for i, url in enumerate(CLIPS, 1):
body = json.dumps({"video_url": url, "start": 0, "duration": 59,
"precision": "exact"}).encode()
req = urllib.request.Request(
"https://api.sume.com/v1/video-trim", data=body, method="POST",
headers={"Authorization": "Bearer " + KEY,
"Content-Type": "application/json",
"Idempotency-Key": f"cut59-{i}"})
with urllib.request.urlopen(req, timeout=60) as r:
print(i, r.status, r.read().decode()[:200])The arithmetic and the keys
Each trim is a flat $0.02, and a 140-second source costs the same as a 600-second one. The key cut59-1, cut59-2 and so on is stable per clip, so a rerun of the script after a crash returns the original jobs rather than creating forty new charges.
| Item | Count | Price | Total |
|---|---|---|---|
| Video trim jobs | 40 | $0.02 | $0.80 |
| Keys | 40 | cut59-1 to cut59-40 | $0.00 |
| Output length | each | 59 s, under the 60 s line | n/a |
Read the results
Poll each job with GET /v1/jobs/:id/status and read /result when it completes. The result gives a new video_url, duration_seconds and actual_start_seconds. With exact precision the cut starts where you asked. If a source is shorter than 59 seconds the end clamps and the result carries the trim_clamped_to_source warning, so check for it before you assume every file is 59 seconds long.
The cut keeps the first 59 seconds. If the claimed music is only in the first minute, the claim may stay. Cutting the part the claim covers is a separate decision, and no trim can tell you which seconds carry it. YouTube's own page is the place to see where a claim sits.
Limits of the script
The loop is serial and sends no webhook, so it fires 40 requests one after another and returns job bodies, not results. For a large batch, add a short pause between calls and keep the printed job ids in a file, so that a later run can poll them. Do not delete the keys list: reusing cut59-7 with a changed body is a different request, so keep the body for each key the same on a rerun. The total stays $0.80 as long as every key maps to one body.
Sources
Related posts
More in Developers
- Four music variants in parallel: Python asyncio, one key per take
Submit four Music Router jobs at once from Python with one Idempotency-Key each, poll status concurrently, and pay 4 x $0.125 = $0.50. Code that runs.
- Free plan accepts 6 paid jobs: submit 7 and read queue_full
Free allows 1 processing job and 5 queued, so 6 are accepted. A Python script submits 7 in parallel and prints which are accepted and which get 429 queue_full.
- Free, Pro, Startup, Scale: processing seats, queue slots, full hold
Sume's concurrency by plan, queue capacity max(3, 5 x concurrency), accepted job capacity, and the balance reserved if every slot holds a 10 s clip.
- Gate a Format run on TikTok limits: artifact size, length, pixels
Check a Sume Format run's artifacts[] for size, duration and dimensions against TikTok's non-Spark limits before upload. A Python gate under 30 lines.
Written by Sume