Will YouTube treat my video as a Short? Check it in Python

YouTube says Shorts are up to 3 minutes and square or vertical. A short Python script reads Sume's probe and tells you which side of the line a file falls on.

1 min readSume
All posts

YouTube's upload page for Shorts says a Short can be up to 3 minutes long and square or vertical. Those are the two tests a file can fail before you upload, and both are readable from a probe. A short Python script can fetch the clip's width, height and duration from Sume and print which side of the line it falls on.

The rules are from Upload YouTube Shorts (read 2026-10-03). The three-minute length is newer than many tutorials assume. Understand three-minute YouTube Shorts (read 2026-10-03) says it applies to uploads made after October 15, 2024 on standard channels, and that earlier uploads stay long-form.

What the script tests

  • Duration at most 180 seconds, taken from the probe's duration_seconds.
  • Width no greater than height, which is how I read "square or vertical". The help pages give no ratio cutoff, so a 4:5 file is a judgement call, not a documented pass.
  • Nothing about upload processing. YouTube decides on its side, and these are the only two limits the page states.

The check

Sume's video inspect returns a probe with duration_seconds, width and height when you pass frames: false. The call is sync for up to 30 seconds, then returns 202 and you poll the GET route. The source can be up to 1800 seconds long and has to be on media.sume.com.

import json, os, time, urllib.request as u

def call(method, path, body=None, key=None):
    h = {"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
         "Content-Type": "application/json"}
    if key:
        h["Idempotency-Key"] = key
    data = json.dumps(body).encode() if body is not None else None
    req = u.Request("https://api.sume.com" + path, data, h, method=method)
    with u.urlopen(req) as r:
        out = json.load(r)
    return out.get("data", out)

def probe(url, key):
    d = call("POST", "/v1/video-inspect", {"video_url": url, "frames": False}, key)
    for _ in range(30):
        if d.get("probe"):
            return d["probe"]
        time.sleep(2)
        d = call("GET", "/v1/video-inspect/" + d["id"])
    raise TimeoutError("probe not ready")

URL = "https://media.sume.com/artifacts/artf_demo/clip.mp4"
p = probe(URL, "short-check-1")
w, h, s = p["width"], p["height"], p["duration_seconds"]
print("duration <= 180 s:", s <= 180, round(s, 1))
print("square or vertical:", w <= h, f"{w}x{h}")

Reading the result

A few cases show where the line sits.

Shorts shape per YouTube's help pages; verdicts from this script (read 2026-10-03)
FileLengthVerdict
1080x192058 sPasses both tests
1080x1080175 sPasses; square, under 3 minutes
1920x108040 sFails shape: wider than tall
1080x1920181 sFails length by one second

If a file fails on length, cut it with video trim, which takes start and duration and costs $0.02 per job. If it fails on shape, re-render it with a Timeline output of 1080x1920.

Before you upload

The probe reads the file, not the channel. YouTube's three-minute page ties the longer limit to the upload date and the channel type, so a file that passes both tests can still be treated as long-form on an older upload. Read the page's dates for your channel, and use Studio's own message on upload as the last word.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume