I want to change the download location to “Downloads” in pytube in Python. Can anyone tell me how to do this? Thanks in advance:)
Advertisement
Answer
Hope this helps:
JavaScript
x
9
1
from pytube import YouTube
2
3
youtube = YouTube('https://www.youtube.com/watch?v=5m8BAffnuA8&list=PLTgRMOcmRb3PQEztkPnMvAeehReJPoSNP')
4
5
my_video = youtube.streams.first()
6
7
my_video.download('~/Downloads')
8
9