-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
29 lines (28 loc) · 953 Bytes
/
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
import streamlit as st
from pytube import YouTube
st.title('Youtube Video Downloader')
with st.form("form"):
link=st.text_input("Paste the link")
s_state1=st.form_submit_button("Enter")
if s_state1:
if link == "":
st.warning("Please paste link")
else:
yt = YouTube(link)
url=yt.thumbnail_url
st.image(url,width=650)
st.write(yt.title,yt.views)
st.title('Descriptions')
st.write(yt.description)
option = st.selectbox(
'Select type of download',
('Audio', '3gp', '720p'))
matches = ['audio', '3gp', '720p']
if st.button("download"):
video_object = YouTube(link)
if option=='Audio':
video_object.streams.get_audio_only().download()
elif option=='3gp':
video_object.streams.get_lowest_resolution().download()
elif option=='720p':
video_object.streams.get_highest_resolution().download()