feat: v3.2 나머지 미완성 기능 구현

[Instagram Reels] Phase 2 완성
- instagram_bot.py: publish_reels() 추가 (MP4 → Reels API)
  - upload_video_container(), wait_for_video_ready() 구현
  - 로컬 경로 → 공개 URL 자동 변환 (image_host.get_public_video_url())
- scheduler.py: job_distribute_instagram_reels() 추가 (10:30)
- image_host.py: get_public_video_url() + 로컬 비디오 서버 추가
  - VIDEO_HOST_BASE_URL 환경변수 지원 (Tailscale/CDN)

[writer_bot.py] 신규 — 독립 실행형 글쓰기 봇
- api_content.py manual-write 엔드포인트에서 subprocess 호출 가능
- run_pending(): 오늘 날짜 미처리 글감 자동 처리
- run_from_topic(): 직접 주제 지정
- run_from_file(): JSON 파일 지정
- CLI: python bots/writer_bot.py [--topic "..." | --file path.json | --limit N]

[보조 시스템 신규] v3.1 CLI + Assist 모드
- blog.cmd: venv Python 경유 Windows 런처
- blog_runtime.py + runtime_guard.py: 실행 진입점 + venv 검증
- blog_engine_cli.py: 대시보드 API 기반 CLI (blog status, blog review 등)
- bots/assist_bot.py: URL 기반 수동 어시스트 파이프라인
- dashboard/backend/api_assist.py + frontend/Assist.jsx: 수동모드 탭

[engine_loader.py] v3.1 개선
- OpenClawWriter: --json 플래그 + payloads 파싱 + plain text 폴백
- ClaudeWebWriter: Playwright 쿠키 세션 (Cloudflare 차단으로 현재 비활성)
- GeminiWebWriter: gemini-webapi 비공식 클라이언트

[scheduler.py] v3.1 개선
- _call_openclaw(): 플레이스홀더 → EngineLoader 실제 호출
- _build_openclaw_prompt(): 구조화된 HTML 원고 프롬프트
- data/originals/: 원본 article JSON 저장 경로 추가

[설정/환경] 정비
- .env.example: SEEDANCE/ELEVENLABS/GEMINI/RUNWAY 복원
  + VIDEO_HOST_BASE_URL, GEMINI_WEB_* , REMOTE_CLAUDE_POLLING_ENABLED 추가
- scripts/setup.bat: data/originals, outputs, assist, novels, config/novels
  디렉토리 생성 + 폰트 다운로드 + blog.cmd 기반 Task Scheduler 등록
- requirements.txt: fastapi, uvicorn, python-multipart 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sinmb79
2026-03-28 17:12:39 +09:00
parent 213f57b52d
commit 392c2e13f1
26 changed files with 2296 additions and 98 deletions

View File

@@ -1,31 +1,39 @@
{
"_comment": "The 4th Path 블로그 자동 수익 엔진 — 엔진 설정 (v3)",
"_updated": "2026-03-26",
"writing": {
"provider": "claude",
"provider": "openclaw",
"_comment_provider": "openclaw=ChatGPT Pro(OAuth), claude_web=Claude Max(웹쿠키), gemini_web=Gemini Pro(웹쿠키), claude=Anthropic API키, gemini=Google AI API키",
"options": {
"openclaw": {
"agent_name": "blog-writer",
"timeout": 300
},
"claude_web": {
"cookie_env": "CLAUDE_WEB_COOKIE",
"ua_env": "CLAUDE_WEB_UA",
"timeout": 240
},
"gemini_web": {
"psid_env": "GEMINI_WEB_1PSID",
"psidts_env": "GEMINI_WEB_1PSIDTS"
},
"claude": {
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-opus-4-5",
"model": "claude-opus-4-6",
"max_tokens": 4096,
"temperature": 0.7
},
"openclaw": {
"agent_name": "blog-writer",
"timeout": 120
},
"gemini": {
"api_key_env": "GEMINI_API_KEY",
"model": "gemini-2.0-flash",
"model": "gemini-2.5-pro",
"max_tokens": 4096,
"temperature": 0.7
}
}
},
"tts": {
"provider": "gtts",
"provider": "openai",
"options": {
"google_cloud": {
"api_key_env": "GOOGLE_TTS_API_KEY",
@@ -52,9 +60,8 @@
}
}
},
"image_generation": {
"provider": "dalle",
"provider": "external",
"options": {
"dalle": {
"api_key_env": "OPENAI_API_KEY",
@@ -67,9 +74,8 @@
}
}
},
"video_generation": {
"provider": "ffmpeg_slides",
"provider": "sora",
"options": {
"ffmpeg_slides": {
"resolution": "1080x1920",
@@ -108,7 +114,6 @@
}
}
},
"publishing": {
"blogger": {
"enabled": true,
@@ -119,7 +124,11 @@
"channel_id_env": "YOUTUBE_CHANNEL_ID",
"category": "shorts",
"privacy": "public",
"tags": ["쇼츠", "AI", "the4thpath"]
"tags": [
"쇼츠",
"AI",
"the4thpath"
]
},
"instagram": {
"enabled": false,
@@ -136,7 +145,6 @@
"comment": "노벨피아 연재 — 추후 활성화"
}
},
"quality_gates": {
"gate1_research_min_score": 60,
"gate2_writing_min_score": 70,
@@ -146,7 +154,6 @@
"min_word_count": 300,
"safety_check": true
},
"schedule": {
"collector": "07:00",
"writer": "08:00",
@@ -155,7 +162,6 @@
"youtube_uploader": "10:00",
"analytics": "22:00"
},
"brand": {
"name": "The 4th Path",
"sub": "Independent Tech Media",
@@ -163,11 +169,10 @@
"url": "the4thpath.com",
"cta": "팔로우하면 매일 이런 정보를 받습니다"
},
"optional_keys": {
"SEEDANCE_API_KEY": "Seedance 2.0 AI 영상 생성",
"ELEVENLABS_API_KEY": "ElevenLabs 고품질 TTS",
"GEMINI_API_KEY": "Google Gemini 글쓰기 / Veo 영상",
"RUNWAY_API_KEY": "Runway Gen-3 AI 영상 생성"
}
}
}