Is it possible to extract audio from a Youtube video using Mathematica? I have looked at this post and figured out that it is impossible to download videos with the Youtube API. Are there any possible workarounds?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
I'm not sure, if it is possible to do that directly in Mathematica, but there is a command line tool called youtube-dl. It allows the direct extraction of the audio by using the
-x option, see here Post-processing Options.
youtube-dl https://www.youtube.com/watch?v=jNQXAC9IVRw -x --audio-format mp3 -o "only_audio.%(ext)s"
The audio will be saved in a file called
You can use
Run to run the command directly from Mathematica.