1

This is my code:

import pafy 

url = "youtube_url_here"
vid = pafy.new(url)
reso = vid.getbest()
reso.download()

Could anyone tell me how to set a location to save the video in instead of the working directory?, also how to make the program ask me what resolution I want to download ?

LastFox
  • 31
  • 3

1 Answers1

0

If you read the documentation of pafy you will find that you can pass a filename parameter to the download() function:

reso.download(filepath="/tmp/video." + reso.extension)

This is a Linux path though, so you might adjust it to use a Windows file path instead.

Drarig29
  • 1,902
  • 1
  • 19
  • 42