Click here to Skip to main content
13,354,132 members (55,837 online)
Click here to Skip to main content
Add your own
alternative version


12 bookmarked
Posted 4 May 2013

YouTube to mp3

, 4 May 2013
Rate this:
Please Sign up or sign in to vote.
Converting videos from YouTube to mp3


Hello! In this post, I'll show you my small new project. With this software, you can download Youtube videos as mp3 files. It works with where program sends commands that convert video and sends download link of mp3 file to the program.

Using the Code

To convert a video, you must do the following three steps:

  1. Submit a link of the video you want to convert.
  2. Send command to and get the download link of mp3 file.
  3. Download mp3 file.

Now see that in code!

  1. TextBox1 is textbox for video URL. Button2 is convert button. This code checks video URL. Place this code on Button1_Click event. Button1 is submit or check button.
    If TextBox1.Text.StartsWith("") Then
    	Button2.Enabled = True
    	Button2.Enabled = False
    End If  
  2. This code sends video URL and convert command. Button3 is download button. Place this code on Button2_Click event.
    WebBrowser1.Document.GetElementById("youtube-url").SetAttribute("value", TextBox1.Text)
    Button3.Enabled = True  
  3. This code starts downloading the mp3 file. Place this code on Button3_Click event.
    Dim download_link As HtmlElement = WebBrowser1.Document.GetElementById("dl_link")
    Dim links As HtmlElementCollection = download_link.GetElementsByTagName("a")
    Dim link As String = links(0).GetAttribute("href")
  4. This code navigates web browser to the webpage where converting starts. Put it on Form1_Load event.

In this project, you need TextBox1, Button1, Button2, Button3, WebBrowser1.


The source isn't available, but you can download the application here.

The software is available only in Serbian language!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Junior) LD Company
Serbia Serbia
Hello! My name is Dušan Lazić and I am coming from Serbia. I am 13 years old. I made my first software when I was 10. These 3 years I didn't progress to much so I stayed on VB.NET a long time. Only what I learned is just some basics from C#. Now, as 13 years old, I come to CodeProject to show people my work, and advance my programming skills and knowledge.

You may also be interested in...

Comments and Discussions

Questionyoutube to mp3 Pin
Member 1353404121-Nov-17 12:18
memberMember 1353404121-Nov-17 12:18 
Questionproblem Pin
Redwan Irheem30-Oct-15 2:42
memberRedwan Irheem30-Oct-15 2:42 
BugProblem? Pin
Member 982336220-Oct-14 16:38
memberMember 982336220-Oct-14 16:38 
GeneralYoutube to mp3 conveter Pin
Member 109942785-Aug-14 19:03
memberMember 109942785-Aug-14 19:03 
Questionwithout a server Pin
ReymonARG6-Jun-14 15:15
memberReymonARG6-Jun-14 15:15 
QuestionGreat job! Pin
hellothere614-Jan-14 9:33
memberhellothere614-Jan-14 9:33 
QuestionChanged API Pin
Blażej Szajrych15-Dec-13 2:13
memberBlażej Szajrych15-Dec-13 2:13 
Questiondoubt Pin
Member 876099726-May-13 21:35
memberMember 876099726-May-13 21:35 
AnswerRe: doubt Pin
josedavdo6-Jul-13 15:46
memberjosedavdo6-Jul-13 15:46 
AnswerRe: doubt Pin
Member 1242971930-Jun-16 6:20
memberMember 1242971930-Jun-16 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 4 May 2013
Article Copyright 2013 by lazicdusan9
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid