Spaces:
Running
Running
seawolf2357
commited on
Commit
β’
2f81155
1
Parent(s):
d89edc0
Update app.py
Browse files
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'
|
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 |
-
|
76 |
-
|
|
|
|
|
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 |
-
|
84 |
-
|
|
|
|
|
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' νμ΄μ§ νμ
|