9

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

0

1 Answer 1

12

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.

5
  • 2
    Btw, the default output path pattern is %(title)s-%(id)s.%(ext)s. Jun 9, 2017 at 18:19
  • Thanks for the clarification! I was just quoting from the man page Jun 9, 2017 at 18:21
  • Im using Windows 10 and have the current path pattern %%(playlist)s/%%(chapter_number)02d - %%(chapter)s/%%(playlist_index)02d - %%(title)s.%%(ext)s but still receive the same error. Any idea how to overcome this?
    – Computer
    Aug 7, 2020 at 19:19
  • This doesn't work for me. Even in /tmp and with sudo. Any ideas ? youtube-dl is installed from snap
    – smido
    Jul 29, 2022 at 19:56
  • Nice tune, bro..
    – smido
    Jul 30, 2022 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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