seawolf2357 commited on
Commit
803d7a3
·
verified ·
1 Parent(s): 1c363e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -32,9 +32,10 @@ def search_videos(keyword):
32
  response = requests.get(url, headers=headers, params=params)
33
  data = response.json()
34
 
35
- # 검색된 비디오의 URL을 리스트로 추출
36
- video_urls = [video['video_files'][0]['link'] for video in data['videos']]
37
- return video_urls
 
38
 
39
  with gr.Blocks() as demo:
40
  with gr.Tabs():
@@ -45,7 +46,7 @@ with gr.Blocks() as demo:
45
 
46
  with gr.Tab("비디오 검색"):
47
  video_search_input = gr.Textbox(label="검색 키워드")
48
- video_search_output = gr.Gallery(label="검색된 비디오")
49
  video_search_input.change(search_videos, inputs=video_search_input, outputs=video_search_output)
50
 
51
  demo.launch()
 
32
  response = requests.get(url, headers=headers, params=params)
33
  data = response.json()
34
 
35
+ # 검색된 비디오의 URL을 Markdown 링크로 변환
36
+ video_links = [f"[Video Link]({video['video_files'][0]['link']})" for video in data['videos']]
37
+ markdown_links = "\n".join(video_links)
38
+ return markdown_links
39
 
40
  with gr.Blocks() as demo:
41
  with gr.Tabs():
 
46
 
47
  with gr.Tab("비디오 검색"):
48
  video_search_input = gr.Textbox(label="검색 키워드")
49
+ video_search_output = gr.Markdown(label="검색된 비디오")
50
  video_search_input.change(search_videos, inputs=video_search_input, outputs=video_search_output)
51
 
52
  demo.launch()