seawolf2357 commited on
Commit
2f81155
β€’
1 Parent(s): d89edc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -61,27 +61,28 @@ def search_videos(keyword, per_page=80):
61
  videos = []
62
  if 'videos' in response:
63
  for video in response['videos']:
64
- # μ΅œκ³ ν•΄μƒλ„μ˜ λΉ„λ””μ˜€ 파일 링크λ₯Ό μ„ νƒν•©λ‹ˆλ‹€
65
  videos.append(video['video_files'][0]['link'])
66
  return videos
67
 
68
- # 'Search Image' λ˜λŠ” 'Search Video' 메뉴 선택 둜직이 μ μ ˆν•œ μœ„μΉ˜μ— μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€.
69
-
70
- # 예λ₯Ό λ“€μ–΄ 'Search Image' 선택 μ‹œ
71
  if selected_menu == "Free Stock" and st.session_state['current_sub_menu'] == "Search Image":
72
  keyword = st.text_input("Enter a keyword to search for images")
73
  if keyword:
74
  images = search_images(keyword)
75
- for img in images:
76
- st.image(img)
 
 
77
 
78
  # 'Search Video' 선택 μ‹œ
79
  if selected_menu == "Free Stock" and st.session_state['current_sub_menu'] == "Search Video":
80
  keyword = st.text_input("Enter a keyword to search for videos")
81
  if keyword:
82
  videos = search_videos(keyword)
83
- for video in videos:
84
- st.video(video)
 
 
85
 
86
 
87
  # 'Home' νŽ˜μ΄μ§€ ν‘œμ‹œ
 
61
  videos = []
62
  if 'videos' in response:
63
  for video in response['videos']:
 
64
  videos.append(video['video_files'][0]['link'])
65
  return videos
66
 
67
+ # 'Search Image' 선택 μ‹œ
 
 
68
  if selected_menu == "Free Stock" and st.session_state['current_sub_menu'] == "Search Image":
69
  keyword = st.text_input("Enter a keyword to search for images")
70
  if keyword:
71
  images = search_images(keyword)
72
+ cols = st.columns(3) # 3μ—΄λ‘œ 이미지 ν‘œμ‹œ
73
+ for idx, img in enumerate(images):
74
+ with cols[idx % 3]:
75
+ st.image(img)
76
 
77
  # 'Search Video' 선택 μ‹œ
78
  if selected_menu == "Free Stock" and st.session_state['current_sub_menu'] == "Search Video":
79
  keyword = st.text_input("Enter a keyword to search for videos")
80
  if keyword:
81
  videos = search_videos(keyword)
82
+ cols = st.columns(3) # 3μ—΄λ‘œ λΉ„λ””μ˜€ ν‘œμ‹œ
83
+ for idx, video in enumerate(videos):
84
+ with cols[idx % 3]:
85
+ st.video(video)
86
 
87
 
88
  # 'Home' νŽ˜μ΄μ§€ ν‘œμ‹œ