6 Things I Learned Building a Free Video Downloader with Angular SSR, yt-dlp and FFmpeg
For the past several months I've been building Clipzy. It's a free tool that downloads TikTok, YouTube, Instagram, Facebook and Pinterest videos. It also has an AI Shorts maker and caption and hashtag generators.
The stack:
- Frontend: Angular 17 (standalone components) with SSR through
@angular/ssrand Express. It's an installable PWA with@angular/service-worker, andngx-translatehandles 10 languages. - Backend: Node and TypeScript, with
yt-dlpfor fetching media,ffmpegfor processing, and an LLM (served by Groq) for captions and hashtags.
Below are the lessons that cost me the most time. I hope they save you some.
1. If the product depends on SEO, server-side rendering is required
A downloader tool lives or dies on search traffic. People type "tiktok downloader no watermark" into Google, not your brand name. Before I added server-side rendering (SSR), crawlers got an empty <app-root>.
Each route now carries its own SEO data in the router config:
{ path: 'ai-caption-generator', loadComponent: () => import('./pages/ai-caption-generator/ai-caption-generator.component') .then(m => m.AiCaptionGeneratorComponent), data: { seo: { title: "'AI Caption Generator for TikTok, Instagram & Shorts (Free) | Clipzy'," description: "'Describe your post or paste a video link...'," canonicalPath: '/ai-caption-generator', } satisfies SeoData, }, }, A small SeoService listens to router events and writes the title, meta tags, canonical URL and Open Graph tags. SSR sends all of that in the first HTML response.
satisfies SeoData type-checks the object without widening it, so a missing description fails at compile time instead of in Search Console.
2. Return real HTTP status codes from SSR
By default, a client-side "not found" page still returns 200 OK. Google calls these "soft 404s", and they hurt your crawl budget.
The fix is to inject the Express Response into the Angular app with a token:
// server.ts providers: [ { provide: SERVER_RESPONSE, useValue: res }, ] Then NotFoundComponent calls res.status(404) when it renders on the server.
I used the same idea for 301 redirects when I merged duplicate blog posts. That runs as Express middleware before static files and SSR, so Google sees a real 301 and passes ranking signals to the new URL:
server.use((req, res, next) => { const path = req.path.length > 1 ? req.path.replace(/\/+$/, '') : req.path; const target = BLOG_REDIRECTS[path]; if (target) return res.redirect(301, target); next(); }); 3. Don't let your CDN cache ngsw.json
I set static assets to maxAge: '1y', which is great for hashed bundles. The problem was that the Angular service worker checks for updates by downloading ngsw.json again. Once that file was cached for a year, users never got new versions.
server.get('*.*', express.static(browserDistFolder, { maxAge: '1y', setHeaders: (res, filePath) => { if (filePath.endsWith('ngsw.json') || filePath.endsWith('ngsw-worker.js')) { res.setHeader('Cache-Control', 'no-cache'); } }, })); Also exclude your API and download routes from navigationUrls in ngsw-config.json. Otherwise the service worker answers /download/... with index.html:
"navigationUrls": ["/**", "!/**/*.*", "!/api/**", "!/download/**", "!/ai/**"] 4. Generate the sitemap from the same data as the blog
I kept forgetting to add new posts to sitemap.xml. Now a prebuild script uses esbuild to bundle blog.data.ts (the same file the Angular blog reads), imports it in Node, and writes the sitemap with lastmod dates:
const result = await esbuild.build({ entryPoints: ['src/app/data/blog.data.ts'], bundle: true, write: false, format: 'esm', platform: 'node', }); // write to a temp .mjs, dynamic import() it, then build the <urlset> There's one source of truth and no manual sitemap edits.
5. A TikTok "video" might be a photo slideshow
TikTok photo posts (carousels) have no video file. People still want an MP4. The backend:
- Downloads each photo (and skips any that fail instead of failing the whole job)
- Fetches the post's music, and checks that the file really has an audio stream
- Uses
ffmpegto show each photo for an equal share of the music's length - Falls back to a silent slideshow if no music is available
Lesson: degrade gracefully at every step. A slideshow missing one photo is still a success for the user. A 500 error is not.
6. Small LLMs break JSON, so plan for it
The caption and hashtag generators ask a fast, cheap model for structured JSON. Small models sometimes return broken JSON, and the API sometimes answers with 429 or 5xx errors under load. What helped:
- JSON mode (
response_format: { type: 'json_object' }) plus a system prompt that says "valid JSON only, no markdown, no explanation" - A strict prompt that spells out the output rules ("every hashtag starts with
#, no spaces, no spam tags like#follow4follow") - Retry once. Both kinds of failure almost always pass on the second try, so one retry before showing an error fixed most of what users were seeing:
export async function generateCaptions(input: CaptionRequest) { try { return await generateCaptionsOnce(input); } catch (err) { logger.warn('[ai] Caption attempt failed, retrying once'); return generateCaptionsOnce(input); } } - Clean up the output anyway (for example, I remove em dashes the model adds even when told not to).
What's next
I'm working on the AI Shorts maker. It turns one long video (a podcast, a stream) into up to 8 vertical 9:16 clips with captions. It's free while in beta, with no watermark and no login.
If you've built something similar, I'd like to hear how you handled yt-dlp breaking every time a platform changes its site. 😅
Try it here: clipzy.video. Feedback, especially harsh feedback, is welcome in the comments.