Skip to content

Instantly share code, notes, and snippets.

@theawesomecoder61
Created January 4, 2014 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theawesomecoder61/8259903 to your computer and use it in GitHub Desktop.
Save theawesomecoder61/8259903 to your computer and use it in GitHub Desktop.
Working YouTube to MP3 Converter working as of January 2014. Enjoy! :)
' Just paste this in your form's code and enjoy!
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.youtube-mp3.org/")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox1.Text.StartsWith("http://www.youtube.com/watch?v=") Then
Button2.Enabled = True
Else
Button2.Enabled = False
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("youtube-url").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
Button3.Enabled = True
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim download_link As HtmlElement = WebBrowser1.Document.GetElementById("dl_link")
Dim links As HtmlElementCollection = download_link.GetElementsByTagName("a")
Dim link As String = links(2).GetAttribute("href")
System.Diagnostics.Process.Start(link)
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment