download youtube videos using api python

Solutions on MaxInterview for download youtube videos using api python by the best coders in the world

showing results for - "download youtube videos using api python"
Juan Pablo
23 Oct 2016
1#download pytube with pip install pytube
2import pytube
3
4#made it a function so that you can call it from any script and just pass in
5#the url in ""
6def downloadVideo(url):
7    youtube = pytube.YouTube(url)
8    video = youtube.streams.get_highest_resolution()
9    print(video.title)
10    video.download()
11    
12