feat: Add DISABLE_YOUTUBE_URL flag and reframe marketing copy

- New env var DISABLE_YOUTUBE_URL gates URL ingest in /api/process (403)
- /api/config exposes the flag so MediaInput can hide the YouTube tab
- Landing.jsx and index.html (meta + JSON-LD) reworded around
  "your long-form videos" instead of marketing YouTube downloads,
  reducing inducement exposure on the public deployment

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
juancarlos.cavero 2026-05-06 11:51:08 +02:00
parent edd42b4de9
commit 3f4c814e22
4 changed files with 54 additions and 30 deletions

8
app.py
View file

@ -30,6 +30,7 @@ os.makedirs(OUTPUT_DIR, exist_ok=True)
MAX_CONCURRENT_JOBS = int(os.environ.get("MAX_CONCURRENT_JOBS", "5"))
MAX_FILE_SIZE_MB = 2048 # 2GB limit
JOB_RETENTION_SECONDS = 3600 # 1 hour retention
DISABLE_YOUTUBE_URL = os.environ.get("DISABLE_YOUTUBE_URL", "false").lower() in ("1", "true", "yes")
# Application State
job_queue = asyncio.Queue()
@ -308,6 +309,10 @@ async def run_job(job_id, job_data):
jobs[job_id]['status'] = 'failed'
jobs[job_id]['logs'].append(f"Execution error: {str(e)}")
@app.get("/api/config")
async def get_config():
return {"youtubeUrlEnabled": not DISABLE_YOUTUBE_URL}
@app.post("/api/process")
async def process_endpoint(
request: Request,
@ -327,6 +332,9 @@ async def process_endpoint(
if not url and not file:
raise HTTPException(status_code=400, detail="Must provide URL or File")
if url and DISABLE_YOUTUBE_URL:
raise HTTPException(status_code=403, detail="YouTube URL ingest is disabled on this deployment. Please upload a file you own.")
job_id = str(uuid.uuid4())
job_output_dir = os.path.join(OUTPUT_DIR, job_id)
os.makedirs(job_output_dir, exist_ok=True)

View file

@ -8,9 +8,9 @@
<!-- Primary SEO Meta Tags -->
<title>OpenShorts - Free Open Source Clip Generator & AI UGC Video Creator | TikTok, Reels & Shorts</title>
<meta name="description" content="Free open source clip generator & AI UGC video creator. Turn YouTube videos into viral shorts or generate marketing videos with AI actors for any business. From $0.65/video." />
<meta name="description" content="Free open source clip generator & AI UGC video creator. Turn your long-form videos into viral shorts or generate marketing videos with AI actors for any business. From $0.65/video." />
<meta name="keywords"
content="free clip generator, open source clip generator, AI clip generator, free video clip generator, AI video clipping tool, YouTube to TikTok converter, AI short video generator, vertical video maker, open source video editor, YouTube Shorts maker, Instagram Reels creator, video repurposing tool, AI viral moment detection, auto subtitle generator, AI voice dubbing, Opus Clip alternative free, free YouTube thumbnail generator, AI YouTube title generator, free YouTube description generator" />
content="free clip generator, open source clip generator, AI clip generator, free video clip generator, AI video clipping tool, AI short video generator, vertical video maker, open source video editor, YouTube Shorts maker, Instagram Reels creator, video repurposing tool, AI viral moment detection, auto subtitle generator, AI voice dubbing, Opus Clip alternative free, free YouTube thumbnail generator, AI YouTube title generator, free YouTube description generator" />
<meta name="author" content="OpenShorts" />
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
<link rel="canonical" href="https://openshorts.app" />
@ -45,7 +45,7 @@
{
"@type": "WebPage",
"name": "OpenShorts - Free Open Source Clip Generator",
"description": "Free open source clip generator that turns long YouTube videos into viral TikTok, Instagram Reels & YouTube Shorts automatically with AI-powered viral moment detection, smart cropping, and a free AI YouTube thumbnail studio.",
"description": "Free open source clip generator that turns your long-form videos into viral TikTok, Instagram Reels & YouTube Shorts automatically with AI-powered viral moment detection, smart cropping, and a free AI YouTube thumbnail studio.",
"url": "https://openshorts.app",
"datePublished": "2024-06-01",
"dateModified": "2026-03-20",
@ -59,7 +59,7 @@
"@type": "SoftwareApplication",
"name": "OpenShorts",
"alternateName": "OpenShorts Free Clip Generator",
"description": "Free open source AI clip generator. Transforms long YouTube videos into viral-ready short clips for TikTok, Instagram Reels, and YouTube Shorts using Google Gemini AI. Includes free AI YouTube thumbnail generator, title suggestions, description writer, and direct YouTube publishing.",
"description": "Free open source AI clip generator. Transforms your long-form videos into viral-ready short clips for TikTok, Instagram Reels, and YouTube Shorts using Google Gemini AI. Includes free AI YouTube thumbnail generator, title suggestions, description writer, and direct YouTube publishing.",
"applicationCategory": "MultimediaApplication",
"operatingSystem": "Cross-platform (Docker)",
"url": "https://openshorts.app",
@ -73,7 +73,7 @@
"Smart 9:16 vertical cropping with face tracking",
"Automatic subtitle generation with word-level timestamps",
"AI voice dubbing in 30+ languages via ElevenLabs",
"YouTube download and local file upload support",
"Local video file upload support",
"Hook text overlays with styled fonts",
"AI-generated video effects via FFmpeg",
"Direct social media posting",
@ -108,7 +108,7 @@
"name": "What is OpenShorts?",
"acceptedAnswer": {
"@type": "Answer",
"text": "OpenShorts is a free, open source AI clip generator that automatically transforms long YouTube videos or local uploads into viral-ready short clips (9:16 vertical format) for TikTok, Instagram Reels, and YouTube Shorts. It uses Google Gemini 3.0 Flash AI to detect the most engaging viral moments, then applies smart cropping with MediaPipe face tracking, automatic subtitles via faster-whisper, and optional AI voice dubbing in over 30 languages via ElevenLabs. According to HubSpot's 2025 State of Marketing report, short-form video delivers the highest ROI of any content format."
"text": "OpenShorts is a free, open source AI clip generator that automatically transforms your long-form videos — podcasts, webinars, livestreams, vlogs, interviews — into viral-ready short clips (9:16 vertical format) for TikTok, Instagram Reels, and YouTube Shorts. It uses Google Gemini 3.0 Flash AI to detect the most engaging viral moments, then applies smart cropping with MediaPipe face tracking, automatic subtitles via faster-whisper, and optional AI voice dubbing in over 30 languages via ElevenLabs. According to HubSpot's 2025 State of Marketing report, short-form video delivers the highest ROI of any content format."
}
},
{

View file

@ -91,8 +91,8 @@ export default function Landing({ onLaunchApp }) {
},
{
icon: Upload,
title: "YouTube URL or Local Upload",
description: "Paste any YouTube URL or upload a local video file. yt-dlp handles downloads at maximum quality while preserving original resolution and audio."
title: "Local Video Upload",
description: "Upload your long-form videos — podcasts, webinars, livestreams, vlogs — at full original resolution and audio quality. Process content you own or have rights to."
},
{
icon: Shield,
@ -122,7 +122,7 @@ export default function Landing({ onLaunchApp }) {
];
const steps = [
{ title: "Paste a YouTube URL or Upload a Video", description: "Drop any YouTube link or upload a local video file. OpenShorts supports all common formats and resolutions." },
{ title: "Upload a Long-Form Video", description: "Drop any video file you own — podcasts, webinars, livestreams, interviews. OpenShorts supports all common formats and resolutions." },
{ title: "AI Detects the Best Viral Moments", description: "Google Gemini 3.0 Flash transcribes, analyzes scene boundaries, and identifies 3-15 high-potential clips of 15-60 seconds each." },
{ title: "Smart Cropping to Vertical 9:16", description: "AI reframes each clip to vertical format with face tracking. Subjects stay centered with stabilized camera movement — no manual positioning." },
{ title: "Add Subtitles, Hooks & Effects", description: "Auto-generate styled subtitles, add hook text overlays, and apply AI video effects. Optionally dub into 30+ languages." },
@ -132,7 +132,7 @@ export default function Landing({ onLaunchApp }) {
const faqs = [
{
question: "What is OpenShorts and how does it work?",
answer: "OpenShorts is a free, open source AI clip generator that transforms long YouTube videos or local uploads into viral-ready short clips in 9:16 vertical format. It uses a multi-step AI pipeline: faster-whisper for transcription with word-level timestamps, PySceneDetect for scene boundary detection, and Google Gemini 3.0 Flash AI for identifying the most engaging viral moments. According to HubSpot's 2025 State of Marketing report, short-form video delivers the highest ROI of any content format, and repurposing long-form content into shorts increases total reach by up to 300%."
answer: "OpenShorts is a free, open source AI clip generator that transforms your long-form videos — podcasts, webinars, livestreams, vlogs, interviews — into viral-ready short clips in 9:16 vertical format. It uses a multi-step AI pipeline: faster-whisper for transcription with word-level timestamps, PySceneDetect for scene boundary detection, and Google Gemini 3.0 Flash AI for identifying the most engaging viral moments. According to HubSpot's 2025 State of Marketing report, short-form video delivers the highest ROI of any content format, and repurposing long-form content into shorts increases total reach by up to 300%."
},
{
question: "Is OpenShorts really free? What's the catch?",
@ -143,8 +143,8 @@ export default function Landing({ onLaunchApp }) {
answer: "OpenShorts is a free, self-hosted alternative to Opus Clip. Both offer AI viral moment detection and smart vertical cropping. Key differences: OpenShorts is completely free vs Opus Clip's $15-228/month pricing. OpenShorts runs on your infrastructure (full data privacy) vs cloud-only. OpenShorts uses Google Gemini 3.0 Flash for AI analysis vs Opus Clip's proprietary model. OpenShorts adds AI voice dubbing in 30+ languages, AI-generated video effects, and hook text overlays. The trade-off is that OpenShorts requires Docker self-hosting, while Opus Clip is a ready-to-use cloud service."
},
{
question: "How do I convert a YouTube video to TikTok or Reels?",
answer: "Simply paste the YouTube URL into OpenShorts, enter your free Gemini API key, and click Process. The AI automatically downloads the video via yt-dlp, transcribes it with faster-whisper, detects the best viral moments using Google Gemini 3.0 Flash, and crops them to 9:16 vertical format with MediaPipe face tracking. According to Wyzowl's 2025 Video Marketing Statistics report, 91% of businesses use video as a marketing tool, and repurposed short-form clips drive 2.5x more engagement than original content."
question: "How do I turn a long-form video into TikTok or Reels clips?",
answer: "Upload your long-form video into OpenShorts, enter your free Gemini API key, and click Process. The AI transcribes it with faster-whisper, detects the best viral moments using Google Gemini 3.0 Flash, and crops them to 9:16 vertical format with MediaPipe face tracking. According to Wyzowl's 2025 Video Marketing Statistics report, 91% of businesses use video as a marketing tool, and repurposed short-form clips drive 2.5x more engagement than original content."
},
{
question: "What AI does OpenShorts use for viral moment detection?",
@ -237,7 +237,7 @@ export default function Landing({ onLaunchApp }) {
</h1>
<p className="hero-description text-lg md:text-xl text-zinc-400 max-w-3xl mx-auto mb-10 leading-relaxed">
Three tools in one. <strong className="text-white">Clip Generator:</strong> turn long YouTube videos into viral shorts with AI moment detection, smart 9:16 crop, and auto subtitles. <strong className="text-white">AI Shorts:</strong> generate UGC marketing videos with AI actors and lip-sync for any business. <strong className="text-white">YouTube Studio:</strong> free AI thumbnail generator, 10 viral title suggestions with refinement chat, and auto descriptions with chapters. Self-hosted, open source, no limits.
Three tools in one. <strong className="text-white">Clip Generator:</strong> turn your long-form videos into viral shorts with AI moment detection, smart 9:16 crop, and auto subtitles. <strong className="text-white">AI Shorts:</strong> generate UGC marketing videos with AI actors and lip-sync for any business. <strong className="text-white">YouTube Studio:</strong> free AI thumbnail generator, 10 viral title suggestions with refinement chat, and auto descriptions with chapters. Self-hosted, open source, no limits.
</p>
<div className="flex flex-col sm:flex-row items-center justify-center gap-4 mb-12">
@ -314,7 +314,7 @@ export default function Landing({ onLaunchApp }) {
<div className="absolute top-0 right-0 w-32 h-32 bg-primary/5 rounded-full -translate-y-1/2 translate-x-1/2" />
<Scissors size={28} className="text-primary mb-4" />
<h3 className="text-xl font-bold text-white mb-2">Clip Generator</h3>
<p className="text-zinc-400 text-sm leading-relaxed mb-4">Turn long YouTube videos or local uploads into viral-ready 9:16 shorts. AI detects the best moments, crops to vertical with face tracking, and adds subtitles automatically.</p>
<p className="text-zinc-400 text-sm leading-relaxed mb-4">Turn your long-form videos into viral-ready 9:16 shorts. AI detects the best moments, crops to vertical with face tracking, and adds subtitles automatically.</p>
<ul className="space-y-1.5">
{['AI viral moment detection', 'Smart face-tracking crop', 'Auto subtitles + hook overlays', 'AI dubbing in 30+ languages'].map((f, i) => (
<li key={i} className="flex items-center gap-2 text-xs text-zinc-400"><Check size={12} className="text-green-400 shrink-0" />{f}</li>
@ -426,7 +426,7 @@ export default function Landing({ onLaunchApp }) {
<div className="max-w-4xl mx-auto">
<div className="text-center mb-14">
<h2 className="text-3xl md:text-4xl font-bold mb-4">How It Works</h2>
<p className="text-zinc-400 max-w-2xl mx-auto">From a YouTube URL to viral-ready clips in 5 automated steps. The entire pipeline runs on your machine with AI doing the heavy lifting.</p>
<p className="text-zinc-400 max-w-2xl mx-auto">From a long-form video to viral-ready clips in 5 automated steps. The entire pipeline runs on your machine with AI doing the heavy lifting.</p>
</div>
<div className="space-y-8">
{steps.map((step, i) => (
@ -515,8 +515,8 @@ export default function Landing({ onLaunchApp }) {
<div className="grid md:grid-cols-3 gap-5">
{[
{
title: "YouTubers & Content Creators",
description: "Repurpose your long YouTube videos into TikTok and Reels clips automatically. According to YouTube's Creator Insider data, channels that post Shorts alongside long-form videos see 20-30% more subscriber growth.",
title: "Content Creators",
description: "Repurpose your long-form videos into TikTok and Reels clips automatically. According to YouTube's Creator Insider data, channels that post Shorts alongside long-form videos see 20-30% more subscriber growth.",
icon: Youtube
},
{

View file

@ -1,11 +1,25 @@
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import { Youtube, Upload, FileVideo, X } from 'lucide-react';
import { getApiUrl } from '../config';
export default function MediaInput({ onProcess, isProcessing }) {
const [youtubeUrlEnabled, setYoutubeUrlEnabled] = useState(true);
const [mode, setMode] = useState('url'); // 'url' | 'file'
const [url, setUrl] = useState('');
const [file, setFile] = useState(null);
useEffect(() => {
fetch(getApiUrl('/api/config'))
.then((r) => r.ok ? r.json() : null)
.then((cfg) => {
if (cfg && cfg.youtubeUrlEnabled === false) {
setYoutubeUrlEnabled(false);
setMode('file');
}
})
.catch(() => {});
}, []);
const handleSubmit = (e) => {
e.preventDefault();
if (mode === 'url' && url) {
@ -26,6 +40,7 @@ export default function MediaInput({ onProcess, isProcessing }) {
return (
<div className="bg-surface border border-white/5 rounded-2xl p-6 animate-[fadeIn_0.6s_ease-out]">
<div className="flex gap-4 mb-6 border-b border-white/5 pb-4">
{youtubeUrlEnabled && (
<button
onClick={() => setMode('url')}
className={`flex items-center gap-2 pb-2 px-2 transition-all ${mode === 'url'
@ -36,6 +51,7 @@ export default function MediaInput({ onProcess, isProcessing }) {
<Youtube size={18} />
YouTube URL
</button>
)}
<button
onClick={() => setMode('file')}
className={`flex items-center gap-2 pb-2 px-2 transition-all ${mode === 'file'