Page 1 of 1

Youtube to mp3 downloader

Posted: Sun May 30, 2010 4:07 pm
by iAtomic
ummm how do i explain it...
kay it does what this site does :
http://www.video2mp3.net/
but in vb, is there a way to do that?

Re: Youtube to mp3 downloader

Posted: Sun May 30, 2010 7:28 pm
by mandai
Yes there is an easy way to download files in VB, if that is what you are asking for.
Code: Select all
        Dim wc As WebClient = New WebClient()
        Dim u As Uri = New Uri("http://localhost/file.mp3")

        Try
            wc.DownloadFile(u, "myfile.mp3")
        Catch ex As Exception
            MsgBox("Error: " & ex.Message)
            Return
        End Try
But if you want to provide users with the option to download files through your VB app (like a proxy) then that would be something else.

Re: Youtube to mp3 downloader

Posted: Sun May 30, 2010 8:54 pm
by Harlem9191
Mandai is right. To download files use the code he provided.
But if you're downloading youtube videos you would have to download the video as an flv first and then convert it into an mp3.

Re: Youtube to mp3 downloader

Posted: Sun May 30, 2010 10:51 pm
by zachman61
Yep that is exactly what they do

Re: Youtube to mp3 downloader

Posted: Sun May 30, 2010 11:15 pm
by iAtomic
is there a way to download it and convert it automatically?

Re: Youtube to mp3 downloader

Posted: Sun May 30, 2010 11:30 pm
by mandai
Yes, once you have the flv file you could use a program like ffmpeg to convert it.

Example:
Code: Select all
        Dim psi As ProcessStartInfo = New ProcessStartInfo()
        psi.FileName = "ffmpeg.exe"
        psi.Arguments = "-i video.flv video.mp3"
        Process.Start(psi)

Re: Youtube to mp3 downloader

Posted: Tue Jun 01, 2010 1:35 am
by zachman61
hmm seems to work thanks mandai thats going in my new youtube program lol

Re: Youtube to mp3 downloader

Posted: Wed Jun 02, 2010 7:38 pm
by iAtomic
i have no clue how to use that code
it looks like what i need tho