Streamlit Videos Downloading Application
Learn how to choose a stream object to download videos.
We'll cover the following
Select a stream object to download
The YouTube object has an attribute called streams
. This is a StreamQuery
object. It has the following methods to get a stream object:
-
filter(res , progressive, only_audio, only_video)
: This method returns the list of streams based on the value of the parameters passed. Theres
parameter is a string while the others are booleans. Settingprogressive
toTrue
will only return the progressive streams. Settingonly_audio
toTrue
will return the streams with only audio components and similarly settingonly_video
toTrue
will only return the video components which do not have an audio component. This method returns aStreamQuery
object. -
first()
: It returns the first stream object in theStreamQuery
object. -
last()
: It returns the last stream object in theStreamQuery
object. -
get_highest_resolution()
: It returns a progressive stream object with the highest resolution. -
get_lowest_resolution()
: It returns a progressive stream object with the lowest resolution. -
get_by_itag(itag)
: If we want a specific stream object, we can pass it’sitag
.
Get hands-on with 1400+ tech skills courses.