一个基于Node.js的Web应用,可从YouTube视频中截取指定片段并导出为新的视频文件,无需手动下载完整视频。

Stars

70

7 天增长

暂无数据

Fork 数

10

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-14

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过SSE提供实时进度反馈,缓存元数据和源视频,具备队列并发控制以及全面的错误处理,并封装成简洁的REST API和前端界面。

适合谁使用

  • 需要自行托管YouTube剪辑服务的开发者
  • 需要为社交媒体提取短视频的内容创作者
  • 希望自动化截取视频片段的视频编辑人员
  • 不愿安装桌面软件来完成简单剪辑的用户

典型使用场景

  • 从长视频中提取精彩片段
  • 为多平台复用创建短视频
  • 将视频片段转换为MP3或提取音频
  • 利用缓存机制批量剪辑同一视频的多个片段

项目优势

  • 通过Server-Sent Events为每个任务提供实时进度流
  • 智能缓存避免重复下载相同的视频源文件
  • 可配置并发数的队列防止资源过载
  • 包含速率限制、输入验证、路径遍历防护等安全措施

使用前须知

  • 必须手动安装yt-dlp(未提供自动回退)
  • 依赖FFmpeg(虽有静态回退)和Python(用于yt-dlp)
  • README明确禁止将软件本身用于商业转售(MIT许可证可能允许,但README另有说明)

README 快速开始

YouTube Video Clipper v1

Tools untuk mengambil bagian tertentu (clip) dari video YouTube dan mengekspornya menjadi file video baru — tanpa perlu mengunduh seluruh video secara manual.

Dibangun dengan Node.js + Express, yt-dlp untuk pengambilan video, dan FFmpeg untuk pemotongan/encoding. Progress real-time menggunakan Server-Sent Events.


Fitur

  • Ambil metadata video (judul, thumbnail, durasi, channel, resolusi, subtitle) tanpa download
  • Potong video berdasarkan rentang waktu (startend) dengan pilihan resolusi output
  • Progress real-time (downloading → clipping → encoding → finished) via SSE
  • Cache metadata & source video (tidak download ulang video yang sama)
  • Auto-cleanup file setelah 30 menit
  • Rate limiting, validasi input, sanitasi filename, proteksi path traversal
  • Fitur bonus: convert ke MP3, extract audio, watermark, ubah FPS, compress, crop, burn subtitle, merge clip (lihat services/ffmpeg.service.js)

Struktur Project

youtube-clipper/
├── app.js                  # Entry point
├── config/                 # Konfigurasi & konstanta
├── routes/                 # Definisi endpoint
├── controllers/             # Request/response handler
├── services/                 # Business logic (yt-dlp, ffmpeg, job, queue, cache, cleanup)
├── middleware/               # Validator, rate limiter, security, error handler
├── utils/                    # Helper murni (validator, logger, sanitizer, dll)
├── views/ + public/          # Frontend (EJS + vanilla JS + CSS)
├── scripts/                   # Script maintenance (checkDependencies, clean)
├── temp/ downloads/ output/ logs/   # Folder runtime (auto-dibersihkan)

1. Instalasi

Prasyarat

  • Node.js ≥ 18 LTS
  • Python 3 (untuk instalasi yt-dlp via pip) — opsional jika pakai binary langsung
  • FFmpeg (opsional install manual — project sudah menyediakan fallback via ffmpeg-static)

Install dependency Node.js

git clone https://github.com/ray4rt/yt-clip
cd yt-clip
npm install

Install FFmpeg (opsional, untuk performa & codec terbaik)

Ubuntu/Debian

sudo apt update && sudo apt install -y ffmpeg

macOS

brew install ffmpeg

Windows

  1. Download dari https://www.gyan.dev/ffmpeg/builds/
  2. Extract, tambahkan folder bin ke PATH
  3. Verifikasi: ffmpeg -version

Jika FFmpeg sistem tidak ditemukan, aplikasi otomatis f

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

react
精选
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web 开发前端框架
246,741
tandpfun
精选
tandpfun GitHub avatar

wardrobe

A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.

JavaScript
1,570
mshumer
精选
mshumer GitHub avatar

Claude-of-Duty

A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.

AI 与机器学习AI 智能体
1,234