how to download youtube playlist using python

from pytube import Playlist
p = Playlist('https://www.youtube.com/playlist?list=PLGo0NLnuNoa-KKJPn8ZBRjksb8jaw4lz-')

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

for video in p.videos:
    print(video.title)
    st = video.streams.get_highest_resolution()
    st.download()
    #video.streams.first().download()

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.