|
-
Jul 29th, 2013, 03:55 PM
#1
Thread Starter
Hyperactive Member
get song title from youtube
hi,
how can i get the song title of a song, as fast as possible, the text in the box ------>

i'm downloading the song with webclient....
-
Jul 29th, 2013, 04:00 PM
#2
Re: get song title from youtube
I've don't work with the WebClient much, but in the HtmlDocument class you'd call GetElementByID. The ID for the title is: eow-title. From there you'd call GetAttribute, the attribute you're looking for is: title. But like I said, that's using the HtmlDocument class, I'm not sure about the WebClient, but I'm sure it isn't to much different.
-
Jul 29th, 2013, 04:01 PM
#3
Re: get song title from youtube
but I'm sure it isn't to much different.
Oooooooh yes it is!!!!!
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jul 29th, 2013, 04:14 PM
#4
Re: get song title from youtube
 Originally Posted by dunfiddlin
Oooooooh yes it is!!!!!
Sorry for my ignorance, I just never had to work with the WebClient. I'm sure a quick google search should pull up something more than asking for a full blown working piece of code, so that's my follow up with the OP :P
-
Jul 29th, 2013, 04:14 PM
#5
Re: get song title from youtube
 Originally Posted by dunfiddlin
Oooooooh yes it is!!!!!
Indeed since it's simply a string value.
vb Code:
Imports System.Net
Imports System.Text.RegularExpressions
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim url As String = "http://www.youtube.com/watch?v=jrNLsC_Y9Oo"
Dim source As String = Nothing
Dim uri As New Uri(url)
Using wClient As New WebClient
source = wClient.DownloadString(uri)
End Using
Dim rx As New Regex("(?<=<span id=""eow-title"" class=""watch-title long-title yt-uix-expander-head"" dir=""ltr"" title="").+(?="">)")
MessageBox.Show(rx.Match(source).Value)
End Sub
End Class
-
Jul 29th, 2013, 04:44 PM
#6
Re: get song title from youtube
Indeed since it's simply a string value.
That's assuming that it is the source that he's downloading. Not sure we have enough information to be confident of that.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jul 29th, 2013, 05:01 PM
#7
Thread Starter
Hyperactive Member
Re: get song title from youtube
@ident, that shows me an empty msgbox
-
Jul 29th, 2013, 05:06 PM
#8
Thread Starter
Hyperactive Member
Re: get song title from youtube
Im downloading the mp3 via another site using youtube
-
Jul 29th, 2013, 05:09 PM
#9
Re: get song title from youtube
That is illegal. Section 5b.
-
Jul 29th, 2013, 05:19 PM
#10
Thread Starter
Hyperactive Member
Re: get song title from youtube
 Originally Posted by dday9
Yes m8 it is but im only converting the vi..
-
Jul 29th, 2013, 05:21 PM
#11
Re: get song title from youtube
That doesn't matter what you're doing to it, you're still breaking the law. Which is not only against YouTube's terms, but also VBForums acceptable use policy. The acceptable use policy(AUP) is what you agreed to when signing up with VBForums and can be found at the bottom of any page your at on VBForums.
The rule I'm referring to in the AUP is:
You will not violate any laws nor to discuss illegal activities.
-
Jul 29th, 2013, 05:34 PM
#12
Thread Starter
Hyperactive Member
Re: get song title from youtube
Ok fair point, for the record; most peoples download from youtube these days.....
-
Jul 29th, 2013, 05:37 PM
#13
Re: get song title from youtube
Breaking the AUP is something that could get you banned from this forum. Please don't do it again.
Thread closed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|