locked
How to extract mp3 audio from youtube video?

    Question

  • Hi,

       I need to get the audio in mp3 format from youtube videos through c# code in window 8. Can anyone tell me how I can extract audio from youtube video. I have youtube video urls and I have to extract the audio from there. 

       Please update me if anyone knows how to do this. And also provide some demo code if possible.

       Thank You!

    Friday, December 26, 2014 9:25 AM

Answers

  • Hi,

    there is a .NET library called YoutubeExtractor that allows to download videos from Youtube and/or extract their audio track. More information about the library:

    • https://github.com/flagbug/YoutubeExtractor
    Friday, December 26, 2014 10:02 AM

All replies

  • Hi,

    there is a .NET library called YoutubeExtractor that allows to download videos from Youtube and/or extract their audio track. More information about the library:

    • https://github.com/flagbug/YoutubeExtractor
    Friday, December 26, 2014 10:02 AM
  • Thanks for reply.

    I tried YoutubeExtractor but it doesn't work in window 8 apps. 

    I am getting following error when I am trying to install YoutubeExtractor through Nuget in winrt app:

    Install-Package : Could not install package 'YoutubeExtractor 0.10.4.1'. You are trying to install this package into a project that targets 
    '.NETCore,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact 
    the package author.
    At line:1 char:1
    + Install-Package YoutubeExtractor
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

    It works only deskop applications and websites.

    Is there any way to use YoutubeExtractor in window 8? If yes then please tell me how I can do this?

    Thank You!


    • Edited by Anand Dubey Friday, December 26, 2014 11:51 AM
    Friday, December 26, 2014 11:05 AM
  • Hi Anand,

    As I can see from the github: https://github.com/flagbug/YoutubeExtractor, looks like YoutubeExtractor does support WinRT.

    I also tried on my app, it works fine, looks like the version 0.10.4.1 has been installed.

    Try to create a Blank app and install the YoutubeExtractor on it.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, January 7, 2015 6:08 AM
    Moderator