How do I programmatically extract the audio from a YouTube video? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this questionI'm trying to create a C# application which allows me to extract just the开发者_如何学Go audio from YouTube videos. I've come across sites that already do that, but I'm not sure how they actually work. What would be the best way to do this programmatically?
Thanks for any advice
Writing an application for this might be overkill. Existing tools already do a pretty good job, and it's hard to beat their simplicity:
wget http://www.youtube.com/get_video.php?video_id=... |
ffmpeg -i - audio.mp3
All done!
If your application needs to do something special with the audio afterwards, it would make sense to write an app for that part. But for just getting the audio out, shelling out to ffmpeg
will be a lot easier.
精彩评论