MCPcopy Index your code
hub / github.com/zhouxiaoka/autoclip

github.com/zhouxiaoka/autoclip @v1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.0 ↗ · + Follow
2,677 symbols 8,725 edges 258 files 1,672 documented · 62% updated 33d agov1.2.0 · 2026-06-03★ 5,93552 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AutoClip - AI Video Intelligent Clipping System

AutoClip Logo

AI-powered intelligent video clipping system

Supporting YouTube/Bilibili video download, automatic clipping, and smart collection generation

Python React FastAPI TypeScript Celery License

GitHub stars GitHub forks GitHub issues

Language: English | 中文

🎯 Project Overview

AutoClip is an AI-powered intelligent video clipping system that can automatically download videos from YouTube, Bilibili, and other platforms, extract exciting clips through AI analysis, and intelligently generate collections. The system adopts a modern frontend-backend separation architecture, providing an intuitive web interface and powerful backend processing capabilities.

✨ Core Features

  • 🎬 Multi-platform Support: One-click download from YouTube, Bilibili, and local file upload
  • 🤖 AI Intelligent Analysis: Video content understanding based on Qwen large language model
  • ✂️ Automatic Clipping: Intelligent recognition of exciting clips with automatic cutting, supporting multiple video categories
  • 📚 Smart Collections: AI-recommended and manually created video collections with drag-and-drop sorting
  • 🚀 Real-time Processing: Asynchronous task queue with real-time progress feedback and WebSocket communication
  • 🎨 Modern Interface: React + TypeScript + Ant Design with responsive design
  • 📱 Mobile Support [In Development]: Responsive design, improving mobile experience
  • 🔐 Account Management [In Development]: Support for multiple Bilibili account management with automatic health checks
  • 📊 Data Statistics: Complete project management and data statistics functionality
  • 🛠️ Easy Deployment: One-click startup scripts, Docker support, and detailed documentation
  • 📤 Bilibili Upload [In Development]: Automatic upload of clipped videos to Bilibili
  • ✏️ Subtitle Editing [In Development]: Visual subtitle editing and synchronization functionality

🏗️ System Architecture

graph TB
    A[User Interface] --> B[FastAPI Backend]
    B --> C[Celery Task Queue]
    B --> D[Redis Cache]
    B --> E[SQLite Database]
    C --> F[AI Processing Engine]
    F --> G[Video Processing]
    F --> H[Subtitle Analysis]
    F --> I[Content Understanding]
    B --> J[File Storage]
    K[YouTube API] --> B
    L[Bilibili API] --> B

Technology Stack

Backend Technologies

  • FastAPI: Modern Python web framework with automatic API documentation generation
  • Celery: Distributed task queue supporting asynchronous processing
  • Redis: Message broker and cache for task status management
  • SQLite: Lightweight database with PostgreSQL upgrade support
  • yt-dlp: YouTube video download supporting multiple formats
  • Qwen: AI content analysis supporting multiple models
  • WebSocket: Real-time communication and progress push
  • Pydantic: Data validation and serialization

Frontend Technologies

  • React 18: User interface framework with Hooks and functional components
  • TypeScript: Type safety for better development experience
  • Ant Design: Enterprise-grade UI component library
  • Vite: Fast build tool with hot reload
  • Zustand: Lightweight state management
  • React Router: Route management
  • Axios: HTTP client
  • React Player: Video player

🚀 Quick Start

Environment Requirements

Docker Deployment (Recommended)

  • Docker: 20.10+
  • Docker Compose: 2.0+
  • Memory: Minimum 4GB, recommended 8GB+
  • Storage: Minimum 10GB available space

Local Deployment

  • Operating System: macOS / Linux / Windows (WSL)
  • Python: 3.8+ (recommended 3.9+)
  • Node.js: 16+ (recommended 18+)
  • Redis: 6.0+ (recommended 7.0+)
  • FFmpeg: Video processing dependency
  • Memory: Minimum 4GB, recommended 8GB+
  • Storage: Minimum 10GB available space

One-Click Startup

Method 1: Docker Deployment (Recommended)

# Clone the project
git clone https://github.com/zhouxiaoka/autoclip.git
cd autoclip

# Docker one-click startup
./docker-start.sh

# Development environment startup
./docker-start.sh dev

# Stop services
./docker-stop.sh

# Check service status
./docker-status.sh

Method 2: Local Deployment

# Clone the project
git clone https://github.com/zhouxiaoka/autoclip.git
cd autoclip

# One-click startup (recommended, includes complete checks and monitoring)
./start_autoclip.sh

# Quick startup (development environment, skips detailed checks)
./quick_start.sh

# Check system status
./status_autoclip.sh

# Stop system
./stop_autoclip.sh

Manual Installation

# 1. Create virtual environment
python3 -m venv venv
source venv/bin/activate  # Linux/macOS
# or venv\Scripts\activate  # Windows

# 2. Install Python dependencies
pip install -r requirements.txt

