feat: v2 파이프라인 — 매일 2곡 다양한 장르 BGM 자동 생성/업로드

- daily_precache.py: Claude Code CLI 프리캐시 (날짜/계절/기념일 테마)
- daily_scheduler.py: ACE-Step 음악 → FLUX 이미지 → 영상 렌더 → 큐
- upload_scheduled.py: auto_shorts 동일 큐 방식 업로드
- PRECACHE_GUIDE_MUSIC.md: 19개 장르, 감성 제목, 재생목록 자유 생성
- generate_image.py: --lowvram 제거, GPU VRAM 확인 추가
- config.py: @animily-music 토큰 경로 변경

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
javamon
2026-05-25 19:24:50 +09:00
parent 37d13be48d
commit c3f8d6b288
8 changed files with 1688 additions and 22 deletions

View File

@@ -173,13 +173,45 @@ def upload_video(video_path, title, thumbnail_path=None, extra_tags=None, privac
return video_id
# 뮤직큐우 재생목록 (기존)
PLAYLIST_ID = "PLr8dPYZT-hCUjL-OgPxJdF81Dvn_g8Vbg"
# 재생목록 캐시
_PLAYLIST_CACHE = {}
def create_or_get_playlist(title="뮤직큐우"):
"""재생목록 ID 반환 (기존 '뮤직큐우' 사용)"""
return PLAYLIST_ID
def create_or_get_playlist(title="반려동물 음악"):
"""재생목록 ID 반환 (없으면 자동 생성)"""
if title in _PLAYLIST_CACHE:
return _PLAYLIST_CACHE[title]
youtube = _get_youtube_client()
# 기존 재생목록 검색
try:
pl = youtube.playlists().list(part="snippet", mine=True, maxResults=50).execute()
for item in pl.get("items", []):
if item["snippet"]["title"] == title:
_PLAYLIST_CACHE[title] = item["id"]
print(f" [YT] 재생목록 찾음: {title} (id={item['id']})", flush=True)
return item["id"]
except Exception as e:
print(f" [YT] 재생목록 검색 실패: {e}", flush=True)
# 없으면 생성
try:
body = {
"snippet": {
"title": title,
"description": "AI 생성 반려동물 음악 | 저작권 프리 | Copyright Free Pet Music",
},
"status": {"privacyStatus": "public"},
}
resp = youtube.playlists().insert(part="snippet,status", body=body).execute()
pl_id = resp["id"]
_PLAYLIST_CACHE[title] = pl_id
print(f" [YT] 재생목록 생성: {title} (id={pl_id})", flush=True)
return pl_id
except Exception as e:
print(f" [YT] 재생목록 생성 실패: {e}", flush=True)
return None
def add_to_playlist(video_id, playlist_id):