Spaces:
Sleeping
Sleeping
GameReview
commited on
Commit
•
f049331
1
Parent(s):
fbdc246
Add channel name
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def get_vid_details(youtube_link):
|
|
28 |
id= youtube_id
|
29 |
)
|
30 |
response = request.execute()
|
31 |
-
return response['items'][0]['snippet']['title'],response['items'][0]['snippet']['thumbnails']['high']['url']
|
32 |
|
33 |
#In case we ever want all comments
|
34 |
def get_all_comments(youtube_id):
|
@@ -192,7 +192,8 @@ with gr.Blocks() as app:
|
|
192 |
with gr.Tab("Video Details"):
|
193 |
input = gr.Textbox(label="Youtube URL", placeholder = "Place link here")
|
194 |
title = gr.Textbox(label="Title")
|
|
|
195 |
thumbnail = gr.Image(label="Thumbnail")
|
196 |
info_btn = gr.Button("Get Video Info!")
|
197 |
-
info_btn.click(fn=get_vid_details, inputs=input, outputs=[title,thumbnail])
|
198 |
app.launch()
|
|
|
28 |
id= youtube_id
|
29 |
)
|
30 |
response = request.execute()
|
31 |
+
return response['items'][0]['snippet']['title'],response['items'][0]['snippet']['channelTitle'],response['items'][0]['snippet']['thumbnails']['high']['url']
|
32 |
|
33 |
#In case we ever want all comments
|
34 |
def get_all_comments(youtube_id):
|
|
|
192 |
with gr.Tab("Video Details"):
|
193 |
input = gr.Textbox(label="Youtube URL", placeholder = "Place link here")
|
194 |
title = gr.Textbox(label="Title")
|
195 |
+
channel_name = gr.Textbox(label="Channel Name")
|
196 |
thumbnail = gr.Image(label="Thumbnail")
|
197 |
info_btn = gr.Button("Get Video Info!")
|
198 |
+
info_btn.click(fn=get_vid_details, inputs=input, outputs=[title,channel_name,thumbnail])
|
199 |
app.launch()
|