How to extract audio with youtube-dl on Windows

ffmpeg is not a Python module. Take a look at the code of youtube-dl in the FFmpegExtractAudioPP class.

It uses this call to figure out if the executable exists or not. It checks in your current path:

subprocess.Popen([exe, '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

You'll need to download the Windows builds of ffmpeg and put them in your current path, probably making sure that they do not have .exe at the end of their names.


A quick fix for Windows users:

  1. Download the ffmpeg package from http://ffmpeg.zeranoe.com/builds/, unzip it, copy ALL the contents of the Bin directory to the directory where youtube-dl.exe is located.
  2. Using DOS navigate to the directory where youtube-dl is located and run using the command:

    youtube-dl --extract-audio --audio-format mp3