我有一个使用 python pafy 模块下载视频的代码
默认情况下,它会下载我的.py
文件所在的视频。但我希望 WindowsDownloads
文件夹作为下载视频的目的地。我该怎么做?提前致谢
import pafy
url = "video_url"
video = pafy.new(url)
#all streams
streams = video.streams
#best video
best = video.getbest()
#download
try:
best.download()
except Exception as e:
print ("Error Downloading video")
else:
print ("Video Downloaded Successfully")