How do you change the download directory for youtube-dl

Viewed 5250

I am using youtube-dl for a Discord Music Bot, everything works perfectly until I use the 'play' command. An error occurs "Command raised an exception: DownloadError: ERROR: unable to open for writing: [Errno 13] Permission denied: 'National Anthem of USSR-U06jlgpMtQs.webm.part'" from what I have read (and what the error says) it is because youtube-dl doesn't have permission to download filed to a certain folder. So I'd imagine that an easy solution is to just change the download directory. I can't find anything on how to do it for python, so any help would be greatly appreciated!

Thanks,

1 Answers

Found on github's documentation for it.


Locate youtube-dl's config file from:

  1. Linux/macOS:

    • System-wide config : /etc/youtube-dl.conf
    • User-wide config : ~/.config/youtube-dl.conf
  2. Windows:

    • C:\Users\<username>\youtube-dl.conf
    • %APPDATA%\youtube-dl\config.txt

If non-existent, you can create it yourself.

Example file contents:

-o A:/path/to/file/%(title)s.%(ext)s

References:

Related