# 3. Install frontend dependencies
cd frontend && npm install && cd ..

# 4. Install Redis
# macOS
brew install redis
brew services start redis

# Ubuntu/Debian
sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server

# CentOS/RHEL
sudo yum install redis
sudo systemctl start redis

# 5. Install FFmpeg
# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

# CentOS/RHEL
sudo yum install ffmpeg

# 6. Configure environment variables
cp env.example .env
# Edit .env file and fill in necessary configurations

🎬 Feature Demo

Main Feature Showcase

  1. Video Download and Processing
  2. Support for YouTube, Bilibili video link parsing
  3. Automatic video and subtitle file download
  4. Support for local file upload

  5. AI Intelligent Analysis

  6. Automatic video outline extraction
  7. Intelligent topic timeline identification
  8. Exciting clip scoring

  9. Video Clipping and Collections

  10. Automatic exciting clip generation
  11. Smart collection recommendations
  12. Support for manual editing and sorting

  13. Real-time Progress Monitoring

  14. WebSocket real-time progress push
  15. Detailed task status display
  16. Error handling and retry mechanisms

  17. Bilibili Upload Feature [In Development]

  18. Automatic upload of clipped videos to Bilibili
  19. Support for multiple account management
  20. Batch upload and queue management

  21. Subtitle Editing Feature [In Development]

  22. Visual subtitle editor
  23. Subtitle synchronization and adjustment
  24. Multi-language subtitle support

📖 User Guide

1. Video Download

YouTube Videos

  1. Click "New Project" on the homepage
  2. Select "YouTube Link"
  3. Paste the video URL
  4. Choose browser cookies (optional)
  5. Click "Start Download"

Bilibili Videos

  1. Click "New Project" on the homepage
  2. Select "Bilibili Link"
  3. Paste the video URL
  4. Choose login account
  5. Click "Start Download"

Local Files

  1. Click "New Project" on the homepage
  2. Select "File Upload"
  3. Drag and drop or select video files
  4. Upload subtitle files (optional)
  5. Click "Start Processing"

2. Intelligent Processing

The system will automatically execute the following steps:

  1. Material Preparation: Download video and subtitle files
  2. Content Analysis: AI extracts video outline and key information
  3. Timeline Extraction: Identify topic time intervals
  4. Exciting Scoring: AI scoring for each clip
  5. Title Generation: Generate attractive titles for exciting clips
  6. Collection Recommendation: AI-recommended video collections
  7. Video Generation: Generate clipped videos and collection videos

3. Result Management

  • View Clips: View all generated video clips on the project detail page
  • Edit Information: Modify clip titles, descriptions, etc.
  • Create Collections: Manually create or use AI-recommended collections
  • Download Export: Download individual clips or complete collections
  • Bilibili Upload [In Development]: One-click upload of clipped videos to Bilibili
  • Subtitle Editing [In Development]: Visual editing and synchronization of subtitle files

🔧 Configuration

Environment Variable Configuration

Create .env file:

# Database configuration
DATABASE_URL=sqlite:///./data/autoclip.db

# Redis configuration
REDIS_URL=redis://localhost:6379/0

# AI API configuration
API_DASHSCOPE_API_KEY=your_dashscope_api_key
API_MODEL_NAME=qwen-plus

# Logging configuration
LOG_LEVEL=INFO
ENVIRONMENT=development
DEBUG=true

# File storage
UPLOAD_DIR=./data/uploads
PROJECT_DIR=./data/projects

Bilibili Account Configuration [In Development]

  1. Click "Bilibili Account Management" on the settings page
  2. Choose login method:
  3. Cookie Import (recommended): Export cookies from browser
  4. Account Password: Directly input account and password
  5. QR Code Login: Scan QR code to login
  6. After successful addition, the system will automatically manage account health status

📁 Project Structure

