Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Commit
β’
49ea093
1
Parent(s):
ef26ce8
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
|
|
1 |
from googleapiclient.discovery import build
|
2 |
import gradio as gr
|
3 |
|
4 |
-
# API ν€μ κ²μ μμ§ ID μ€μ
|
5 |
API_KEY = 'AIzaSyDUz3wkGal0ewRtPlzeMit88bV4hS4ZIVY'
|
6 |
CSE_ID = '56b34994f47704ddd'
|
7 |
|
@@ -16,7 +17,11 @@ def multi_search(query):
|
|
16 |
video_search_result = youtube.search().list(q=query, part='snippet', type='video', maxResults=5).execute()
|
17 |
video_results = [f"https://www.youtube.com/watch?v={item['id']['videoId']}" for item in video_search_result.get('items', [])]
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
20 |
|
21 |
iface = gr.Interface(
|
22 |
fn=multi_search,
|
|
|
1 |
+
|
2 |
from googleapiclient.discovery import build
|
3 |
import gradio as gr
|
4 |
|
5 |
+
# API ν€μ κ²μ μμ§ ID μ€μ
|
6 |
API_KEY = 'AIzaSyDUz3wkGal0ewRtPlzeMit88bV4hS4ZIVY'
|
7 |
CSE_ID = '56b34994f47704ddd'
|
8 |
|
|
|
17 |
video_search_result = youtube.search().list(q=query, part='snippet', type='video', maxResults=5).execute()
|
18 |
video_results = [f"https://www.youtube.com/watch?v={item['id']['videoId']}" for item in video_search_result.get('items', [])]
|
19 |
|
20 |
+
# κ²μ κ²°κ³Όλ₯Ό ννμ 리μ€νΈλ‘ λ³ν
|
21 |
+
web_results_tuples = [(url,) for url in web_results]
|
22 |
+
video_results_tuples = [(url,) for url in video_results]
|
23 |
+
|
24 |
+
return web_results_tuples, video_results_tuples
|
25 |
|
26 |
iface = gr.Interface(
|
27 |
fn=multi_search,
|