

On the other hand, Stream Object 3 and Stream Object 4 have progressive set to False implying it is a DASH stream. Both of them a vcodec property and a acodec property referring to video and audio respectively. Stream Object 1 and Stream Object 2 have progressive set to True implying it is a progressive stream. If you inspect the Stream object, you will notice each object has a boolean property called progressive. The video and audio components will have to be download separately and then merged together using a software. DASH streams are used to download videos in high resolution. A progressive stream has both the video and audio components while a DASH stream only has one of them. There are two types of streams Progressive and Dynamic Adaptive Streaming over HTTP (DASH). We will need to choose one of the streams and use it to download our video/audio. I have also truncated the output since it is pretty long. Step 4: Understanding the Stream Object print(yt.streams) We will be discussing them in the next step. The Youtube Object also has an attribute called streams. This URL can be used by streamlit’s image() function to display an image. thumbnail_url: The URL to the thumbnail image.The YouTube Object has many useful attributes, some of them are listed below The constructor of Youtube object requires the URL to be passed in as a parameter. I will be working with the following URL Step 3: Getting the Data for the Youtube videoįirst, we will need to create an instance of the YouTube object we imported from pytube. Every time the user types in an URL and hit’s enter, the app is re-run and the text_input() function will return the input URL We will need to store the URL inside a variable. Both of them take a string as a parameter and display it.įor the user input, we will use the text_input() function. We will be using streamlit’s title() and subheader() functions for the text.
