Hack Forums
[.NET] [TUT] VB.Net YouTube-Downloader and Video to Music Converter [TUT] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [TUT] VB.Net YouTube-Downloader and Video to Music Converter [TUT] (/showthread.php?tid=350365)

Pages: Pages 1 2 3


[TUT] VB.Net YouTube-Downloader and Video to Music Converter [TUT] - TheBlackMarket - Apr 4, 2010

Hello all Hackforums Members!
-----------------------------------------------------------------------------------------------------------------------------------------------------
|WARNING! YOUTUBE HAVE CHANGE THE HTML CODE IN THE WEBSITE. SO THE DOWNLOAD WILL MAYBE NOT WORK. But it always good to have this YouTube-Downloader.|
-----------------------------------------------------------------------------------------------------------------------------------------------------

Today i will make a tutorial on how to make a Youtube-Downloader and a Video to Music Converter!

Lets Start.

Code
1. Open Microsoft Visual Studio 2005/2008/2010 dosent matter what version of them.

Go to: File > New > Project... > Windows Forms Application (Name it "YouTube-Downloader").

Okay now you see a form. Go to Toolbox:

add:
Code
WebBrowser1 - (Visible = False)
Button1 - Name It: Scan
Button2 - Name It: Download
Button3 - Name It: Exit

Textbox1 (Visible = False) - ( In the TextBox1 type: javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + yt.getConfig('SWF_ARGS')['video_id'] + "&fmt=18&l=" + yt.getConfig('SWF_ARGS')['l'] + "&sk=" + yt.getConfig('SWF_ARGS')['sk'] + '&t=' + yt.getConfig('SWF_ARGS')['t']; )

Textbox2 (Visible = False) - ( In the TextBox2 type: javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + yt.getConfig('SWF_ARGS')['video_id'] + "&fmt=22&l=" + yt.getConfig('SWF_ARGS')['l'] + "&sk=" + yt.getConfig('SWF_ARGS')['sk'] + '&t=' + yt.getConfig('SWF_ARGS')['t']; )

Textbox3 (Visible = False) - ( In the TextBox3 type: javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + yt.getConfig('SWF_ARGS')['video_id'] + "&fmt=35&l=" + yt.getConfig('SWF_ARGS')['l'] + "&sk=" + yt.getConfig('SWF_ARGS')['sk'] + '&t=' + yt.getConfig('SWF_ARGS')['t']; )

TextBox4

Label1 - Name It: Insert YouTube URL Here :

RadioButton1 - Name It: High Quality MP4(H264)

RadioButton2 - Name it: High Definition 1280x720 MP4(H264)

RadioButton3 - Name It: Very Very High Quality FLV(H264)
Picture: [img]http://img43.imageshack.us/img43/4831/testyoutube.jpg[/img]

Right Click > View Code. Or just double click on the form. Now you see a white page with:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
-> Add the source here. <-
End Class

Source Code:

Code
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate(TextBox4.Text)
        Button1.Enabled = False
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If RadioButton1.Checked = True Then
            WebBrowser1.Navigate(TextBox1.Text)
        End If
        If RadioButton2.Checked = True Then
            WebBrowser1.Navigate(TextBox2.Text)
        End If
        If RadioButton3.Checked = True Then
            WebBrowser1.Navigate(TextBox3.Text)
        End If
        Button2.Enabled = False
        Button1.Enabled = True
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Button2.Enabled = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub

    Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Show()
    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        End
    End Sub

-------------------------------------------------------------------------------------------------------------------

CREDITS GO TO: XxXKiNgOfUnIvErSXxX on YouTube, for the YouTube-Downloader. Link: http://www.youtube.com/user/XxXKiNgOfUnIvErSXxX and Link to the Tutorial: http://www.youtube.com/watch?v=DpQOII-thZg&playnext_from=TL&videos=2duqsOVxU5w

-------------------------------------------------------------------------------------------------------------------

Video to Music Converter

Lets Start.

Code
1. Open Microsoft Visual Studio 2005/2008/2010 dosent matter what version of them.

Go to: File > New > Project... > Windows Forms Application (Name it "Video to Music Converter").

Okay now you see a form. Go to Toolbox:

add:

Code
Button1 - Name It: Open
Button2 - Name It: Convert
Label1 - Name It: File path :
Label2 - Name It: Convert to :
TextBox1
ComboBox1 - ( Go to Collection and add this:

.MP4
.MP3
.M4A
.WAV
.AVI
.WMV

and click OK

Picture: [img]http://img153.imageshack.us/img153/179/testmusictovideoconvert.jpg[/img]

Now we will add the source code.

Right Click > View Code. Or just double click on the form. Now you see a white page with:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
-> Add the source here. <-
End Class

Source Code:

Code
Public Class Form1

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBox1.SelectedItem = ".MP4"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If TextBox1.Text = "" Then
            MsgBox("Please select the file you with to convert", MsgBoxStyle.Critical, "Error")
        Else
            Dim type As String = ComboBox1.Text
            MsgBox("The file has sucsessfully been converted into a " & type & " file.", MsgBoxStyle.Information, "Sucsess")
            Dim oldFile As String = Mid(TextBox1.Text, 1, Len(TextBox1.Text) - 4)
            FileCopy(TextBox1.Text, oldFile + type)
        End If
    End Sub

    Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
        TextBox1.Text = OpenFileDialog1.FileName
    End Sub

--------------------------------------------------------------------------------------------------------

CREDITS GO TO: reconrey1292 on Youtube, for the Video to Music Converter. Link: http://www.youtube.com/watch?v=GgDWqGQ-tVY&playnext_from=TL&videos=cxYu06ct7J4

--------------------------------------------------------------------------------------------------------

Hope you like it 🤗 I just wanna share something good with you all!

I have type this tutorial. So Credits go to me, but the project and source codes and the movies goes to XxXKiNgOfUnIvErSXxX and reconrey1292

Thanks.


* - Joey K - Apr 4, 2010

Can you please use code tags?

But nice tutorial dude.


* - MadGod - Apr 4, 2010

nice tut mate... helpful!keep it up! ;)


* - cybr - Apr 4, 2010

CODE tags will help your thread format. Good share though.


* - easytorrentz - Apr 4, 2010

Awsome Bro ! I'll try this when i have installed Visual Studio!


* - TheBlackMarket - Apr 4, 2010

Thank you all! good that you like it.


* - pr0t0typ3 - Apr 4, 2010

Nice tut thank you
2
s
h
o
r
t


* - Fortified - Apr 4, 2010

Nice work man keep it up - Vouch!


* - Stinson - Apr 4, 2010

Very nice tut!


Love it ;)


* - Lotos - Apr 4, 2010

Great tut, keep it up.


* - TheBlackMarket - Apr 5, 2010

Thank you all! Good that you like it.


* - Mr Kewl - Apr 5, 2010

LOL you all guyz So much Expert @ these Stuff iam like a N00B in Vb.net


* - sirpereira - Apr 5, 2010

Does the YouTube Downloader still works?


* - codepoet - Apr 5, 2010

HOLY SHIT DUDE!!!!!....THIS IS AN EPIC RELEASE....


* - dunlop03 - Apr 6, 2010

Im sry but this is pure rubbish. Why do you guys always post these "converters" when all this code is actually doing is changing the file extension and in this case its not even doing that.

The code you've written opens a dialog box , allows you to select a file , press convert and you get a message saying the file has been converted. Can you guys not see that it does absolutly nothing else lol

"Im referring to the file converter part"