I am trying to use youtube-dl to download a video from youtube to a directory and this error pops up:

$ youtube-dl -o ~/Videos http://www.youtube.com/watch?v=P0YiWsAM0O8
[youtube] P0YiWsAM0O8: Downloading webpage
[youtube] P0YiWsAM0O8: Downloading video info webpage
[youtube] P0YiWsAM0O8: Extracting video information
[youtube] P0YiWsAM0O8: Downloading MPD manifest
WARNING: Your copy of avconv is outdated and unable to properly mux separate video and audio files, youtube-dl will download single file media. Update avconv to version 10-0 or newer to fix this.
ERROR: unable to open for writing: [Errno 21] Is a directory: '/home/sami/Videos

I am running Ubuntu 14.04 and the youtube-dl version 2017.06.05


The -o option tells youtube-dl how to format the target path and name of your videos (not only the directory). Kind of counter-intuitive.

From the youtube-dl(1) README or manual:

-o, --output TEMPLATE

Output filename template, see the "OUTPUT TEMPLATE" for all the info

So you need something like:

youtube-dl -o "$HOME/Videos/%(title)s.%(ext)s" 'http://www.youtube.com/watch?v=P0YiWsAM0O8'

To specify something other than the default of %(title)s-%(id)s.%(ext)s. I am guessing you most likely want to just move into your ~/Videos folder and run youtube-dl with no options there though.

| improve this answer | |
  • 2
    Btw, the default output path pattern is %(title)s-%(id)s.%(ext)s. – David Foerster Jun 9 '17 at 18:19
  • Thanks for the clarification! I was just quoting from the man page – Grayson Kent Jun 9 '17 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.