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.

5 min readSume
All posts

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.

Forty clips, read 2026-10-08
ItemCountPriceTotal
Video trim jobs40$0.02$0.80
Keys40cut59-1 to cut59-40$0.00
Output lengtheach59 s, under the 60 s linen/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

All Developers posts

Written by Sume