youtube-shorts-factory
YouTube Shorts 숏츠 영상 자동 제작 — AI 뉴스, 개발 팁, GitHub 트렌딩, 오픈소스 소개, 커스텀 토픽을 60초 이내 숏츠로 자동 생성 (NotebookLM 팟캐스트 오디오 + 배경 이미지)
YouTube Shorts Factory
AI 뉴스, 개발 팁, GitHub 트렌딩, 오픈소스 소개, 커스텀 토픽을 YouTube Shorts 숏츠 영상으로 자동 제작합니다. NotebookLM 팟캐스트 오디오를 나레이션으로 사용합니다.
스크립트 위치
~/.hermes/scripts/youtube_shorts_factory.py
사용법
기본 (AI 뉴스 자동 수집)
python3 ~/.hermes/scripts/youtube_shorts_factory.py --type ai_news
콘텐츠 타입
| 타입 | 옵션 | 설명 |
|------|------|------|
| ai_news | --type ai_news | HN + Reddit에서 AI 뉴스 자동 수집 |
| dev_tip | --type dev_tip | 사전 정의 개발 팁에서 랜덤 선택 |
| github_trending | --type github_trending | GitHub 트렌딩 레포 자동 수집 |
| opensource | --type opensource | 오픈소스 도구 자동 수집 |
| custom | --type custom --topic "토픽" | 커스텀 토픽 (필수: --topic) |
전체 옵션
python3 ~/.hermes/scripts/youtube_shorts_factory.py \
--type custom \
--topic "제목" \
--extra "추가 설명 텍스트" \
--no-upload # 업로드 생략 (테스트용)
--no-bgm # BGM 생략
--output-dir /tmp/output # 출력 디렉토리 (기본: /tmp/icbm_shorts)
파이프라인
콘텐츠 수집 → 대본 생성 → NotebookLM 노트북 생성 → 소스 추가 → 팟캐스트 오디오 생성 → 59초 트림 → 배경 이미지 → ffmpeg 영상 조합 → YouTube 업로드
Step 1: 콘텐츠 수집 + 대본 생성
- ai_news: HN top 30 + r/artificial + r/MachineLearning에서 AI 키워드 매칭
- dev_tip: 사전 정의된 개발 팁 15개에서 랜덤 선택
- github_trending: GitHub Trending HTML 스크래핑 + Notion DB 기반 중복 방지 (이미 업로드한 repo 자동 제외)
- opensource: Product Hunt + GitHub trending 백업
- custom:
--topic과--extra로 대본 구성 - 대본 구조: Hook → Body → CTA (구독 유도)
Step 2: NotebookLM 팟캐스트 오디오 생성
- 소스 텍스트로 NotebookLM 노트북 생성
- 팟캐스트(audio) 생성 요청 (
--format brief,--language ko) artifact poll로 폴링하여 완료 대기 (최대 10분)- 오디오 다운로드 후 59초로 자동 트림
- 노트북 자동 삭제 (정리)
Step 3: 배경 이미지 (Pillow)
- 1080x1920 (9:16) 세로형
- 다크 그라디언트 배경 + 글로우 이펙트
- ICBM 로고 + 타입 뱃지 + Hook/Body/CTA 텍스트
- 해시태그 + 구독 유도 바
Step 4: ffmpeg 영상 조합
- 정지 이미지 + 팟캐스트 오디오 → MP4 (libx264 + AAC)
- 최대 59초 자동 제한
Step 5: YouTube 업로드
~/.hermes/skills/creative/youtube-uploader/scripts/upload.py사용- 제목:
{타입} | ICBM #{YYYY-MM-DD} - 카테고리: 28 (Science & Tech)
- 프라이버시: public
의존성
| 항목 | 경로 | 비고 |
|------|------|------|
| notebooklm CLI | ~/.hermes/venv-notebooklm/bin/notebooklm | Python 3.13 venv |
| Pillow | venv site-packages (sys.path injection) | 시스템 Python 3.9에서 사용 |
| ffmpeg | 시스템 ffmpeg | 필수 |
| ffprobe | 시스템 ffprobe | 필수 |
| upload.py | ~/.hermes/skills/creative/youtube-uploader/scripts/ | YouTube 업로드 |
색상 테마
| 타입 | Primary | Accent | Glow |
|------|---------|--------|------|
| ai_news | (30, 64, 175) | (96, 165, 250) | (59, 130, 246) |
| dev_tip | (22, 101, 52) | (74, 222, 128) | (34, 197, 94) |
| github_trending | (100, 50, 150) | (167, 139, 250) | (139, 92, 246) |
| opensource | (120, 53, 15) | (251, 146, 60) | (249, 115, 22) |
| custom | (30, 58, 95) | (56, 189, 248) | (14, 165, 233) |
중복 방지 (GitHub Trending)
github_trending 타입 실행 시 Notion 🔥 GitHub Trending DB를 조회하여 이미 YouTube에 업로드한 repo를 자동 제외합니다.
Notion DB 설정
- DB ID:
33f76f2e-9097-8176-a537-d40ebb476ef9 - 속성: Uploaded (checkbox), UploadDate (date), VideoTitle (rich_text)
동작 흐름
- GitHub Trending에서 전체 repo 수집
- Notion DB에서
Uploaded=true인 repo URL 목록 조회 - 중복 repo 제외 후 첫 번째 후보 선택
- YouTube 업로드 성공 시 Notion에
Uploaded=true+UploadDate+VideoTitle마킹 - 모든 repo가 이미 업로드된 경우 "새 repo 없음"으로 종료
알려진 문제
| 문제 | 원인 | 해결 |
|------|------|------|
| 팟캐스트 생성 시간 | NotebookLM 서버 처리 시간 (3~10분) | --no-upload로 먼저 테스트 |
| 팟캐스트가 59초 초과 | brief 포맷도 길 수 있음 | 자동 59초 트림 처리됨 |
| 소스 처리 안됨 | NotebookLM 서버 지연 | 60초 대기 후 진행 |
| YouTube 업로드 실패 | cryptography 모듈 호환성 | --no-upload 후 수동 업로드 |
출력
- 영상:
{output_dir}/output_bgm_{timestamp}.mp4 - 썸네일:
{output_dir}/thumbnail.png - 나레이션:
{output_dir}/narration_{timestamp}.mp3 - 배경:
{output_dir}/background_{timestamp}.png
Related Skills / 관련 스킬
architecture-diagram
Generate dark-themed SVG diagrams of software systems and cloud infrastructure as standalone HTML files with inline SVG graphics. Semantic component colors (cyan=frontend, emerald=backend, violet=database, amber=cloud/AWS, rose=security, orange=message bus), JetBrains Mono font, grid background. Best suited for software architecture, cloud/VPC topology, microservice maps, service-mesh diagrams, database + API layer diagrams, security groups, message buses — anything that fits a tech-infra deck with a dark aesthetic. If a more specialized diagramming skill exists for the subject (scientific, educational, hand-drawn, animated, etc.), prefer that — otherwise this skill can also serve as a general-purpose SVG diagram fallback. Based on Cocoon AI's architecture-diagram-generator (MIT).