Merge branch 'main' into feature-ssulbox
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
fde48e8674
24 files changed
+793
-104
No files matched your search
@@ -15,7 +15,8 @@ Video API Router
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Query
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Query, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
@@ -60,9 +61,10 @@ from app.video.worker.video_task import (
|
||||
_fail_and_refund,
|
||||
download_and_upload_video_to_blob,
|
||||
)
|
||||
from app.video.services.share_page import build_video_share_html, get_video_share_data
|
||||
|
||||
|
||||
from config import creatomate_settings
|
||||
from config import creatomate_settings, prj_settings
|
||||
|
||||
logger = get_logger("video")
|
||||
|
||||
@@ -956,6 +958,7 @@ async def get_all_videos(
|
||||
video_id=it.id,
|
||||
store_name=it.store_name,
|
||||
result_movie_url=it.movie_url,
|
||||
poster_url=it.poster_url,
|
||||
created_at=it.created_at,
|
||||
like_count=it.like_count,
|
||||
is_liked_by_me=it.is_liked_by_me,
|
||||
@@ -1077,6 +1080,43 @@ async def toggle_like(
|
||||
raise HTTPException(status_code=500, detail=f"좋아요 처리에 실패했습니다: {str(e)}")
|
||||
|
||||
|
||||
@router.get(
|
||||
"/share/{video_id}",
|
||||
response_class=HTMLResponse,
|
||||
summary="영상 공유용 Open Graph 페이지",
|
||||
description="영상별 제목, 설명, 포스터 메타데이터가 포함된 공개 HTML을 반환합니다.",
|
||||
responses={
|
||||
200: {"description": "공유 메타데이터 HTML 반환"},
|
||||
404: {"description": "공유 가능한 완료 영상을 찾을 수 없음"},
|
||||
},
|
||||
)
|
||||
async def get_video_share_page(
|
||||
video_id: int,
|
||||
request: Request,
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> HTMLResponse:
|
||||
"""공개 공유 페이지를 반환하고 일반 브라우저는 영상 상세로 이동시킵니다."""
|
||||
share_data = await get_video_share_data(session, video_id)
|
||||
if share_data is None:
|
||||
raise HTTPException(status_code=404, detail="공유 가능한 영상을 찾을 수 없습니다.")
|
||||
|
||||
share_url = str(request.url).split("?", maxsplit=1)[0]
|
||||
html = build_video_share_html(
|
||||
share_data,
|
||||
share_url=share_url,
|
||||
frontend_base_url=prj_settings.SHARE_FRONTEND_URL,
|
||||
configured_default_image_url=prj_settings.SHARE_DEFAULT_IMAGE_URL,
|
||||
)
|
||||
return HTMLResponse(
|
||||
content=html,
|
||||
headers={
|
||||
"Cache-Control": "public, max-age=300",
|
||||
"Referrer-Policy": "no-referrer",
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/{video_id}",
|
||||
summary="단일 영상 상세 조회",
|
||||
@@ -1153,6 +1193,7 @@ async def get_video_detail(
|
||||
return VideoDetailResponse(
|
||||
video_id=video.id,
|
||||
result_movie_url=video.result_movie_url,
|
||||
poster_url=video.poster_url,
|
||||
store_name=project.store_name,
|
||||
region=project.region or _extract_region_from_address(project.detail_region_info),
|
||||
created_at=video.created_at,
|
||||
|
||||
@@ -10,9 +10,11 @@ from sqlalchemy import (
|
||||
Index,
|
||||
Integer,
|
||||
String,
|
||||
Text,
|
||||
UniqueConstraint,
|
||||
func,
|
||||
)
|
||||
from sqlalchemy.dialects.mysql import JSON
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.database.session import Base
|
||||
@@ -40,6 +42,10 @@ class Video(Base):
|
||||
task_id: 영상 생성 작업의 고유 식별자 (UUID7 형식)
|
||||
status: 처리 상태 (pending, processing, completed, failed 등)
|
||||
result_movie_url: 생성된 영상 URL (S3, CDN 경로)
|
||||
poster_url: 영상 첫 프레임 포스터 이미지 URL (SNS 공유 og:image용)
|
||||
title: SNS 업로드 제목
|
||||
description: SNS 업로드 설명
|
||||
hashtags: SNS 해시태그 목록
|
||||
created_at: 생성 일시 (자동 설정)
|
||||
|
||||
Relationships:
|
||||
@@ -117,6 +123,30 @@ class Video(Base):
|
||||
comment="생성된 영상 URL",
|
||||
)
|
||||
|
||||
poster_url: Mapped[Optional[str]] = mapped_column(
|
||||
String(2048),
|
||||
nullable=True,
|
||||
comment="영상 첫 프레임 포스터 이미지 URL (SNS 공유용)",
|
||||
)
|
||||
|
||||
title: Mapped[Optional[str]] = mapped_column(
|
||||
String(100),
|
||||
nullable=True,
|
||||
comment="SNS 업로드 제목",
|
||||
)
|
||||
|
||||
description: Mapped[Optional[str]] = mapped_column(
|
||||
Text,
|
||||
nullable=True,
|
||||
comment="SNS 업로드 설명",
|
||||
)
|
||||
|
||||
hashtags: Mapped[Optional[list]] = mapped_column(
|
||||
JSON,
|
||||
nullable=True,
|
||||
comment="SNS 해시태그 목록",
|
||||
)
|
||||
|
||||
is_deleted: Mapped[bool] = mapped_column(
|
||||
Boolean,
|
||||
nullable=False,
|
||||
|
||||
@@ -5,7 +5,7 @@ Video API Schemas
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Literal, Optional
|
||||
from typing import Any, Dict, List, Literal, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
@@ -148,6 +148,7 @@ class VideoListItem(BaseModel):
|
||||
"region": "군산",
|
||||
"task_id": "019123ab-cdef-7890-abcd-ef1234567890",
|
||||
"result_movie_url": "http://localhost:8000/media/2025-01-15/video.mp4",
|
||||
"poster_url": "http://localhost:8000/media/2025-01-15/video.jpg",
|
||||
"created_at": "2025-01-15T12:00:00"
|
||||
}
|
||||
"""
|
||||
@@ -169,9 +170,17 @@ class VideoListItem(BaseModel):
|
||||
description="작업 고유 식별자 (ADO2 전용. 썰박스는 개념이 없어 빈 문자열)",
|
||||
)
|
||||
result_movie_url: Optional[str] = Field(None, description="영상 결과 URL")
|
||||
poster_url: Optional[str] = Field(None, description="영상 첫 프레임 포스터 이미지 URL")
|
||||
title: Optional[str] = Field(None, description="SNS 업로드 제목")
|
||||
description: Optional[str] = Field(None, description="SNS 업로드 설명")
|
||||
hashtags: Optional[List[str]] = Field(None, description="SNS 해시태그 목록")
|
||||
created_at: Optional[datetime] = Field(None, description="생성 일시")
|
||||
like_count: int = Field(0, description="좋아요 수")
|
||||
comment_count: int = Field(0, description="댓글 수 (대댓글 포함)")
|
||||
is_liked_by_me: bool = Field(
|
||||
False,
|
||||
description="현재 로그인 사용자가 좋아요를 눌렀는지",
|
||||
)
|
||||
|
||||
|
||||
class VideoThumbnailItem(BaseModel):
|
||||
@@ -190,7 +199,8 @@ class VideoThumbnailItem(BaseModel):
|
||||
)
|
||||
video_id: int = Field(..., description="콘텐츠 고유 ID (type 안에서만 유일)")
|
||||
store_name: str = Field(..., description="업체명")
|
||||
result_movie_url: str = Field(..., description="영상 URL — 프론트에서 <video> 태그 첫 프레임을 썸네일로 사용")
|
||||
result_movie_url: str = Field(..., description="영상 URL")
|
||||
poster_url: Optional[str] = Field(None, description="영상 첫 프레임 포스터 이미지 URL (썸네일 표시용)")
|
||||
created_at: datetime = Field(..., description="생성 일시")
|
||||
like_count: int = Field(..., description="좋아요 수")
|
||||
is_liked_by_me: bool = Field(..., description="현재 로그인 사용자가 좋아요를 눌렀는지 (비로그인은 항상 false)")
|
||||
@@ -206,6 +216,7 @@ class VideoDetailResponse(BaseModel):
|
||||
|
||||
video_id: int = Field(..., description="영상 고유 ID")
|
||||
result_movie_url: str = Field(..., description="영상 URL")
|
||||
poster_url: Optional[str] = Field(None, description="영상 첫 프레임 포스터 이미지 URL")
|
||||
store_name: Optional[str] = Field(None, description="업체명")
|
||||
region: Optional[str] = Field(None, description="지역명")
|
||||
created_at: datetime = Field(..., description="생성 일시")
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
"""영상 공유 링크용 Open Graph HTML 생성 서비스."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from html import escape
|
||||
from urllib.parse import urlsplit, urlunsplit
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.home.models import Project
|
||||
from app.video.models import Video
|
||||
|
||||
FALLBACK_FRONTEND_URL = "https://ado2.o2osolution.ai"
|
||||
DEFAULT_SHARE_IMAGE_PATH = "/assets/images/ado2_image.png"
|
||||
DEFAULT_SHARE_IMAGE_STATIC_PATH = "/static/images/ado2_image.png"
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class VideoShareData:
|
||||
"""공유 페이지에 필요한 영상 및 프로젝트 정보."""
|
||||
|
||||
video_id: int
|
||||
poster_url: str | None
|
||||
store_name: str
|
||||
region: str
|
||||
|
||||
|
||||
async def get_video_share_data(
|
||||
session: AsyncSession,
|
||||
video_id: int,
|
||||
) -> VideoShareData | None:
|
||||
"""공유 가능한 완료 영상을 프로젝트 정보와 함께 조회합니다."""
|
||||
result = await session.execute(
|
||||
select(
|
||||
Video.id,
|
||||
Video.poster_url,
|
||||
Project.store_name,
|
||||
Project.region,
|
||||
)
|
||||
.join(Project, Video.project_id == Project.id)
|
||||
.where(
|
||||
Video.id == video_id,
|
||||
Video.status == "completed",
|
||||
Video.is_deleted.is_(False),
|
||||
Project.is_deleted.is_(False),
|
||||
)
|
||||
)
|
||||
row = result.one_or_none()
|
||||
if row is None:
|
||||
return None
|
||||
|
||||
return VideoShareData(
|
||||
video_id=row.id,
|
||||
poster_url=row.poster_url,
|
||||
store_name=row.store_name,
|
||||
region=row.region,
|
||||
)
|
||||
|
||||
|
||||
def build_video_share_html(
|
||||
data: VideoShareData,
|
||||
*,
|
||||
share_url: str,
|
||||
frontend_base_url: str,
|
||||
configured_default_image_url: str = "",
|
||||
) -> str:
|
||||
"""영상별 OG 메타데이터와 상세 화면 이동 기능을 포함한 HTML을 생성합니다."""
|
||||
frontend_base = _normalise_frontend_base_url(frontend_base_url)
|
||||
detail_url = f"{frontend_base}/video/{data.video_id}"
|
||||
fallback_image_url = _resolve_default_image_url(
|
||||
configured_default_image_url,
|
||||
frontend_base,
|
||||
share_url=share_url,
|
||||
)
|
||||
image_url = _absolute_http_url(data.poster_url) or fallback_image_url
|
||||
|
||||
store_name = _normalise_text(data.store_name, "ADO2 영상")
|
||||
region = _normalise_text(data.region, "")
|
||||
title = f"{store_name} | ADO2"
|
||||
description = (
|
||||
f"{region} · {store_name} 어떤 내용이 들어가야할지 정해야 합니다. 기존 영상 업로드시에 생성되는 내용을 사용하려면 db에 저장하고 업로드 할때마다 변경되는 부분을 전부 수정해야 합니다."
|
||||
if region
|
||||
else "ADO2 AI 마케팅 영상"
|
||||
)
|
||||
|
||||
escaped_title = escape(title, quote=True)
|
||||
escaped_description = escape(description, quote=True)
|
||||
escaped_image_url = escape(image_url, quote=True)
|
||||
escaped_share_url = escape(_absolute_http_url(share_url) or detail_url, quote=True)
|
||||
escaped_detail_url = escape(detail_url, quote=True)
|
||||
|
||||
return f"""<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{escaped_title}</title>
|
||||
<meta name="description" content="{escaped_description}">
|
||||
<link rel="canonical" href="{escaped_share_url}">
|
||||
|
||||
<meta property="og:title" content="{escaped_title}">
|
||||
<meta property="og:description" content="{escaped_description}">
|
||||
<meta property="og:image" content="{escaped_image_url}">
|
||||
<meta property="og:image:alt" content="{escaped_title}">
|
||||
<meta property="og:url" content="{escaped_share_url}">
|
||||
<meta property="og:type" content="video.other">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="{escaped_title}">
|
||||
<meta name="twitter:description" content="{escaped_description}">
|
||||
<meta name="twitter:image" content="{escaped_image_url}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>{escaped_title}</h1>
|
||||
<p>{escaped_description}</p>
|
||||
<a id="continue-link" href="{escaped_detail_url}">영상 보기</a>
|
||||
</main>
|
||||
<script>
|
||||
window.location.replace(document.getElementById("continue-link").href);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
def _normalise_text(value: str | None, fallback: str) -> str:
|
||||
"""메타데이터용 텍스트에서 불필요한 공백을 제거합니다."""
|
||||
normalised = " ".join((value or "").split())
|
||||
return normalised or fallback
|
||||
|
||||
|
||||
def _normalise_frontend_base_url(value: str) -> str:
|
||||
"""프론트엔드 기준 URL을 안전한 절대 HTTP(S) URL로 정규화합니다."""
|
||||
absolute_url = _absolute_http_url(value) or FALLBACK_FRONTEND_URL
|
||||
parts = urlsplit(absolute_url)
|
||||
path = parts.path.rstrip("/")
|
||||
return urlunsplit((parts.scheme, parts.netloc, path, "", ""))
|
||||
|
||||
|
||||
def _resolve_default_image_url(
|
||||
configured_url: str,
|
||||
frontend_base: str,
|
||||
*,
|
||||
share_url: str = "",
|
||||
) -> str:
|
||||
"""포스터가 없을 때 사용할 기본 OG 이미지 URL을 반환합니다.
|
||||
|
||||
우선순위:
|
||||
1. ``SHARE_DEFAULT_IMAGE_URL`` (.env)
|
||||
2. 공유 API 호스트 ``/static/images/ado2_image.png``
|
||||
3. ``SHARE_FRONTEND_URL`` + ``/assets/images/ado2_image.png``
|
||||
"""
|
||||
configured_absolute_url = _absolute_http_url(configured_url)
|
||||
if configured_absolute_url:
|
||||
return configured_absolute_url
|
||||
|
||||
share_origin = _origin_from_url(share_url)
|
||||
if share_origin:
|
||||
return f"{share_origin}{DEFAULT_SHARE_IMAGE_STATIC_PATH}"
|
||||
|
||||
return f"{frontend_base}{DEFAULT_SHARE_IMAGE_PATH}"
|
||||
|
||||
|
||||
def _origin_from_url(value: str) -> str | None:
|
||||
"""URL에서 scheme + host(+port) origin만 추출합니다."""
|
||||
absolute_url = _absolute_http_url(value)
|
||||
if not absolute_url:
|
||||
return None
|
||||
|
||||
parts = urlsplit(absolute_url)
|
||||
return urlunsplit((parts.scheme, parts.netloc, "", "", ""))
|
||||
|
||||
|
||||
def _absolute_http_url(value: str | None) -> str | None:
|
||||
"""값이 절대 HTTP(S) URL인 경우에만 정리된 문자열을 반환합니다."""
|
||||
candidate = (value or "").strip()
|
||||
if not candidate:
|
||||
return None
|
||||
|
||||
try:
|
||||
parts = urlsplit(candidate)
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
if parts.scheme.lower() not in {"http", "https"} or not parts.hostname:
|
||||
return None
|
||||
return candidate
|
||||
@@ -73,6 +73,7 @@ class UnifiedItem:
|
||||
like_count: int = 0
|
||||
comment_count: int = 0
|
||||
is_liked_by_me: bool = False
|
||||
poster_url: Optional[str] = None
|
||||
|
||||
|
||||
# ──────────────────────────────────────────────
|
||||
@@ -190,6 +191,7 @@ def _video_branch(where: list, sort_by: str) -> Select:
|
||||
Video.result_movie_url.label("movie_url"),
|
||||
Video.created_at.label("created_at"),
|
||||
Video.task_id.label("task_id"),
|
||||
Video.poster_url.label("poster_url"),
|
||||
]
|
||||
if sort_by == SORT_LIKE:
|
||||
cols.append(_video_like_subq().label("sort_value"))
|
||||
@@ -208,6 +210,7 @@ def _ssul_branch(where: list, sort_by: str) -> Select:
|
||||
SsulContent.created_at.label("created_at"),
|
||||
# UNION 은 컬럼 수·순서가 양쪽 같아야 한다. 썰박스에는 task_id 가 없다.
|
||||
literal("").label("task_id"),
|
||||
SsulContent.poster_url.label("poster_url"),
|
||||
]
|
||||
if sort_by == SORT_LIKE:
|
||||
cols.append(_ssul_like_subq().label("sort_value"))
|
||||
@@ -399,6 +402,7 @@ def _to_items(rows) -> list[UnifiedItem]:
|
||||
movie_url=r.movie_url,
|
||||
created_at=r.created_at,
|
||||
task_id=r.task_id or "",
|
||||
poster_url=r.poster_url,
|
||||
)
|
||||
for r in rows
|
||||
]
|
||||
|
||||
@@ -17,6 +17,7 @@ from app.ssulbox.constants import JOB_TYPE_VIDEO as CREDIT_JOB_TYPE_VIDEO
|
||||
from app.video.models import Video
|
||||
from app.utils.upload_blob_as_request import AzureBlobUploader
|
||||
from app.utils.logger import get_logger
|
||||
from app.utils.video_poster import generate_and_store_poster
|
||||
|
||||
# 로거 설정
|
||||
logger = get_logger("video")
|
||||
@@ -81,7 +82,8 @@ async def _update_video_status(
|
||||
status: str,
|
||||
video_url: str | None = None,
|
||||
creatomate_render_id: str | None = None,
|
||||
) -> bool:
|
||||
poster_url: str | None = None,
|
||||
) -> int | None:
|
||||
"""Video 테이블의 상태를 업데이트합니다.
|
||||
|
||||
Args:
|
||||
@@ -89,9 +91,10 @@ async def _update_video_status(
|
||||
status: 변경할 상태 ("processing", "completed", "failed")
|
||||
video_url: 영상 URL
|
||||
creatomate_render_id: Creatomate render ID (선택)
|
||||
poster_url: 영상 첫 프레임 포스터 URL (선택)
|
||||
|
||||
Returns:
|
||||
bool: 업데이트 성공 여부
|
||||
int | None: 업데이트된 Video id. 대상이 없거나 실패하면 None.
|
||||
"""
|
||||
try:
|
||||
async with BackgroundSessionLocal() as session:
|
||||
@@ -116,19 +119,58 @@ async def _update_video_status(
|
||||
video.status = status
|
||||
if video_url is not None:
|
||||
video.result_movie_url = video_url
|
||||
if poster_url is not None:
|
||||
video.poster_url = poster_url
|
||||
await session.commit()
|
||||
logger.info(f"[Video] Status updated - task_id: {task_id}, status: {status}")
|
||||
return True
|
||||
return video.id
|
||||
else:
|
||||
logger.warning(f"[Video] NOT FOUND in DB - task_id: {task_id}")
|
||||
return False
|
||||
return None
|
||||
|
||||
except SQLAlchemyError as e:
|
||||
logger.error(f"[Video] DB Error while updating status - task_id: {task_id}, error: {e}")
|
||||
return False
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"[Video] Unexpected error while updating status - task_id: {task_id}, error: {e}")
|
||||
return False
|
||||
return None
|
||||
|
||||
|
||||
async def _try_generate_sns_metadata(video_id: int) -> None:
|
||||
"""SEO 생성 실패가 영상 완료 처리에 영향을 주지 않도록 격리합니다."""
|
||||
from app.social.services.seo_service import seo_service
|
||||
|
||||
try:
|
||||
async with BackgroundSessionLocal() as session:
|
||||
await seo_service.generate_and_save_for_video(video_id, session)
|
||||
await session.commit()
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"[VideoSEO] Failed to generate SNS metadata - video_id: {video_id}, error: {e}",
|
||||
exc_info=True,
|
||||
)
|
||||
|
||||
|
||||
async def _try_generate_poster(
|
||||
temp_file_path: Path,
|
||||
user_uuid: str,
|
||||
task_id: str,
|
||||
render_id: str,
|
||||
) -> str | None:
|
||||
"""포스터 생성 실패가 영상 생성 완료 처리에 영향을 주지 않도록 격리합니다."""
|
||||
try:
|
||||
return await generate_and_store_poster(
|
||||
video_path=temp_file_path,
|
||||
user_uuid=user_uuid,
|
||||
task_id=task_id,
|
||||
file_stem=render_id,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"[VideoPoster] Failed to generate poster - task_id: {task_id}, render_id: {render_id}, error: {e}",
|
||||
exc_info=True,
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
async def _download_video(url: str, task_id: str) -> bytes:
|
||||
@@ -204,8 +246,20 @@ async def download_and_upload_video_to_blob(
|
||||
blob_url = uploader.public_url
|
||||
logger.info(f"[download_and_upload_video_to_blob] Uploaded to Blob - task_id: {task_id}, url: {blob_url}")
|
||||
|
||||
poster_url = await _try_generate_poster(
|
||||
temp_file_path, user_uuid, task_id, creatomate_render_id
|
||||
)
|
||||
|
||||
# Video 테이블 업데이트 (creatomate_render_id로 특정 Video 식별)
|
||||
await _update_video_status(task_id, "completed", blob_url, creatomate_render_id)
|
||||
video_id = await _update_video_status(
|
||||
task_id,
|
||||
"completed",
|
||||
blob_url,
|
||||
creatomate_render_id,
|
||||
poster_url=poster_url,
|
||||
)
|
||||
if video_id is not None:
|
||||
await _try_generate_sns_metadata(video_id)
|
||||
|
||||
# 크레딧은 generate_video 에서 이미 선차감했다. 여기서 차감하지 않는다.
|
||||
|
||||
@@ -307,13 +361,20 @@ async def download_and_upload_video_by_creatomate_render_id(
|
||||
blob_url = uploader.public_url
|
||||
logger.info(f"[download_and_upload_video_by_creatomate_render_id] Uploaded to Blob - creatomate_render_id: {creatomate_render_id}, url: {blob_url}")
|
||||
|
||||
poster_url = await _try_generate_poster(
|
||||
temp_file_path, user_uuid, task_id, creatomate_render_id
|
||||
)
|
||||
|
||||
# Video 테이블 업데이트
|
||||
await _update_video_status(
|
||||
video_id = await _update_video_status(
|
||||
task_id=task_id,
|
||||
status="completed",
|
||||
video_url=blob_url,
|
||||
creatomate_render_id=creatomate_render_id,
|
||||
poster_url=poster_url,
|
||||
)
|
||||
if video_id is not None:
|
||||
await _try_generate_sns_metadata(video_id)
|
||||
logger.info(f"[download_and_upload_video_by_creatomate_render_id] SUCCESS - creatomate_render_id: {creatomate_render_id}")
|
||||
|
||||
except httpx.HTTPError as e:
|
||||
|
||||
Reference in new issue
Block a user