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()