-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
50 lines (43 loc) · 1.23 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Imports
import youtube_dl
import streamlit as st
# ============================
# TO-DO
# Create a stramlit app which can take in URL from the user
# Validate that it is youtube URL using regex
# If passes the validation move on to downloading the caption in English if available.
# If not post the user that the caption was not available
# On sumbit allow user to have a text box with the summary populated
# Find out if the text box can contain the copy option so that the summary can be saved elsewhere as per needs
# ============================
# Download Caption
def closed_caption(url):
pass
# Summarizer
def summarizer(cc,fraction):
pass
# Main UI
def main():
st.title("Video Summarizer")
url = st.text_input(
"URL",
help="Currently we support Youtube URL",
)
cc = closed_caption(url)
fraction = st.slider(
"Length of Summary",
min_value=0.1,
max_value=1.0,
value=0.3,
step=0.1,
help="Adjust the Slider to Get varying Output Length",
)
summary = summarizer(cc,fraction)
if st.button("Get Summary"):
st.text_area(
"Summary",
value=summary,
height=300,
)
if __name__ == "__main__":
main()