Skip to content

Specifying the download location ... #39

Discussion options

You must be logged in to vote

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

* desired name would be `yt.publish_date`.audio.webm // `yt.publish_date`.video.webm

Or the target download directory

* desired path would be `/opt/projects/mytube/downloads` as I tried to input to the helper function, but that doesn't seem to do anything.
    pytubefix.helpers.target_directory('/opt/projects/mytube/downloads')
    
    yt = pytubefix.YouTube(str(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().d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thisguyshouldworkforus
Comment options

Answer selected by thisguyshouldworkforus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants