Spaces:
Runtime error
Runtime error
Fixed code repetition
Browse files
app.py
CHANGED
|
@@ -149,20 +149,6 @@ elif input_type == "Media":
|
|
| 149 |
else:
|
| 150 |
youtube_url = st.text_input("Enter YouTube URL here", placeholder="Enter URL to an YouTube video", label_visibility="visible")
|
| 151 |
if youtube_url:
|
| 152 |
-
|
| 153 |
-
try:
|
| 154 |
-
try:
|
| 155 |
-
with st.spinner("Fetching text from video..."):
|
| 156 |
-
text_to_summarize = get_text_from_youtube_url(youtube_url)
|
| 157 |
-
except:
|
| 158 |
-
with st.spinner("Captions not available. Downloading video..."):
|
| 159 |
-
get_yt_video(youtube_url)
|
| 160 |
-
text_to_summarize = get_text(url)
|
| 161 |
-
except:
|
| 162 |
-
st.error("Unable to fetch text from video. Please try a different video.")
|
| 163 |
-
text_to_summarize = None
|
| 164 |
-
else:
|
| 165 |
-
text_to_summarize = get_text(url)
|
| 166 |
-
st.markdown("#### Text from video:")
|
| 167 |
|
| 168 |
|
|
|
|
| 149 |
else:
|
| 150 |
youtube_url = st.text_input("Enter YouTube URL here", placeholder="Enter URL to an YouTube video", label_visibility="visible")
|
| 151 |
if youtube_url:
|
| 152 |
+
show_buttons("youtube_url", youtube_url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
|