how to download youtube playlist using python

from pytube import Playlist
p = Playlist('')

print(f'Downloading: {p.title}')

for video in p.videos:
    st = video.streams.get_highest_resolution()

Here is what the above code is Doing:
1. We create a Playlist object by passing the URL of the playlist to the constructor.
2. We print the title of the playlist.
3. We iterate over the videos in the playlist.
4. For each video, we print its title.
5. We get the highest resolution stream of the video.
6. We download the stream.