autoclip/
├── backend/                 # Backend code
│   ├── api/                # API routes
│   │   ├── v1/            # API v1 version
│   │   │   ├── youtube.py # YouTube download API
│   │   │   ├── bilibili.py # Bilibili download API
│   │   │   ├── projects.py # Project management API
│   │   │   ├── clips.py   # Video clip API
│   │   │   ├── collections.py # Collection management API
│   │   │   └── settings.py # System settings API
│   │   └── upload_queue.py # Upload queue management
│   ├── core/              # Core configuration
│   │   ├── database.py    # Database configuration
│   │   ├── celery_app.py  # Celery configuration
│   │   ├── config.py      # System configuration
│   │   └── llm_manager.py # AI model management
│   ├── models/            # Data models
│   │   ├── project.py     # Project model
│   │   ├── clip.py        # Clip model
│   │   ├── collection.py  # Collection model
│   │   └── bilibili.py    # Bilibili account model
│   ├── services/          # Business logic
│   │   ├── video_service.py # Video processing service
│   │   ├── ai_service.py  # AI analysis service
│   │   └── upload_service.py # Upload service
│   ├── tasks/             # Celery tasks
│   │   ├── processing.py  # Processing tasks
│   │   ├── upload.py      # Upload tasks
│   │   └── maintenance.py # Maintenance tasks
│   ├── pipeline/          # Processing pipeline
│   │   ├── step1_outline.py # Outline extraction
│   │   ├── step2_timeline.py # Timeline analysis
│   │   ├── step3_scoring.py # Exciting scoring
│   │   └── step6_video.py # Video generation
│   └── utils/             # Utility functions
├── frontend/              # Frontend code
│   ├── src/
│   │   ├── components/    # React components
│   │   │   ├── UploadModal.tsx # Upload modal
│   │   │   ├── ClipCard.tsx # Clip card
│   │   │   ├── CollectionCard.tsx # Collection card
│   │   │   └── BilibiliManager.tsx # Bilibili management
│   │   ├── pages/         # Page components
│   │   │   ├── HomePage.tsx # Home page
│   │   │   ├── ProjectDetailPage.tsx # Project detail
│   │   │   └── SettingsPage.tsx # Settings page
│   │   ├── services/      # API services
│   │   │   └── api.ts     # API client
│   │   └── stores/        # State management
│   └── package.json
├── data/                  # Data storage
│   ├── projects/          # Project data
│   ├── uploads/           # Upload files
│   ├── temp/              # Temporary files
│   ├── output/            # Output files
│   └── autoclip.db        # Database file
├── scripts/               # Utility scripts
│   ├── start_autoclip.sh  # Startup script
│   ├── stop_autoclip.sh   # Stop script
│   └── status_autoclip.sh # Status check
├── docs/                  # Documentation
├── logs/                  # Log files
├── Dockerfile             # Docker image build file
├── Dockerfile.dev         # Development environment Docker file
├── docker-compose.yml     # Production environment Docker orchestration
├── docker-compose.dev.yml # Development environment Docker orchestration
├── docker-start.sh        # Docker startup script
├── docker-stop.sh         # Docker stop script
├── docker-status.sh       # Docker status check script
├── .dockerignore          # Docker ignore file
├── DOCKER.md              # Docker deployment documentation
└── *.sh                   # Startup scripts

🌐 API Documentation

After starting the system, visit the following addresses to view API documentation:

Main API Endpoints

Endpoint Method Description
/api/v1/projects GET Get project list
/api/v1/projects POST Create new project
/api/v1/projects/{id} GET Get project details
/api/v1/youtube/parse POST Parse YouTube video information
/api/v1/youtube/download POST Download You

Extension points exported contracts — how you extend this code

ApiConfig (Interface)
* API 配置管理器 * 处理动态后端地址和端口配置
frontend/src/utils/apiConfig.ts
ImportMetaEnv (Interface)
(no doc)
frontend/src/vite-env.d.ts
ImportMeta (Interface)
(no doc)
frontend/src/vite-env.d.ts
DesktopConfig (Interface)
(no doc)
frontend/src/components/DesktopSettings.tsx
SystemInfo (Interface)
(no doc)
frontend/src/components/DesktopSettings.tsx

Core symbols most depended-on inside this repo

get
called by 595
backend/services/base.py
exists
called by 230
backend/services/base.py
delete
called by 40
backend/services/base.py
close
called by 40
backend/shared/progress_publisher.py
update
called by 38
backend/services/base.py
find_by
called by 31
backend/repositories/base.py
count
called by 30
backend/services/base.py
get
called by 29
backend/core/celery_app.py

Shape

Method 1,146
Function 928
Class 309
Route 186
Interface 108

Languages

Python81%
TypeScript19%

Modules by API surface

backend/tests/test_processing_framework.py57 symbols
backend/api/v1/settings.py54 symbols
backend/api/v1/projects.py49 symbols
backend/tests/test_error_handler.py48 symbols
backend/core/desktop_config.py40 symbols
backend/services/bilibili_service.py39 symbols
backend/api/v1/speech_recognition.py38 symbols
backend/utils/error_handler.py37 symbols
backend/core/unified_config.py36 symbols
backend/services/pipeline_adapter.py35 symbols
backend/api/v1/upload.py34 symbols
backend/core/llm_providers.py32 symbols

Dependencies from manifests, versioned

@ant-design/icons5.2.6 · 1×
@radix-ui/react-label2.1.7 · 1×
@radix-ui/react-progress1.1.7 · 1×
@radix-ui/react-slider1.3.6 · 1×
@radix-ui/react-slot1.2.3 · 1×
@radix-ui/react-switch1.2.6 · 1×
@tauri-apps/api2.8.0 · 1×
@tauri-apps/cli2.0.0-rc.18 · 1×
@tauri-apps/plugin-shell2.0.0-rc · 1×
@types/react18.2.43 · 1×

Datastores touched

autoclipDatabase · 1 repos

For agents

$ claude mcp add autoclip \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact