Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Module mp3skip
- Private count As Integer
- Public Function GetResult(ByVal query As String) As List(Of String)
- On Error Resume Next
- Dim wc As New Net.WebClient
- Dim temp As String = wc.DownloadString("http://mp3skip.eu/mp3/" & LCase(query.Replace(" ", "_")) & ".html")
- 'Get Song Names
- Dim songnames As New List(Of String)
- For Each mc As System.Text.RegularExpressions.Match In System.Text.RegularExpressions.Regex.Matches(temp, "<b>.*</b>")
- songnames.Add(mc.Value.Replace("<b>", Nothing).Replace("</b>", Nothing).Replace("&", Nothing).Replace("'", "'"))
- Next
- For i As Integer = 1 To 3
- songnames.RemoveAt(songnames.Count - 1)
- songnames.RemoveAt(songnames.Count - 1)
- songnames.RemoveAt(songnames.Count - 1)
- Next
- 'Get Mp3 Files
- Dim mp3urls As New List(Of String)
- For Each mc As System.Text.RegularExpressions.Match In System.Text.RegularExpressions.Regex.Matches(temp, "<a href=^.*^ rel=^nofollow^ target=^_blank^ style=^color:green;^>Download</a>".Replace("^", """"))
- mp3urls.Add(GetBetween(mc.Value, "href=" & """", """", 0))
- Next
- Return mp3urls
- End Function
- Private Function GetBetween(ByVal input As String, ByVal str1 As String, ByVal str2 As String, ByVal index As Integer) As String
- Dim temp As String = System.Text.RegularExpressions.Regex.Split(input, str1)(index + 1)
- Return System.Text.RegularExpressions.Regex.Split(temp, str2)(0)
- End Function
- End Module
Advertisement
Add Comment
Please, Sign In to add comment