9

I am trying to save youtube videos as MP3's in my downloads folder. However, this ends up saving files in the same directory as youtube-dl.

youtube-dl --extract-audio --audio-format mp3 --audio-quality=320k 
https://www.youtube.com/watch?v=VIDEO_ID 
--output C:/Users/Josue/Downloads/%(title)s.%(ext)s

I wanted the videos to save at:

C:/Users/Josue/Downloads/videotitle.mp3

however, they are saving as:

C:/youtube-dl/videotitle-videoID.mp3

Am I doing something incorrectly? I tried reading the documentation on Github, but I was still a bit confused.

Josue Espinosa
  • 5,009
  • 16
  • 47
  • 81

5 Answers5

9

I needed to put the options in the following order:

youtube-dl --output C:/Users/Josue/Downloads/%(title)s.%(ext)s
 --extract-audio --audio-format mp3 
 --audio-quality=320k https://www.youtube.com/watch?v=VIDEO_ID
Josue Espinosa
  • 5,009
  • 16
  • 47
  • 81
1

Try:

cd C:\Users\Josue\Downloads
C:\youtube-dl\youtube-dl --etc
Steve Barnes
  • 27,618
  • 6
  • 63
  • 73
1

This worked for me (for a unix environment):

youtube-dl https://www.youtube.com/watch?v=<video_id> --extract-audio --audio-format mp3 -o '/var/www/html/audio/%(id)s.%(ext)s' 
Krish
  • 917
  • 4
  • 10
  • 23
1

Windows - double %

%%(title)s.%%(ext)s

Garric
  • 591
  • 3
  • 10
0

you can create a configuration file to do this for you , just add those lines to your config file (if you have one, if not create it in C:/Users/Josue youtube-dl.conf) -o C:/Users/Josue/Downloads/%(title)s.%(ext)s . Link for details

J. Doe
  • 23
  • 1
  • 1
  • 10