Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,6 @@ st.set_page_config(
|
|
66 |
page_title="YouTube Talks",
|
67 |
page_icon='📽️'
|
68 |
)
|
69 |
-
col1, col2 = st.columns(2)
|
70 |
st.header('Query YouTube Videos!')
|
71 |
thumbnail_placeholder = st.empty()
|
72 |
st.sidebar.header("URL details:")
|
@@ -83,8 +82,8 @@ if submit_button:
|
|
83 |
# get video transcription
|
84 |
yt_obj = YouTube(video_url)
|
85 |
# display video thumbnail
|
86 |
-
|
87 |
-
|
88 |
# get transcription
|
89 |
get_yt_trans(yt_obj)
|
90 |
st.sidebar.subheader("Transcription:")
|
@@ -113,12 +112,10 @@ Question: {question}'''
|
|
113 |
|
114 |
if video_query_button:
|
115 |
# display video thumbnail
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
if st.session_state.chain is None:
|
120 |
st.error("Please transcribe a video first by submitting a URL.")
|
121 |
-
|
122 |
else:
|
123 |
main_ph.text("Fetching Results...")
|
124 |
# print results
|
|
|
66 |
page_title="YouTube Talks",
|
67 |
page_icon='📽️'
|
68 |
)
|
|
|
69 |
st.header('Query YouTube Videos!')
|
70 |
thumbnail_placeholder = st.empty()
|
71 |
st.sidebar.header("URL details:")
|
|
|
82 |
# get video transcription
|
83 |
yt_obj = YouTube(video_url)
|
84 |
# display video thumbnail
|
85 |
+
st.session_state.thumbnail_url = yt_obj.thumbnail_url
|
86 |
+
thumbnail_placeholder.image(st.session_state.thumbnail_url)
|
87 |
# get transcription
|
88 |
get_yt_trans(yt_obj)
|
89 |
st.sidebar.subheader("Transcription:")
|
|
|
112 |
|
113 |
if video_query_button:
|
114 |
# display video thumbnail
|
115 |
+
thumbnail_placeholder.image(st.session_state.thumbnail_url)
|
116 |
+
# if video not transcribed display error
|
|
|
117 |
if st.session_state.chain is None:
|
118 |
st.error("Please transcribe a video first by submitting a URL.")
|
|
|
119 |
else:
|
120 |
main_ph.text("Fetching Results...")
|
121 |
# print results
|