Search code examples
youtubemp3webmyoutube-dlm4a

youtube-dl downloads various formats


I'm trying to download a playlist from youtube and the songs are either downloaded in webm-format or m4a format. What I wanted was mp3. What am I doing wrong?

This is the command line i used:

youtube-dl -i --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" https://www.youtube.com/playlist\?list\=PLYhvw_t8ea5FqXXy2w_cduTGbcXwledsP


Solution

  • It needs to be in the following format.

    youtube-dl https://www.youtube.com/watch?v=dQw4w9WgXcQ --extract-audio --audio-format mp3
    

    you might get an error saying something about a probe, so install ffmpeg and that will fix the error.

    the output will look something like the following.

    [youtube] dQw4w9WgXcQ: Downloading webpage
    [youtube] dQw4w9WgXcQ: Downloading video info webpage
    [youtube] dQw4w9WgXcQ: Downloading js player vfls4aurX
    [download] Destination: Rick Astley - Never Gonna Give You Up (Video)-dQw4w9WgXcQ.webm
    [download] 100% of 3.28MiB in 00:00
    [ffmpeg] Destination: Rick Astley - Never Gonna Give You Up (Video)-dQw4w9WgXcQ.mp3
    Deleting original file Rick Astley - Never Gonna Give You Up (Video)-dQw4w9WgXcQ.webm (pass -k to keep)
    

    It will download the video, then convert it to mp3