Suppose there are 10 videos in a playlist. It's simple to download the whole playlist, that is 1 to 10 videos, using a couple of pytube commands. How can we download, suppose 6 to 10? I am using 3.6.5 version.
I am currently using this code:
from pytube import Playlist
pl = Playlist("url")
pl.download_all('location')
You'll have to individually get each URL.
Try the following
from pytube import Playlist, YouTube
pl = Playlist("url")
pl.populate_video_urls()
for u in pl.video_urls[5:]:
YouTube(u).streams.first().download()