import React, { useState } from 'react'; /** * Project landing / documentation page. * * NOTE: The actual deployable application is the Python Flask app in this repo * (`app.py` + `templates/index.html` + `Dockerfile`). This React page exists only * as an in-repo preview / overview of what gets deployed to Hugging Face Spaces. */ const AppLayout: React.FC = () => { const [copied, setCopied] = useState(null); const copy = (key: string, text: string) => { navigator.clipboard.writeText(text).then(() => { setCopied(key); setTimeout(() => setCopied(null), 1500); }); }; const files = [ { name: 'app.py', desc: 'Flask backend: /info, /download, /status/, /file/ + auto-cleanup' }, { name: 'templates/index.html', desc: 'Dark-themed UI with URL input, format dropdown, progress, history' }, { name: 'Dockerfile', desc: 'Python 3.11 + ffmpeg + latest yt-dlp, exposes port 7860' }, { name: 'requirements.txt', desc: 'flask, flask-cors, yt-dlp, gunicorn' }, { name: 'README.md', desc: 'Hugging Face Space frontmatter (sdk: docker, port 7860, purple→blue)' }, ]; const endpoints = [ { method: 'POST', path: '/info', desc: 'Returns title, thumbnail, duration, uploader, view_count for a URL' }, { method: 'POST', path: '/download', desc: 'Queues a background download job. Returns { job_id }' }, { method: 'GET', path: '/status/', desc: 'Returns { status, progress, title, ... } — poll every 1s' }, { method: 'GET', path: '/file/', desc: 'Streams the finished file to the browser as an attachment' }, { method: 'GET', path: '/healthz', desc: 'Liveness probe — returns { ok: true, jobs: N }' }, ]; const formats = [ { id: 'best', label: 'Best Quality (Video + Audio)' }, { id: '1080p', label: 'MP4 1080p' }, { id: '720p', label: 'MP4 720p' }, { id: '480p', label: 'MP4 480p' }, { id: 'mp3', label: 'MP3 Audio Only (192kbps)' }, { id: 'audio', label: 'Best Audio (webm/m4a)' }, ]; const sites = ['YouTube', 'Vimeo', 'TikTok', 'Twitter / X', 'Instagram', 'Reddit', 'Twitch', 'Facebook', 'SoundCloud', 'Dailymotion', 'Bilibili', '+1000 more']; return (
{/* Glow background */}
{/* Header */}
VidGrab
1000+ sites yt-dlp ↗
{/* Hero */}
Docker • Flask • yt-dlp • Hugging Face Spaces ready

Full-stack video
downloader, built.

A production-ready Flask + yt-dlp app with a beautiful dark UI, packaged as a Docker image that drops straight into a Hugging Face Space on port 7860.

Open Live App ↗
{/* Files generated */}

Files generated in this repo

{files.map((f) => (
{f.name} ready

{f.desc}

))}
{/* API + Formats */}

HTTP API

    {endpoints.map((e) => (
  • {e.method}
    {e.path}

    {e.desc}

  • ))}

Format options

    {formats.map((f) => (
  • {f.label} {f.id}
  • ))}
{/* Supported sites */}

Supported platforms

{sites.map((s) => ( {s} ))}
{/* Deploy steps */}

Deploy to Hugging Face Spaces

Three steps. No build server. No config files beyond what's already here.

    {[ { t: 'Create a Space', d: 'On huggingface.co/new-space, choose SDK = Docker.' }, { t: 'Push these files', d: 'git push the entire repo (app.py, templates/, Dockerfile, requirements.txt, README.md) to the Space.' }, { t: 'Wait ~2 minutes', d: 'HF builds the Docker image and serves the app on port 7860 automatically.' }, ].map((s, i) => (
  1. {i + 1}
    {s.t}
    {s.d}
  2. ))}
{/* Footer */}
); }; export default AppLayout;