Created
January 4, 2014 19:58
-
-
Save theawesomecoder61/8259903 to your computer and use it in GitHub Desktop.
Working YouTube to MP3 Converter working as of January 2014. Enjoy! :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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