fix(video-render): Kling PiAPI → Native KlingAI (T11 follow-up)

박재오 발견: Kling 공식 API key 발급 (Access Key + Secret Key).
PiAPI gateway가 아닌 native api.klingai.com 사용.

변경:
- providers/kling.py: JWT 인증 (HS256, iss=access_key, exp=now+1800, nbf=now-5).
  POST /v1/videos/text2video → GET /v1/videos/{kind}/{task_id} 폴링.
  data.task_result.videos[0].url 다운로드.
  text2video / image2video 자동 분기.
- .env.example: PIAPI_API_KEY → KLING_ACCESS_KEY + KLING_SECRET_KEY
- docker-compose: 같은 env 교체
- requirements.txt: + PyJWT>=2.8.0

박재오 측: .env에 두 키 모두 입력.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 02:40:01 +09:00
parent 8aa3f1c3b2
commit 0702cf052f
4 changed files with 71 additions and 48 deletions

View File

@@ -4,6 +4,7 @@ requests==2.32.3
redis>=5.0
httpx>=0.27
openai>=1.50.0
PyJWT>=2.8.0
pytest>=8.0
pytest-asyncio>=0.24
respx>=0.21