arxivgpt kim commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,9 @@ import os # 환경 변수에 접근하기 위해 추가
|
|
| 6 |
# 환경 변수에서 API 키를 읽어옵니다.
|
| 7 |
api_key = os.getenv("API_KEY")
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
def convert_google_drive_link(share_link):
|
| 10 |
file_id = share_link.split('/')[-2]
|
| 11 |
return f"https://drive.google.com/uc?export=download&id={file_id}"
|
|
@@ -28,7 +31,7 @@ def create_video(video_share_link, audio_share_link):
|
|
| 28 |
}
|
| 29 |
|
| 30 |
# API 호출 및 응답 처리
|
| 31 |
-
response = requests.post(api_url, json=payload, headers=headers)
|
| 32 |
if response.status_code == 200:
|
| 33 |
job_id = response.json()["id"]
|
| 34 |
status_url = f"{api_url}/{job_id}"
|
|
@@ -54,4 +57,5 @@ iface = gr.Interface(
|
|
| 54 |
description="구글 드라이브 공유된 mp4 파일과 오디오 파일을 합성하여 비디오를 생성합니다."
|
| 55 |
)
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
| 6 |
# 환경 변수에서 API 키를 읽어옵니다.
|
| 7 |
api_key = os.getenv("API_KEY")
|
| 8 |
|
| 9 |
+
# 여기에 실제 API 엔드포인트 주소를 할당합니다.
|
| 10 |
+
api_url = "https://api.synclabs.so/video"
|
| 11 |
+
|
| 12 |
def convert_google_drive_link(share_link):
|
| 13 |
file_id = share_link.split('/')[-2]
|
| 14 |
return f"https://drive.google.com/uc?export=download&id={file_id}"
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
# API 호출 및 응답 처리
|
| 34 |
+
response = requests.post(api_url, json=payload, headers=headers)
|
| 35 |
if response.status_code == 200:
|
| 36 |
job_id = response.json()["id"]
|
| 37 |
status_url = f"{api_url}/{job_id}"
|
|
|
|
| 57 |
description="구글 드라이브 공유된 mp4 파일과 오디오 파일을 합성하여 비디오를 생성합니다."
|
| 58 |
)
|
| 59 |
|
| 60 |
+
# Gradio 앱을 공개적으로 공유할 경우, share=True로 설정하세요.
|
| 61 |
+
iface.launch(share=True)
|