Fix: [2.0.11] 라이브 DownloadError 스킵 처리 및 채널명 표시
All checks were successful
news-summary-bot-cicd / build_push_deploy (push) Successful in 12m11s
All checks were successful
news-summary-bot-cicd / build_push_deploy (push) Successful in 12m11s
- yt-dlp DownloadError에서 라이브/프리미어 감지 시 SkipVideo로 변환 (500 방지) - channel_name 필드 추가로 Discord 알림에 채널명(머니코믹스/슈카월드) 표시 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ app = FastAPI(title="News Summary Bot")
|
||||
class SummarizeRequest(BaseModel):
|
||||
video_url: str
|
||||
title: str = ""
|
||||
channel_name: str = ""
|
||||
|
||||
|
||||
@app.post("/summarize")
|
||||
@@ -23,16 +24,17 @@ async def summarize_video(
|
||||
raise HTTPException(status_code=401, detail="Unauthorized")
|
||||
|
||||
title = req.title or "제목 없음"
|
||||
channel_name = req.channel_name or ""
|
||||
|
||||
try:
|
||||
video_id = extract_video_id(req.video_url)
|
||||
transcript = fetch_transcript(video_id)
|
||||
summary = summarize(transcript, title)
|
||||
await send_to_discord(title, req.video_url, summary)
|
||||
await send_to_discord(title, req.video_url, summary, channel_name)
|
||||
except SkipVideo as e:
|
||||
return {"status": "skipped", "title": title, "reason": str(e)}
|
||||
except Exception as e:
|
||||
await send_error_to_discord(title, req.video_url, e)
|
||||
await send_error_to_discord(title, req.video_url, e, channel_name)
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
return {"status": "ok", "title": title, "summary_length": len(summary)}
|
||||
|
||||
Reference in New Issue
Block a user