- users.free_plan_denied (nullable, additive ALTER at boot): when set,
free_plan_eligible is False for any sign-in method; paid plans and
top-ups are untouched. is_free_user keeps such accounts on the free
7-day retention.
- Sign-up (magic link and Google) stamps "recreated_after_deletion" when
the address's fingerprint is in account_deletions within
FREE_REDO_BLOCK_DAYS (90): deleting and re-registering reset the
monthly 20 minutes.
- A magic-link request for an existing account re-checks its MX and stamps
"disposable_mx" when it matches the list (never blocks the sign-in).
- disposable_mx.txt: wabblywabble.com, wallywatts.com (the sep-2026 farm,
~100 front domains), den.yt, temp-mail-pro.com.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- security_utils: accept only is_global addresses (100.64.0.0/10, the
Tailscale range, went through is_private), judging IPv4-mapped / 6to4 /
Teredo / NAT64 IPv6 by the IPv4 inside.
- /api/process validates the URL (public host, one YouTube video) before
anything fetches it, and the quality probe now runs after the metering
step (balance, job limit, hourly probe cap); a low-quality confirm or a
too-short source hands the reservation back. quality_probe.py checks the
same itself, passes noplaylist and no longer disables TLS verification.
- Metered whole-video URL jobs carry SOURCE_CAP_MINUTES = reserved minutes
(job env + resume manifest); main.py cuts a download clearly longer than
that, so a server cannot answer the probe short and the download long.
- main.py / quality_probe.py get child_env(): the server secrets (Stripe,
JWT, DB, SMTP, Telegram, R2, AgentLedger, managed keys) are dropped; a
test fails if the pipeline ever reads one.
- /api/social/user no longer logs the whole Upload-Post profile list.
- Owner checks on /api/thumbnail/generate, /api/thumbnail/publish/status
(dashboard now polls with apiFetch) and /api/render/{id}; /video/{id}
and /gallery escape every interpolated value and drop non-http URLs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Free tools (no login), linked from nav and footer via /tools:
- /youtube-transcript-generator: reads the captions a video already has on
YouTube (free_tools.py, yt-dlp over the flat-rate static proxies only, never
the per-GB proxy, never the GPU). Per-IP limits, global daily cap, 24 h
cache, honest "no captions" answer with a CTA to the clip generator.
Copy / TXT / SRT export in the browser.
- /youtube-tag-generator: tags, 10 titles or a description from a brief, one
Gemini text call, rules taken from YouTube's own docs (sourced on the page).
- /video-aspect-ratio-converter: 16:9 to 9:16 in the browser with mediabunny
and WebCodecs (blur / crop / bars), nothing uploaded.
Tool pages keep the form in the static HTML; the behaviour is a Vite entry
(dashboard/tools) that vite-plugin-seo resolves by name.
New pages /auto-clip and /youtube-automation with real, blurred screenshots
of the Autopilot tab and the connect-an-agent card, Autopilot rules from
cloud/autopilot.py, plan prices from the billing API and aggregate usage
from the ledger (dated).
SEO fixes: titles/metas for /how-openshorts-works, /podcast-to-shorts, /mcp
and /free-ai-clip-generator (brand queries at pos 1-2 with <1% CTR); a free
AI clipper / free clipping website section and FAQ, and contextual "free AI
clip generator" anchors from sibling pages and the homepage.
Attribution: static pages now write the same first-touch os_attrib key the
app writes, so the signup is credited to the page the visit started on
(7,481 of 7,481 signups in 30 days said "/"). Signup, CheckoutStarted and
Subscribed carry landing_path / referrer_host / utm props in OpenPanel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Benchmarked in the prod container on 10 real user videos (40 min of audio,
EN/ES/PT/FR-AR, 4,850 words) before changing anything:
config peak VRAM ASR time words != prod ts drift
prod (batch 8) 6.1 GB 32 s - -
batch 4 + lean arena 4.6 GB 38 s 1 (*) 0.1 ms
batch 2 + lean arena 4.1 GB 40 s dropped a sentence
int8 3.9 GB 350 s 11.7 % 168 ms
(*) outside the mixed-language clip, which goes to whisper in prod anyway.
Ship batch 4 with the arena growing only by what is requested and no max
cuDNN workspace (those two alone change nothing in the output).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 9:10 source delivered 3 clips in prod where the pipeline had asked
itself for 6-12. Two independent leaks, both in the chain that derives
the clip count.
The scoring pass SELECTED instead of ranking: "choose up to 3 windows
from this batch" put the shortlist ceiling at 3 * n_batches rather than
shortlist_target, so 9 windows batched 8 + 1 shortlisted 4 of a target
of 8, and clip_count_targets then asked the detail pass for 4-8 clips
instead of 6-12. Every source under ~30 min was starved the same way,
which is the mechanism behind "95% of jobs deliver 3 clips or fewer" —
the clip count D2 retention hangs on (0.4% for 1-3 clips, 16.1% for
4-9). It also discarded the ranking it was computing: a batch holding
five great moments could still contribute only three, while a batch of
filler contributed its own three. The prompt now scores every window it
is given and the shortlist is the global top N.
Batches are near-equal instead of "full ones plus the remainder": a
trailing batch of one window came back with that window whatever its
score, because a cap of 3 cannot filter a batch of 1, so the tail of the
video entered the shortlist by arithmetic. Same call count as before.
And the floor was only a sentence in the detail prompt, with nothing in
code checking it, so a pass that returned half shipped half. When it
comes back under min_clips the shortlist windows that produced nothing
get one more call for the difference; an empty answer is accepted,
because padding is worse than a short list.
Measured on that source, same transcript, three runs: shortlist 4 -> 8,
clips 4 -> 6, cost unchanged (~$0.005, 3 calls).
- A job that fails for a reason on our side (CUDA/OOM, NVENC, cublas,
Gemini 5xx, no clip rendered) is re-queued once after 30 s, keeping its
reservation and transcript checkpoint. Content failures stay final.
- main.py renders clips best-score first and retries each failed clip once.
- A deploy's drain timeout no longer fails and refunds running jobs: the
child is killed, the manifest kept, and the next instance resumes it
(22-sep-2026: 6 jobs failed at once this way). Mid-render manifests are
resumed instead of being recovered as completed.
- /api/status returns the queue position and an ETA; the dashboard shows
it with a 'paid plans skip the line' upsell.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On 22-sep-2026 30-60% of jobs failed per hour at peak with 8 concurrent
jobs on a 20 GB GPU: a job three clips into its render still held 5.9 GB.
- main.py releases the ASR models right after transcribing (Parakeet's
onnxruntime CUDA arena lived until the process exited); TransNetV2
empties torch's cache after each pass.
- Host-wide cap on GPU transcriptions (flock slots on the shared output
volume, ASR_HOST_SLOTS=2), across job processes and deploy containers.
- The queue only starts a job when nvidia-smi reports GPU_MIN_FREE_MB free
(an idle card always starts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During a rolling deploy the old container finishes its running jobs on the
same GPU while the new one starts its own full MAX_CONCURRENT_JOBS. On
22-sep-2026 that was 7 old + 3 new jobs on a 20 GB card: TransNetV2 and
NVENC ran out of memory and 5 of 12 managed jobs failed. The new instance
now counts the jobs another instance is heartbeating and waits until the
total fits (bounded by the drain timeout; a killed instance goes stale in 60 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Most subscribers use OpenShorts on one day and cancel. Autopilot makes the
value recur: once switched on, every new upload on the user's YouTube channel
(listed through the existing Upload-Post connection, no scraping) is sent
through the normal /api/process pipeline, the user gets an email when the
clips are ready, and with autopublish on the best clips are scheduled on
their socials, one a day.
- cloud/autopilot.py: poller, in-process job submission as the user,
completion hook, autopublish, and /api/autopilot{,/videos,/run}
- guard rails: only videos published after switching on, max 3 days old,
1 automatic job per user per day, first N minutes per video, Shorts skipped,
paid plans only, dedupe by (user, video) across the deploy handover
- dashboard: new Autopilot tab (sidebar + mobile menu, #app?tab=autopilot)
- connect page can return to the Autopilot tab
- analytics: ClipsDelivered/JobFailed now report source=url and the plan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hourly sweep deleted job dirs and source uploads by age alone. With the
queue backed up (22-sep-2026) free jobs waited over an hour, so their dir
was removed under the worker: no clips, and the minute reservation stayed
held until the 3 h stuck sweep. 21 free users lost their job that way today,
most of them on their first run.
- _job_is_active(): running here, queued/processing in memory, or a fresh
resume manifest (the other instance's jobs during a handover). Manifests
pin a dir for at most ACTIVE_JOB_MAX_SECONDS (24 h).
- The age sweeps and both size caps skip active jobs and their sources.
- run_job_wrapper settles the reservation from the job record it started
with, so a vanished entry releases the minutes instead of holding them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The detail pass now returns a one-sentence `why` per clip (what makes this
moment a clip, not the topic), stored in the metadata and shown under the
title in the dashboard card: the score said how much, nothing said why.
Defaulted in the schema so a small local model that skips it keeps the clip.
After the word snap, clips overlapping an already-kept clip by half the
shorter one are dropped in favour of the higher predicted_score. The prompt's
DIVERSITY rule was the only thing preventing the same moment twice; in ~330
clips over 8 talks it never fired, so this is a guard, not a fix.
Each clip also keeps the model's raw `proposed` boundaries before the snap,
which is what made boundary accuracy measurable: p90 0.4-0.5 s from a word
on 8 talks (21-sep-2026), inside snap_clip_to_words' 1.5 s reach.
Two ideas borrowed from AutoClip were measured with a blind judge on the
same corpus and NOT adopted: quoting per-sentence timestamps in the detail
pass lost 24%/23% (p<0.001, two seeds — it shortens clips and drops the
payoff), and an "end on the reaction, not the line" rule was inert
(47%/53%, p=0.71).
The guard named the pages it knew (search, playlist, channel, @handle)
and let everything else through. A hashtag page and the legacy /<vanity>
channel URL are neither, so yt-dlp paginated the browse: on 20-sep-2026
one of them walked to page 23 on the static pool, the "Unable to
download API page" errors that produced read as an IP problem, and the
per-GB proxy was paid to walk the same pages again until YouTube
rate-limited it.
The set of pages that fan out is open-ended, so invert it: allow only
the paths that carry a video id (watch?v=, youtu.be/<id>, shorts, live,
embed, v, e, clip) and refuse the rest before any request. A
single-video shape we forgot costs the user one clear error message; a
browse we forgot costs a paginated crawl on three IPs plus the paid one.
Handed a path, the SDK copies os.path.basename(path) verbatim into the
X-Goog-Upload-File-Name header, and httpx encodes header values as ASCII.
The downloaded file is named after the video's title, so every source
titled in Japanese, Cyrillic, Arabic or Greek died with "'ascii' codec
can't encode characters in position 0-4" before a byte left the
container, on the three stages that upload the whole file: the
silent-footage vision pass, the screencast detector and the AI editor.
The user saw "the AI model did not return usable clips for this video".
gemini_worker.upload_media() passes an open handle instead, which skips
that header; the readable name still travels as display_name, in the
JSON body, which is UTF-8. An extension the stdlib cannot place falls
back to video/mp4 rather than reaching the API as octet-stream.
The test reproduces the failure through the SDK's own header building
and httpx, and fails if a new call site uses files.upload directly.
30 minutes after 60fa37a reached prod the uvicorn process held 5.1 GB of
VRAM again, with the release counter at zero: saasshorts.generate_tiktok_subs
transcribes in-process through its own call to transcribe_media, a third
path next to the thumbnail studio and the dubbed-subtitle one. Same
finally-release there, and release_models() now also drops the TransNetV2
singleton that the same in-process pipeline leaves in torch.
Three failures measured in prod on 17-sep-2026, one deploy.
1. 5 of 12 jobs failed with "ffmpeg could not cut clip ... exit 187, 0 bytes".
Exit 187 is AVERROR_EXIT after "h264_nvenc: Could not open encoder":
VRAM was full. The uvicorn process itself held 7.7 GB of the 20 GB card
while idle: the thumbnail studio and /api/subtitle on a dubbed clip
transcribe in-process, and the whisper (ctranslate2) and parakeet
(onnxruntime CUDA) singletons then lived in the API for good. Both call
transcribe_backends.release_models() now; the loaders fetch their model
inside the ASR gate so a release can never pull it from under a running
transcription.
2. 26 of the 37 probes that reached the per-GB proxy in 10 days were
`watch?v=X&list=...` or mix links. Neither the probe nor the download set
`noplaylist`, so yt-dlp walked the whole list, died on its first private /
age-gated / bot-checked entry (a video nobody pasted), the probe read it
as an IP problem and paid the proxy to walk the same list again, and the
user got a 400 for a valid link. Reproduced in the prod container: the
same URL with noplaylist answers in 9.6 s on a static. The probe also
keeps every attempt's error per route now, so the anonymous retry's
bot-check cannot overwrite a "confirm your age" from the cookie attempt
into an escalation.
3. noplaylist does nothing for a search or a bare playlist URL: one
`results?search_query=` held the probe thread for 2220 s in the container
and still failed. Search, playlist, channel and feed URLs are refused by
path before any request, with a message that says what to paste.
The minimal CI env has no stripe package, and the new test imported
cloud.billing, which does. The rule is a pure function of the subscription
state, so it now lives in cloud/config.py next to the state tuples it
belongs with, and billing.py imports it from there.
93 of the 99 quota walls sampled on 16-sep-2026 were shown to accounts with
their 20 free minutes untouched that had pasted a 21-90 min video: asked to
pay before seeing one clip, most left Stripe without paying.
The 402 now carries partial_minutes (the floored balance, at least
PARTIAL_MIN_MINUTES and shorter than the source). The wall shows 'clip the
first N min' next to the plans and resubmits with max_minutes; the server
reserves min(asked, balance) and sets MAX_SOURCE_MINUTES, and main.py cuts
the source in place before anything reads it, so every later stage and the
editor see a short video. The cut travels in the resume manifest so a
redeploy cannot re-run the whole video on a partial reservation. Status and
the results view say which part of the video the clips came from.
Stripe creates the subscription in 'incomplete' seconds after the Checkout
page opens, before the user types anything, and the 'New subscriber' alert
fired on that row. In the 30 days to 16-sep-2026, 41 of 68 subscriptions
expired unpaid that way (none a card decline) and each one sent an email.
The alert now fires only for active/trialing rows; an incomplete one that
later pays is announced by the 'Payment received' alert on invoice.paid.
The cut ran with its return code ignored and stderr captured into a pipe
nobody read, so a failed encode left an empty temp file that flowed on to
render_clip. The job's only visible error was "moov atom not found",
reported three layers downstream by ffmpeg, TransNetV2 and PySceneDetect in
turn, each naming the temp clip rather than the encode that never wrote it.
In prod on 9-sep-2026 that lost all three clips of a job and the cause was
unrecoverable, because the one process that knew it had been discarded.
cut_clip() now checks the return code AND the file size (ffmpeg has been
seen exiting 0 having written nothing), retries twice on the same encoder
after 3s and 9s, and otherwise raises with ffmpeg's own stderr so the job
error text names the real failure.
The retry deliberately stays on the GPU instead of falling back to libx264:
the failure is transient — the same command on the same source cut fine by
hand minutes later — and the nvenc probe is a 256x256 lavfi frame cached for
the life of the process, so it keeps saying yes while a real 1080p session
cannot allocate on a GPU other jobs are filling.
Claude-Session: https://claude.ai/code/session_01GdkAaRGLyARP5aSZaXXF19
With YOUTUBE_COOKIES attached, YouTube answers UNPLAYABLE for every client
(web_embedded, tv_downgraded, web AND mweb) on a share of videos, and yt-dlp
reports that as "Video unavailable". Measured in prod on 9-sep-2026 with
e_04ZrNroTo, same static IP minutes apart: cookies -> UNPLAYABLE on all three
statics; anonymous -> 1080p (137+140). The 6-sep default,mweb fix is no longer
enough on its own.
The download already recovers from this through its anonymous fallback-static
attempt. The probe carried the cookies on every route including the paid one,
so it read a cookie problem as an IP problem ("video unavailable" is in
_IP_SPECIFIC_HINTS) and escalated to DataImpulse, which fails identically with
the same cookies. That is what fired the two paid-proxy alerts that morning,
and a probe that dies outright 400s a video the download would have fetched.
Probe strategies are now (extractor_args, use_cookies): first attempt on a
route authenticated, second anonymous, mirroring the download. With no HD path
(self-host without a PO token provider) the fallback keeps the operator's
cookies, since it is then the only attempt.
Claude-Session: https://claude.ai/code/session_01Qfgs1gca8UeEEZ2pvjjC8i
The watcher fetched the YouTube watch page through each static IP with a
bare httpx client and no cookies. Anonymously, a datacenter IP making ~400
YouTube hits a day is rate-limited into "Sign in to confirm you're not a
bot", so playabilityStatus comes back LOGIN_REQUIRED and the watcher
declared the pool down. Those same IPs were serving every real download
fine, because a download carries YOUTUBE_COOKIES.
Measured in production on 8-sep-2026, all three statics, same minute:
anonymous (what the watcher did) -> LOGIN_REQUIRED
with the download's cookies -> OK
while proxy_usage showed 119 YouTube jobs routed to HD-static1 in the last
24 h with zero paid bytes. So the page that said "every download costs
money until the statics are back" fired while nothing was being spent, and
it re-nags every 2 h.
CLAUDE.md already recorded this shape for cloud/metering.probe_url_minutes
("The probe also carries YOUTUBE_COOKIES, like the download does"); the
watcher probe never got the same treatment. It does now, parsed once and
cached, and a blob that is not a Netscape cookie file is recognised before
the stdlib prints "http.cookiejar bug!" into the log every 30 minutes.
The paid probe stays anonymous on the cheap HTTP 204: it is billed per GB
and has no reason to carry a session.
The failure detail now names what YouTube actually said
(playabilityStatus: LOGIN_REQUIRED / UNPLAYABLE / ...) instead of blaming
the IP for every case. With cookies configured, LOGIN_REQUIRED means the
session expired and wants rotating, which is not the same problem as a
flagged address and should not read as one.
Claude-Session: https://claude.ai/code/session_01UZGqjYcZyfmKww1gcyKrp5
media_auth landed in 96f0139 with the allowlist and the capability tokens,
but nothing imported it: app.py still mounted /videos as a plain
StaticFiles over OUTPUT_DIR. The module was deployed as dead code and the
hole it was written to close stayed open.
Verified against production on 7-sep-2026, unauthenticated, with nothing
but a job id (which travels in every clip URL the dashboard builds):
/videos/<job>/.owner -> 200, a user uuid
/videos/<job>/<title>_metadata.json -> 200, the full transcript
/videos/<job>/<title>.mp4 -> 200, the untouched source
Wiring media_auth.is_servable into the mount closes the first two, plus
.resume.json (which carries the customer's own webhook_secret),
.transcript_checkpoint.json, .instance and the .layout.json sidecars. A
refused path 404s before touching the filesystem, so it is indistinguishable
from a missing one.
Safe for every consumer: the dashboard reads transcripts through the
authenticated /api/clip/{job}/{i}/transcript, never from /videos, and every
/videos URL the backend builds is a clip, preview (.mp4), scene thumbnail
(.jpg), actor upload (.png) or subtitle (.ass) — all allowlisted.
This is the path half only. The clips themselves and the source video in
the same directory are still public to anyone holding the job id; closing
that needs the capability tokens media_auth also provides, which means
request handlers, an /api/media-token endpoint and the dashboard appending
the token in getApiUrl. That ships with its frontend half, not here.
Claude-Session: https://claude.ai/code/session_01UZGqjYcZyfmKww1gcyKrp5
main.py's clip worker pool swallows a per-clip exception (it only prints
"Clip N failed") and the process still exits 0, and the metadata JSON is
written BEFORE any clip renders. app.py rebuilt the finished job's result
from that metadata and named every clip through _canonical_clip_file,
which returns a filename whether or not the file exists.
So a job whose renders ALL failed was reported as completed with N clips:
the minute reservation was committed, ClipsDelivered fired, archive_job
skipped every missing file and uploaded the metadata alone (returning
before it writes the Project row, so the job was neither restorable nor
visible in history), and the dashboard offered clips whose only existence
was a title. Hitting "download all" on one then answered 404 "No clip
files found for this job" - reported as ticket #4711, job 89d76bbc: two
titles, two viral scores, blank players, minutes gone.
Measured over the R2 archive on 7-sep-2026, this is not an edge case:
195 of 1687 archived jobs hold a metadata file and not one clip, across
184 users. On a 200-job sample since 1-aug, 14.6% of all promised clips
were never delivered while every one of those jobs was billed and
counted as a success.
_clips_actually_rendered keeps only the clips whose file is on disk and
non-empty, preferring main.py's own CLIP_READY marker (what the file IS)
over the name rebuilt from the convention (a guess). A job that rendered
nothing is now marked failed, so _settle_reservation releases the
minutes instead of committing them and the outcome is tracked as
JobFailed.
Claude-Session: https://claude.ai/code/session_01UZGqjYcZyfmKww1gcyKrp5
Some MCP hosts never speak HTTP to a server: they run it as a command and
talk over stdin/stdout. Glama's Dockerfile deployments wrap exactly that
(and a local self-host user can now skip the web server entirely), so the
directory could not introspect our tools at all — mcp.openshorts.app 401s
without a key, by design.
mcp_stdio.py is transport only: mcp_server keeps the protocol, and tool
calls go through the same call_tool -> ASGITransport path, so stdio and
HTTP cannot answer differently. Two things it has to get right, both
covered by the test: stdout is swapped for stderr before app is imported,
because the pipeline prints everywhere and one stray line corrupts the
JSON-RPC stream; and the app's lifespan is entered explicitly, which
ASGITransport does not do on its own.
glama.json declares the maintainer, one of the listing gaps the directory
reports.
Claude-Session: https://claude.ai/code/session_01PkWCDoMsdmSxGXXh4jqF1m
Reopening a project whose working files were gone (redeploy, hourly sweep)
fired the transcript requests, which pull the job back from R2 (~25 s for
2 GB), and the <video> loads at the same instant; /videos was a plain
StaticFiles mount, so every player got a 404 until the user reloaded
(job cff3ad6c, 6-sep-2026 00:37 UTC, 15 x 404).
- restoring_static.py: StaticFiles subclass that, on a miss, hands the job
id to a restorer and looks once more. Range/ETag/HEAD behaviour untouched.
- app.py: restore_project's core is now _restore_job_files (no auth, the
caller decides); the /videos restorer looks the Project up by job id and
restores for its owner. The files are public by job id already, so this
grants nothing new. A player arriving mid-restore waits on the per-job
lock instead of failing. The "Auto-restored" line is printed once, when
files were actually pulled, instead of once per waiting request.
Claude-Session: https://claude.ai/code/session_013ubPhpBw8kAUcLXCCfH4C5
With account cookies yt-dlp's authed defaults are tv_downgraded + web, and on
a share of videos both come back UNPLAYABLE / SABR-only, reported as "Video
unavailable" with no formats. That happened on every static IP too, so it was
mistaken for an IP ban and fed ~26 downloads a week to the per-GB proxy,
which then fetched 360p through the same dead client list. Measured in the
prod container on 6-sep-2026, same static proxy, same video: cookies +
defaults -> unavailable; cookies + default,mweb (+ PO token) -> 1080p; no
cookies -> 1080p.
- yt_clients.py: one client list (default,mweb + bgutil provider) shared by
the download and the duration probe. Never player_skip=webpage: it drops
the Data Sync ID and mweb loses its PO token (360p only).
- main.py: the fallback list (tv_embed, android) is gone from yt-dlp; the
fallback now runs anonymously when the cookie attempt already failed on
that route, and every attempt asks for the 1080p spec (the fallback's
best[ext=mp4] was itself the 360p progressive file).
- metering: an uploader's country block is a content error; the residential
pool failed identically in 5 of 6 paid probes (3-5 sep). The probe alert
now says when the paid proxy failed too.
Claude-Session: https://claude.ai/code/session_013ubPhpBw8kAUcLXCCfH4C5
Ten probes in one hour on 4-sep paid the per-GB proxy 1.8 MB each because
all three static IPs answered 'Sign in to confirm you are not a bot' to the
ANONYMOUS probe, while the same IPs served the cookie-authenticated
download of those very videos without a complaint: a datacenter IP's
anonymous rate limit is low and we make ~400 YouTube hits a day from three
of them. The probe now writes YOUTUBE_COOKIES to a temp file and passes it
as cookiefile, exactly as download_youtube_video does, and removes it in a
finally (the chain walk moved into _probe_with_proxies so that file has one
obvious lifetime).
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
Since the static IPs moved to three countries, every remaining paid rescue
had the same shape: all three statics answer 'Video unavailable' and the
paid fallback then downloads the video fine. Tested on the morning's case
(2eCIMQMy0AQ): the video is fine from a residential IP, the HD/web client
gets the fake unavailable on all three statics, and the conservative
clients (tv_embed/android) pass on those very same IPs. So it is the
client, not the IP, and the fix is free: try the fallback strategy through
a static before spending a per-GB byte. No quality trade: the paid path
was capped at 720p anyway.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
The browser's `Subscribed` event is an intent signal: it misses renewals,
is eaten by ad-blockers and never sees a refund. The Stripe webhook is the
only place money is known for certain, so every invoice.paid (new /
renewal / upgrade), one-off top-up and charge.refunded (negative) is now
mirrored as OpenPanel's native `revenue` event, keyed by the user uuid the
browser and the job events already use.
Each event carries the acquisition channel read back from
signup_attribution (utm_source > referrer host > direct) plus plan,
interval, billing_reason and the Stripe id — so revenue is sliceable by
where the buyer came from. Fire-and-forget: never touches the webhook path.
The dashboard now `identify`s the signed-in user on every boot (OpenPanel
keeps the profile in memory only) and clears it on sign-out, so pageviews
and the server-side events share one profile.
Also fixes GET /api/billing/invoices, which called the non-existent
`database.SessionLocal` and 500'd for every user with a Stripe customer.
Claude-Session: https://claude.ai/code/session_01GPZmS33ubmHxHEc84X7sQy
PAID_PROXY_DAILY_MB (default 500): past it, the per-GB proxy is dropped
from the duration probe and from every new job's env until UTC midnight,
with one Telegram note per day. A repeat of 28-aug (statics refused by
YouTube for hours) now costs $0.50 at worst instead of $14.
The watcher probed the statics against google.com/generate_204, which kept
answering 204 that whole day while YouTube served the static IPs fake
'Video unavailable'. A static now has to return a real watch page with a
playable player response; the paid probe keeps the cheap plain-HTTP 204
(HTTPS through DataImpulse breaks in httpx even when healthy).
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
Five videos 'unavailable' on all three static IPs on 1-sep downloaded fine
through the residential proxy (proxy_usage rows 19:33-07:07): YouTube
serves a fake unavailable to IPs it dislikes, the 19-aug symptom. Blocking
the paid retry on that text would 400 real videos; a truly dead link now
costs ~3 MB to re-check instead.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
DataImpulse showed ~0.2 $/day with the static pool healthy, and $14 on
28-aug that nothing on the server could explain: the monthly counter is
in-memory and the container log rotates within the hour. The panel's
per-host rows for 31-aug/1-sep pointed at two leaks.
The duration probe (cloud/metering.probe_url_minutes) walked every URL that
failed on the statics through the paid proxy with both extractors, ~1.7 MB
a time: private, removed and members-only videos, live streams with no
duration, and every non-YouTube URL (Twitch, Kick, Rumble, product pages,
drive links) that the download plan itself never sends there. It now
reaches the paid proxy only for a failure another IP can fix (bot-check,
403/429, proxy or network errors) and never for a non-YouTube URL.
main.py prints PROXY_ROUTE=<json> after every download: the winning
attempt, paid bytes summed over every attempt that used the per-GB proxy
(failed ones included; a paid attempt that died after three fragments was
billed for them), and each free attempt's error text. app.py persists it as
a proxy_usage row at job end and pages Telegram whenever the paid proxy
carried bytes, folding a burst into one message per 5 min; a probe that
reached the paid proxy is recorded the same way.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
First prod run of hook grounding on a product-update video: the layout
picker said screencast (0.95) but the render emitted only track/general
ranges, because the width gate did not upgrade the stats cards, so the
grounding never fired and every clip kept its topic-summary hook. A
GENERAL scene on a screencast video is a face-less full-screen slide or
dialog, not a group shot (checked frame by frame), so it now counts as
screen when screencast_layout is enabled for the job.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
The hook and title come from the detail pass, which only reads the
transcript, so a clip whose meaning is on the screen shipped with a topic
summary ("I automated my clips with AI") while the viewer watched an MCP
connector being configured.
Two halves. The detail prompt now carries the rule that hook and title name
the concrete thing happening inside the clip, never the video's topic. And
after the render, when the layout sidecar says at least 25% of a clip is
screencast / wide / inset, hook_grounding sends three frames from those
stretches at 1024px plus the clip's own words to Gemini and rewrites hook
and title in place before auto_hook_clip burns them; the originals stay
under hook_grounding.before. Gemini-only (frames): a local-LLM install logs
one line and keeps the transcript hook. HOOK_GROUNDING=0 disables it.
Verified live on the reported frame: on_screen "Configuración del conector
del servidor MCP de OpenShorts", hook "Configura el servidor MCP de
OpenShorts paso a paso", stable across three runs.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
Self-hosters asked for a pipeline that never calls Google. LLM_BASE_URL (+
LLM_MODEL, LLM_API_KEY) routes the transcript scoring and detail passes of
get_viral_clips to a /chat/completions endpoint; the answer is validated with
the same pydantic schemas Gemini enforces server-side, so main.py sees one
shape. json_schema is requested first and the request falls back to
json_object and then to free text when a server rejects the field.
Scoring batches drop from 8 to 3 windows on the local path: Ollama's default
4k context truncates silently and a truncated prompt scores garbage.
Self-host /api/process now accepts a request without X-Gemini-Key when the
backend is configured, /api/config exposes localLlm and the dashboard stops
demanding the key. Frame-based stages (layout picker, on-screen content,
silent videos) stay on Gemini and degrade as before without a key; the
silent-video path says so instead of failing generically.
Verified end to end with Ollama 0.13.5 + qwen2.5:7b on an M1 Pro: a 15-min
talk, 14 windows, 6 clips with usable hooks and titles, six local calls and
zero requests to Google.
Claude-Session: https://claude.ai/code/session_014i9z6mLTy978uRCfSsMfBq
/api/source-url skipped the ownership check when the job record did not
resolve, and then signed anyway. That made it the one door in the design that
hands out a working capability without asking who is asking, which is precisely
what locking down /api/source was for.
Narrow in practice: a real job resolves, from its metadata or from the manifest
that names its owner while it runs, so the uncovered case is a directory in a
half-written state. It also still takes guessing a UUID, so this was never
worse than the behaviour it replaced. It is fixed because "a hole with a rare
precondition" is still a hole.
Off billing it keeps answering, since there is no owner to check and the
self-host preview would otherwise break for nothing.
The test stubs the minter so that reopening the hole fails on the status
assertion rather than on _cloud_config being None off billing: a test that
passes only because the code under it happens to crash stops guarding the day
it stops crashing. Verified by reopening the hole and reading the failure.
Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
GET /api/source streams the file we downloaded, not a derived clip, and it was
open on the reasoning that the UUID job id is the capability. That makes the
product a public YouTube downloader wearing a UUID, which is the characterisation
worth avoiding, and one leaked id in a log or a referer opens someone else's
video.
A <video src> cannot carry an Authorization header, which is why it was open in
the first place, so the owner mints a short-lived signed URL from
/api/source-url and hands the player that. The endpoint takes the signature or
falls back to the owner check. Self-host and ownerless BYOK jobs are untouched:
no owner to check, no secret to sign with. The owner lookup is gated on
BILLING_ENABLED because it falls through to a full rescan of the output
directory, which off billing would run on every preview and buy nothing.
Both minters go through _signed_source_url. The EDL feeds ClipEditor's source
monitor the same way and was built as a bare path, which works in self-host and
in every test and 404s in cloud. The regression test asserts the endpoint calls
the minter rather than comparing strings: off billing the helper returns that
same bare path, so a string comparison passes just as happily with the bug in.
Verified by putting the bug back and watching it fail.
The frontend mints at render, not when the session is persisted, or localStorage
would hold a token that expired overnight.
SOURCE_RETENTION_SECONDS can age the retained download out ahead of the clips it
produced, and defaults to the job clock, so nothing changes until someone sets
it. Lowering it is not free: the EDL, rerender, scenes and reframe endpoints all
read that file and answer 409 once it is gone.
Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
Art. 50(2) asks a provider whose system generates synthetic audio or video to
mark the output in a machine-readable way, and the terms already promised we
"label and mark" dubbed clips while nothing did either.
mark_ai_generated stamps the disclosure by stream copy, so it is a remux and
never a re-encode. The tag is `comment` because mp4 keeps only the standard
tags and ffmpeg drops a custom key without warning, which a test pins. It is
best effort by design: a missing tag must not lose someone the video they just
paid minutes for.
Deliberately narrow, on dubbing and AI actors, not on an ordinary clip whose
pixels and audio are the user's own footage. Marking everything would make the
tag mean nothing. TranslateModal says the file is tagged and that the person
publishing it owes their audience the disclosure, which is the art. 50(4) duty
and falls on them, not on us.
Still missing, and a product decision rather than an oversight: the visible
burned-in label.
Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
5807217 made a route miss two probes before paging and re-worded the
alerts by impact, but only added tests for the new behaviour — the older
file still asserted the old contract and CI has been red since.
A single tick no longer opens an incident, so the specs now tick
`_PROXY_STRIKES` times; the statics-down alert says "down" rather than
"DOWN" because with the paid proxy still answering it is a cost warning,
not an outage; and the nag repeats the headline with the elapsed hours
instead of "STILL down".
The fixture also cleared every piece of watcher state except the strike
counter that commit introduced, which leaked between tests.
Claude-Session: https://claude.ai/code/session_01AzDnEa5EREFyibXEwsRCW9
The detail pass returns its clips in transcript order, batch after batch, and
the overflow was cut with shorts[:max_clips] — which keeps the EARLIEST clips
and drops the tail. On a 9m19s walkthrough, three runs of the same source put
every surviving clip inside the first 2m40s, 4m39s and 8m55s respectively; the
demo, the MCP walkthrough and the close were simply the part of the list that
fell off the end. The failure scales the wrong way, too: the more clips the
model proposes, the more of the video disappears (output tokens 2067 -> 8m55s
of coverage, 3407 -> 2m40s).
It also undoes the windowing. get_viral_clips builds scoring windows precisely
because "a single call over the whole transcript clusters picks near the
start", and a positional slice puts that clustering straight back. Pass 1
already sorts by score before its own cut; pass 2 just never did.
trim_to_best ranks by predicted_score, which the detail prompt has always
asked for and nothing here was reading, and returns the survivors in
transcript order so clip numbering still runs front to back.
Claude-Session: https://claude.ai/code/session_01KeQYCfUX2E9Q2fDgZMKEaJ
The scene classifier sends every face-less shot to GENERAL, and GENERAL scales
the content to 42% of the frame height. That ratio buys presence on a LANDSCAPE
source by overflowing the sides; on a 1080x1920 upload the same number is a
shrink, leaving a 453px sliver floating over a blurred copy of itself. A user's
already-vertical video came back with its screen-recording scenes rendered that
way while its talking-head scenes (TRACK, whose crop is the whole frame) looked
right, so a single clip alternated between correct and ruined.
source_already_fits() gates the whole thing: a source at or past the target
aspect has no width to buy back, so the classifier, the SPLIT detection and the
screencast/inset upgrades are all skipped and every scene renders TRACK. The
layout picker is skipped too, saving a Gemini call per upload that the render
would have ignored anyway.
general_filtergraph() additionally floors the foreground at the height where the
source fills the output width, so the editor's explicit GENERAL override on a
portrait clip cannot reproduce the shrink. A 16:9 source keeps the 0.42 ratio
untouched.
Two siblings of the same bug, both only reachable on a source TALLER than the
target: the TRACK crop pinned y=0 and threw away the bottom of the frame instead
of trimming both ends, and v1's create_general_frame indexed the output with a
negative offset, which raises rather than renders.
Claude-Session: https://claude.ai/code/session_01KeQYCfUX2E9Q2fDgZMKEaJ
'paid proxy DOWN: YouTube-URL jobs will keep failing' fired on a single
ReadTimeout while the three static proxies were fine, and read as an
outage. Severity now follows the actual impact: fallback down with the
statics up is informational (no impact), statics down is a cost warning
(jobs run on the per-GB proxy), both down is the red one. A route has to
miss two probes 30 min apart before anyone is paged.
The dashboard burns the AI hook line by default; API/MCP callers never
could because the field is off when absent. Exposed as an explicit opt-in
so existing integrations keep their output byte-for-byte.
PROHIBITED_CONTENT fired on the scoring batch of a plain software
walkthrough: windows 5+6 together blocked 3/3 on lite, 3.7-flash and
2.5-flash, each alone passed, and a neutral prompt over the same text
passed. The filter reacts to combinations, so it cannot be predicted or
sanitized. Both selection passes now run through _run_stage_split: on a
block the batch is halved until the combination is isolated, and only a
window that blocks on its own is dropped. The affected job now yields 2
clips instead of dying.
The ISP/paid proxies exist to dodge YouTube's ban on the server IP. A
direct mp4 (catbox, tmpfiles, a CDN, an R2 link) has nothing to dodge and
crawled at ~9 KB/s through the static proxy (6 MB in 11 min on 27-aug)
while the server's own IP pulls 17 MB/s. Non-YouTube hosts now download
direct, with one static proxy as the only fallback and never the per-GB
one.