How To Make Youtube Video To MP3 Converter In VB.NET

Hello, NiCz here
In this post, I will teach you how to make a YouTube to MP3 Converter

Ok, you will need this below:

1 WebBrowser (Visible - False)
2 Buttons (Button 1 - Convert) (Button 2 - Download MP3)










Codes :


FORM1_LOAD:
 
WebBrowser1.Navigate("http://www.youtube-mp3.org/")
        Button1.Enabled = False
 
 
 
WEBBROWSER1:
 
Dim text As String = WebBrowser1.DocumentText
 
        If text.Contains("submit-form") Then
            Button1.Enabled = True
        Else
            Button1.Enabled = False
            MsgBox("Could not connect to the internet!", MsgBoxStyle.Information, "Error")
        End If
 
 
BUTTON1 > CONVERT
 
WebBrowser1.Document.GetElementById("youtube-url").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
 
 
 
BUTTON2 > DOWNLOAD MP3
 
Dim dl_link As HtmlElement = WebBrowser1.Document.GetElementById("dl_link")
 
        Dim links As HtmlElementCollection = dl_link.GetElementsByTagName("a")
 
        Dim url As String = links(0).GetAttribute("href")
        System.Diagnostics.Process.Start(url)

8 comments

I simply couldn't leave your site prior to suggesting that I extremely enjoyed the usual information a person provide on your visitors? Is going to be back incessantly in order to check out new posts
My web blog mp3 players black friday

Reply

Help me "Dim url As String = links(0).GetAttribute("href")" eror

Reply

you send code complete please i speak spanish and i need code from proyect hight schools please.. juancatencio@gmail.com

Reply

error on line: Help me "Dim url As String = links(0).GetAttribute("href")"
Error msg, 0 could not be the index, it should be between 0 to -1

Reply

This sucks, it uses youtube-mp3.
You should be able to convert youtube to mp3 WITHOUT an external website!

Reply

This is my first time I have visited here. I found a lot of interesting stuff in your blog. From the volume of comments on your articles, I guess I am not the only one! keep up the impressive work.

Pic Bonus Claim

Reply

Thanks for that!
I searched for a youtube converter for hours and this works :-)

Thank you!

Reply

Post a Comment

Note: Only a member of this blog may post a comment.