Specifying the download location ... #39
Answered
by
JuanBindez
thisguyshouldworkforus
asked this question in
Q&A
Replies: 1 comment 1 reply
-
try: from pytubefix import YouTube
file_path = '/opt/projects/mytube/downloads'
VIDEO = "url here"
yt = YouTube(VIDEO, use_oauth=True, allow_oauth_cache=True)
# Construct the Audio Object
yta = yt.streams.filter(adaptive=True, mime_type="audio/webm"abr="160kbps").first().download(output_path=file_path)
# Construct the Video Object
ytv = yt.streams.filter(adaptive=True, mime_type="video/ webm",res="1080p",).first().download(output_path=file_path) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
thisguyshouldworkforus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do I specify the target download directory for the Audio/Video objects?
Despite the code below, I cannot seem to change either the download filename
yt.publish_date
.audio.webm //yt.publish_date
.video.webmOr the target download directory
/opt/projects/mytube/downloads
as I tried to input to the helper function, but that doesn't seem to do anything.Any / all help on this topic would be greatly appreciated!
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions