Spaces:
Build error
Build error
app.py
CHANGED
@@ -95,6 +95,10 @@ def display_vid(url, question):
|
|
95 |
#sample - smUHQndcmOY?start=234
|
96 |
html_out = "<iframe width='560' height='315' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
|
97 |
print(f"html output is : {html_out}")
|
|
|
|
|
|
|
|
|
98 |
#vid = YouTubeVideo('smUHQndcmOY&t=425s')
|
99 |
return html_out
|
100 |
|
@@ -110,12 +114,12 @@ with demo:
|
|
110 |
gr.Markdown("<h1><center>Ask a Question to a YouTube Video and get the timestamp where the probable answer is</center></h1>")
|
111 |
gr.Markdown(
|
112 |
"<div>How many times have you seen a long video/podcast on Youtube and wondered only if there would have been 'explanatory' timestamps it would have been so much better..</div>"
|
113 |
-
"<div>Well, using this Space/App you can provide a YouTube video link and then provide some questions that you would like, and the App will generate timestamps/play video at those timestamps for you in the space provided. Idea is that your question could be like 'Is this xxxx thing covered in the video?', or maybe 'does the host talks about the architecture of the model', or maybe 'Does host talk about alien doorway on Mars?' and so on.</div><br> <br> <div> This App is Work in Progress, please bear with me.<br><br></div>"
|
114 |
)
|
115 |
with gr.Row():
|
116 |
-
input_url = gr.Textbox() #gr.HTML(placeholder="Enter a video link here..")
|
117 |
-
input_ques = gr.Textbox()
|
118 |
-
output_vid = gr.HTML()
|
119 |
|
120 |
b1 = gr.Button("Publish Video")
|
121 |
#b2 = gr.Button("Generate Image")
|
|
|
95 |
#sample - smUHQndcmOY?start=234
|
96 |
html_out = "<iframe width='560' height='315' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
|
97 |
print(f"html output is : {html_out}")
|
98 |
+
|
99 |
+
#"<iframe width='560' height='315' src='https://www.youtube.com/embed/smUHQndcmOY&t?start=215' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
|
100 |
+
|
101 |
+
#<iframe width="560" height="315" src="https://www.youtube.com/embed/smUHQndcmOY?start=402" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
102 |
#vid = YouTubeVideo('smUHQndcmOY&t=425s')
|
103 |
return html_out
|
104 |
|
|
|
114 |
gr.Markdown("<h1><center>Ask a Question to a YouTube Video and get the timestamp where the probable answer is</center></h1>")
|
115 |
gr.Markdown(
|
116 |
"<div>How many times have you seen a long video/podcast on Youtube and wondered only if there would have been 'explanatory' timestamps it would have been so much better..</div>"
|
117 |
+
"<div>Well, using this Space/App you can provide a YouTube video link and then provide some questions that you would like, and the App will generate timestamps/play video at those timestamps for you in the space provided. Idea is that your question could be like 'Is this xxxx thing covered in the video?', or maybe 'does the host talks about the architecture of the model', or maybe 'Does host talk about alien doorway on Mars?' and so on.</div><br> <br> <div> This App is still little bit <Work in Progress> with some sharp edges still left, please bear with me.<br><br></div>"
|
118 |
)
|
119 |
with gr.Row():
|
120 |
+
input_url = gr.Textbox(label="Input a Youtube video link") #gr.HTML(placeholder="Enter a video link here..")
|
121 |
+
input_ques = gr.Textbox(label="Ask a Question")
|
122 |
+
output_vid = gr.HTML(label="Video will play at the answer timestamp")
|
123 |
|
124 |
b1 = gr.Button("Publish Video")
|
125 |
#b2 = gr.Button("Generate Image")
|