hi,
how can i get the song title of a song, as fast as possible, the text in the box ------>
http://s8.postimg.org/b884p68xf/youtube.png
i'm downloading the song with webclient....
Printable View
hi,
how can i get the song title of a song, as fast as possible, the text in the box ------>
http://s8.postimg.org/b884p68xf/youtube.png
i'm downloading the song with webclient....
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.
Oooooooh yes it is!!!!!Quote:
but I'm sure it isn't to much different.
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
That's assuming that it is the source that he's downloading. Not sure we have enough information to be confident of that.Quote:
Indeed since it's simply a string value.
@ident, that shows me an empty msgbox
Im downloading the mp3 via another site using youtube
That is illegal. Section 5b.
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:
Quote:
You will not violate any laws nor to discuss illegal activities.
Ok fair point, for the record; most peoples download from youtube these days.....
Breaking the AUP is something that could get you banned from this forum. Please don't do it again.
Thread closed.