11

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

sami
  • 163

1 Answers1

13

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.