Free, open-source video & audio downloader for 1000+ platforms.
Download YouTube, TikTok, Instagram, Twitter/X, Reddit, and more β in 4K, HD, or MP3.
Zero tracking. Zero storage. Direct CDN streams.
mp4yt.com is a high-performance, open-source web application that lets you download videos and extract audio (MP3) from 1000+ social platforms β including YouTube, TikTok, Instagram, Twitter/X, Reddit, Soundcloud, Twitch, Vimeo, Pinterest, LinkedIn, Dailymotion, and many more.
Built with Astro v6, Tailwind CSS v4, and a blazing-fast Cloudflare Workers edge backend, the platform delivers direct, safe, and lightning-fast media streams from CDNs straight to your device β with zero intermediate storage and zero user tracking.
| Feature | Description |
|---|---|
| π 1000+ Supported Sites | YouTube, TikTok (no watermark), Instagram Reels, Twitter/X, Reddit, Twitch Clips, Soundcloud, Vimeo, Pinterest, LinkedIn, Dailymotion, Facebook, and hundreds more. |
| β‘ Multi-Instance Failover | Dynamically routes across 8+ Cobalt downloader instances. If one goes down, the next picks up automatically β near 100% uptime. |
| π₯ 144p β 4K + MP3 | Offers downloads from 144p, 240p, 360p, 480p, 720p, 1080p, 1440p (2K), 2160p (4K), plus high-fidelity MP3 audio extraction. |
| π‘οΈ CORS-Bypassing Proxy | Edge-proxied /download-stream endpoint handles CORS and injects Content-Disposition headers so files download directly β works on iPhone, Android, and PC. |
| π€ Smart SEO / Link Previews | /watch endpoint detects 30+ bots (Twitterbot, Discordbot, Googlebot, TelegramBot, etc.) and serves dynamic OpenGraph + Twitter Card metadata with real thumbnails and titles. Human visitors get seamlessly redirected. |
| π Keep-Alive Cron | A serverless Cron Trigger pings all Cobalt endpoints every 5 minutes to keep backend services warm and monitor latency. |
| π Premium UI | Vercel-inspired design β dark/light theme with FOUC prevention, glassmorphic cards, smooth micro-animations, monospaced tech accents, and fluid responsive typography. |
| π± PWA Support | Offline caching, app manifest, and Service Worker (sw.js) β installable on Android, iOS, and Desktop. |
| π Google Analytics | Integrated GA4 tracking (G-LNH5RT5R2G) for traffic insights. |
| π SEO Optimized | Dedicated landing pages for each platform, JSON-LD structured data, sitemap.xml, robots.txt, and keyword-rich meta tags. |
| YouTube | TikTok | Twitter / X | |||
| Twitch | Soundcloud | Vimeo | Dailymotion | ||
| ...and 1000+ more via the Cobalt extraction engine | |||||
Each major platform has a dedicated SEO landing page (e.g., /tiktok, /instagram, /twitter) optimized for search engine rankings.
The application cleanly separates concerns between a static Astro frontend and a high-performance Cloudflare Workers edge backend.
graph TD
User["π€ User / Browser"] -->|Page Views| CF["βοΈ Cloudflare CDN & Edge"]
Crawler["π€ Bot / Crawler"] -->|Shared Link /watch?url=...| CF
CF -->|Static Assets| Assets["π¦ Astro Build Output ./dist"]
CF -->|Dynamic API| Worker["β‘ Cloudflare Worker worker.js"]
Worker -->|/api/extract| Failover["π Multi-Instance Failover"]
Worker -->|/download-stream| Stream["π₯ Stream from Upstream CDN"]
Worker -->|/watch bot path| SEO["π·οΈ Dynamic OpenGraph SSR"]
Failover -->|Primary| Primary["π’ Self-Hosted Cobalt"]
Failover -->|Fallback 1β7| Community["π΅ Community Cobalt Instances"]
- User pastes a URL β The frontend sends a
GET /api/extract?url=...request to the Worker. - Worker tries Cobalt instances β Starting with the primary self-hosted instance, falling back across 7+ community servers until one succeeds.
- Parallel quality extraction β All quality variants (144pβ4K + MP3) are fetched concurrently for maximum speed.
- Metadata scraping β The Worker simultaneously scrapes the source page for title, thumbnail, and description.
- User picks a format β The frontend displays available formats; user clicks download.
- Edge-proxied stream β
/download-streamproxies the CDN stream through Cloudflare, injecting proper headers for direct file download on any device.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend Framework | Astro v6 | Static Site Generation (SSG) β pre-compiled, zero-JS-by-default pages |
| Styling | Tailwind CSS v4 | Utility-first CSS with fluid responsive design |
| Edge Backend | Cloudflare Workers | Serverless API routing, proxy streaming, SEO bot handling |
| Download Engine | Cobalt | Open-source media extraction from 1000+ platforms |
| Deployment | Wrangler CLI | Build, upload assets, deploy Worker + Cron Triggers |
| Analytics | Google Analytics 4 | Traffic and user engagement tracking |
| PWA | Service Worker + Web Manifest | Offline support and installability |
mp4yt/
βββ public/ # Static assets served directly
β βββ favicon.svg # SVG favicon
β βββ favicon.ico # ICO fallback
β βββ favicon-96x96.png # PNG favicon
β βββ apple-touch-icon.png # iOS home screen icon
β βββ web-app-manifest-192x192.png # PWA icon (192px)
β βββ web-app-manifest-512x512.png # PWA icon (512px)
β βββ og-default.png # Default OpenGraph social preview image
β βββ site.webmanifest # PWA manifest
β βββ sitemap.xml # SEO sitemap
β βββ robots.txt # Crawler rules
β βββ sw.js # Service Worker for offline caching
β
βββ src/
β βββ assets/ # SVG graphics and vector assets
β βββ layouts/
β β βββ Layout.astro # Base HTML shell β GA, SEO, PWA, theme FOUC
β βββ components/
β β βββ Navbar.astro # Sticky header with dark/light toggle
β β βββ Hero.astro # Main URL input + download engine (39KB of UI logic)
β β βββ PlatformHero.astro # Platform-specific hero variant
β β βββ PlatformSwitcher.astro # Visual platform selection carousel
β β βββ SupportedSites.astro # Grid of supported platform cards
β β βββ Features.astro # Feature highlight cards
β β βββ HowItWorks.astro # Step-by-step usage guide
β β βββ SEOContent.astro # Long-form SEO content section
β β βββ FAQ.astro # Accordion FAQ section
β β βββ Footer.astro # Site footer with links
β β βββ Welcome.astro # Welcome/intro section
β βββ pages/
β β βββ index.astro # Homepage
β β βββ 404.astro # Custom 404 error page
β β βββ 500.astro # Custom 500 error page
β β βββ about-us.astro # About page
β β βββ contact-us.astro # Contact page
β β βββ privacy-policy.astro # Privacy policy
β β βββ terms-and-conditions.astro # Terms of service
β β βββ dmca.astro # DMCA takedown request page
β β βββ youtube.astro β index # YouTube-specific SEO landing
β β βββ tiktok.astro # TikTok-specific SEO landing
β β βββ instagram.astro # Instagram-specific SEO landing
β β βββ twitter.astro # Twitter/X-specific SEO landing
β β βββ facebook.astro # Facebook-specific SEO landing
β β βββ reddit.astro # Reddit-specific SEO landing
β β βββ twitch.astro # Twitch-specific SEO landing
β β βββ soundcloud.astro # Soundcloud-specific SEO landing
β β βββ vimeo.astro # Vimeo-specific SEO landing
β β βββ pinterest.astro # Pinterest-specific SEO landing
β β βββ linkedin.astro # LinkedIn-specific SEO landing
β β βββ dailymotion.astro # Dailymotion-specific SEO landing
β βββ styles/
β βββ global.css # Tailwind v4 base + custom theme styles
β
βββ worker.js # Cloudflare Worker β API, proxy, SEO, cron (585 lines)
βββ wrangler.toml # Cloudflare Workers deployment config
βββ astro.config.mjs # Astro config with Tailwind plugin + dev proxies
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
Configured in wrangler.toml (local dev) or via the Cloudflare dashboard (production):
| Variable | Type | Description |
|---|---|---|
COBALT_API_URL |
string |
URL of the primary self-hosted Cobalt API instance |
COBALT_FALLBACK_INSTANCES |
string |
Comma-separated list of fallback Cobalt instance URLs |
The Worker also includes a hardcoded list of 7 community Cobalt instances (sourced from cobalt.directory) as a final fallback layer.
- Node.js v22.12.0+
- npm (included with Node.js)
- Wrangler CLI (
npm install -g wrangler) β for Worker development/deployment
git clone https://github.com/nitin2122/mp4yt.git
cd mp4yt
npm install| Command | Description |
|---|---|
npm run dev |
Start Astro dev server at http://localhost:4321 |
npm run dev:worker |
Start Cloudflare Worker dev server at http://localhost:8787 |
npm run dev:full |
Run both concurrently (frontend + Worker backend) |
npm run build |
Build static assets to ./dist |
npm run deploy |
Build + deploy to Cloudflare Workers |
Tip: During development, Astro's dev server proxies
/api/*,/download-stream, and/watchto the Worker dev server automatically viaastro.config.mjs.
This project deploys as a unified Cloudflare Workers application β the static Astro site and the Worker backend run together on Cloudflare's edge network.
# 1. Login to Cloudflare
npx wrangler login
# 2. Build and deploy
npm run deployWrangler will:
- Run
npm run buildto compile the Astro site intodist/ - Upload static assets to Cloudflare's edge
- Deploy
worker.jswith theASSETSbinding - Configure the
*/5 * * * *cron trigger for keep-alive pings
Live deployment:(https://mp4yt.com)
| Endpoint | Method | Description |
|---|---|---|
/api/extract?url=<URL> |
GET |
Extract download links for all available qualities (144pβ4K + MP3) from the given URL |
/download-stream?url=<CDN_URL>&filename=<name> |
GET |
Proxy-stream a media file through Cloudflare edge with proper download headers |
/watch?url=<URL> |
GET |
SEO endpoint β serves OpenGraph metadata to bots, redirects humans to the app |
- Validates the input URL against private/internal network patterns
- Fires parallel requests across all quality tiers (144pβ4K + audio)
- Uses multi-instance Cobalt failover (primary β env fallbacks β hardcoded community)
- Scrapes source page metadata (title, thumbnail, description) concurrently
- Returns deduplicated format list with stream URLs
- Proxies upstream CDN responses through Cloudflare
- Injects
Content-Disposition: attachmentfor direct downloads - Supports HTTP Range requests for resumable downloads
- Sanitizes filenames for cross-platform compatibility
- Detects 30+ bot user agents via regex
- For bots: Renders full OpenGraph + Twitter Card HTML with real video metadata
- For humans: 302 redirects to
/#url=<encoded_url>for instant app loading
This project is built for educational and demonstration purposes. The download engine is powered by Cobalt.
Users are responsible for complying with the terms of service of the respective platforms they extract media from. The authors do not host, store, or distribute any copyrighted content.
Made with β€οΈ by Nitin Jangir