import pafy
url = str(input("Youtube video URL :"))
video = pafy.new(url)
stream = video.streams
stream[0].download()
In stream[0].download()
, add a string argument with your desired filename and extension, for example stream[0].download("example.mp4")
.
See the docs for more info.