asta este metoda mea : Imports System.Text.RegularExpressions Imports System.IO Imports System.Net Imports System.Text Public Class Form1 Private WithEvents download As WebClient Public Function GetBetween(ByRef strSource As String, ByRef strStart As String, ByRef strEnd As String, Optional ByRef startPos As Integer = 0) As String Dim iPos As Integer, iEnd As Integer, lenStart As Integer = strStart.Length Dim strResult As String strResult = String.Empty iPos = strSource.IndexOf(strStart, startPos) iEnd = strSource.IndexOf(strEnd, iPos + lenStart) If iPos <> -1 AndAlso iEnd <> -1 Then strResult = strSource.Substring(iPos + lenStart, iEnd - (iPos + lenStart)) End If Return strResult End Function Private Sub WebBrowser1_Navigated(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated If My.Settings.Image = True Then RichTextBox1.Text = WebBrowser1.DocumentText getdatavariabiles() Dim a3 As String Dim data2 As String = RichTextBox1.Text a3 = GetBetween(data2, "<li class=""selected""><a href=""javascript:;"">", "</a></li>") If a3.Contains("Imagini") = True Then MsgBox("You may download this file") Button6.Enabled = True Button7.Enabled = False Else MsgBox("This file is not an image file !", MsgBoxStyle.Information) Button6.Enabled = False Button7.Enabled = True End If End If If My.Settings.Video = True Then RichTextBox1.Text = WebBrowser1.DocumentText getdatavariabiles() Dim a2 As String Dim data1 As String = RichTextBox1.Text a2 = GetBetween(data1, "<li class=""selected""><a href=""javascript:;"">", "</a></li>") If a2.Contains("Video") = True Then MsgBox("You may download this file") Button3.Enabled = True Button4.Enabled = False Else MsgBox("This file is not an video file !", MsgBoxStyle.Information) Button3.Enabled = False Button4.Enabled = True End If End If If My.Settings.Audio = True Then RichTextBox1.Text = WebBrowser1.DocumentText getdatavariabiles() Dim x As String Dim data As String = RichTextBox1.Text x = GetBetween(data, "selected=""selected"">", "</option>") If x.Contains("Muzica") = True Then MsgBox("You may download this file") Button1.Enabled = True Button2.Enabled = False Else MsgBox("This file is not an audio file !", MsgBoxStyle.Information) Button1.Enabled = False Button2.Enabled = True End If End If End Sub Public Sub getdatavariabiles() If My.Settings.Audio = True Then Dim username As String Dim hash As String Dim server As Integer Dim key As String Dim data As String = RichTextBox1.Text username = GetBetween(data, "so.addVariable(""userid"", """, """);") hash = GetBetween(data, "so.addVariable(""hash"", """, """);") server = GetBetween(data, "so.addVariable(""server"", """, """);") key = GetBetween(data, "so.addVariable(""key"", """, """);") TextBox2.Text = "http://fs" & server & ".trilulilu.ro/stream.php?type=audio&hash=" & hash & "&username=" & username & "&key=" & key End If If My.Settings.Video = True Then Dim username3 As String Dim hash3 As String Dim server3 As Integer Dim key3 As String Dim data3 As String = RichTextBox1.Text username3 = GetBetween(data3, "so.addVariable(""userid"", """, """);") hash3 = GetBetween(data3, "so.addVariable(""hash"", """, """);") server3 = GetBetween(data3, "so.addVariable(""server"", """, """);") key3 = GetBetween(data3, "so.addVariable(""key"", """, """);") TextBox2.Text = "http://fs" & server3 & ".trilulilu.ro/stream.php?type=video&hash=" & hash3 & "&username=" & username3 & "&key=" & key3 End If If My.Settings.Image = True Then Dim username1 As String Dim hash1 As String Dim server1 As Integer Dim key1 As String Dim data1 As String = RichTextBox1.Text username1 = GetBetween(data1, "so.addVariable(""userid"", """, """);") hash1 = GetBetween(data1, "so.addVariable(""hash"", """, """);") server1 = GetBetween(data1, "so.addVariable(""server"", """, """);") key1 = GetBetween(data1, "so.addVariable(""key"", """, """);") TextBox2.Text = "http://fs" & server1 & ".trilulilu.ro/stream.php?type=image&hash=" & hash1 & "&username=" & username1 & "&key=" & key1 End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim f As New SaveFileDialog f.Filter = "Mp3 File|*.mp3" f.InitialDirectory = "C:\" f.Title = "Save file " f.ShowDialog() If f.FileName = Nothing = True Then MsgBox("Nothing Selected", MsgBoxStyle.Exclamation) Timer1.Stop() Else Button1.Enabled = False Button2.Enabled = False Timer1.Start() Me.Text = Me.Text & Space(2) & "Downloading to :" & Space(1) & f.FileName download = New WebClient Dim url = TextBox2.Text Dim whereToSave = f.FileName ToolStripProgressBar1.Value = 0 ToolStripProgressBar1.Maximum = 100 Try download.DownloadFileAsync(New Uri(url), (whereToSave)) Catch ex As Exception MsgBox("Cannot download audio file", MsgBoxStyle.Critical) Button2.Enabled = True End Try End If End Sub Private Sub download_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles download.DownloadProgressChanged ToolStripProgressBar1.Visible = True ToolStripLabel1.Visible = True ToolStripLabel2.Visible = True ToolStripLabel3.Visible = True ToolStripLabel4.Visible = True ToolStripProgressBar1.Value = e.ProgressPercentage ToolStripLabel2.Text = e.ProgressPercentage & " %" ToolStripLabel4.Text = e.BytesReceived & " Bytes of " & e.TotalBytesToReceive & " Bytes" End Sub Private Sub done() ToolStripProgressBar1.Visible = False ToolStripLabel1.Visible = False ToolStripLabel2.Visible = False ToolStripLabel3.Visible = False ToolStripLabel4.Visible = False ToolStripLabel4.Text = "0 Bytes of 0 Bytes" ToolStripLabel2.Text = "0 %" ToolStripProgressBar1.Value = 0 Me.Text = "Trilulilu Audio/Video/Image Downloader v1.1 (By DrGrim)" Timer1.Stop() If My.Settings.Audio = True Then Button2.Enabled = True End If If My.Settings.Video = True Then Button4.Enabled = True End If If My.Settings.Image = True Then Button7.Enabled = True End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If ToolStripProgressBar1.Value = "100" Then done() MsgBox("File Downloaded Succesfully", MsgBoxStyle.Information) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Clik WebBrowser1.Navigate(TextBox1.Text) End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged If RadioButton1.Checked = True Then My.Settings.Audio = False My.Settings.Video = True My.Settings.Image = False Label1.Enabled = False Button1.Enabled = False Button2.Enabled = False TextBox1.Enabled = False Label2.Enabled = True Button4.Enabled = True TextBox3.Enabled = True Label3.Enabled = False Button7.Enabled = False TextBox4.Enabled = False End If End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged If RadioButton2.Checked = True Then My.Settings.Audio = True My.Settings.Video = False My.Settings.Image = False Label1.Enabled = True Button1.Enabled = False Button2.Enabled = True TextBox1.Enabled = True Label2.Enabled = False Button4.Enabled = False TextBox3.Enabled = False Label3.Enabled = False Button7.Enabled = False TextBox4.Enabled = False End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click WebBrowser1.Navigate(TextBox3.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim f As New SaveFileDialog f.Filter = "FLV File|*.flv" f.InitialDirectory = "C:\" f.Title = "Save file " f.ShowDialog() If f.FileName = Nothing = True Then MsgBox("Nothing Selected", MsgBoxStyle.Exclamation) Timer1.Stop() Else Button3.Enabled = False Button4.Enabled = False Timer1.Start() Me.Text = Me.Text & Space(2) & "Downloading to :" & Space(1) & f.FileName download = New WebClient Dim url = TextBox2.Text Dim whereToSave = f.FileName ToolStripProgressBar1.Value = 0 ToolStripProgressBar1.Maximum = 100 Try download.DownloadFileAsync(New Uri(url), (whereToSave)) Catch ex As Exception MsgBox("Cannot download video file", MsgBoxStyle.Critical) Button4.Enabled = True End Try End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click MsgBox("Caution!! " & vbNewLine & "Don't try downloading two files simultaneously (1 audio ,1 video) you may get an error ", MsgBoxStyle.Information) End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged If RadioButton3.Checked = True Then My.Settings.Audio = False My.Settings.Video = False My.Settings.Image = True Label1.Enabled = False Button1.Enabled = False Button2.Enabled = False TextBox1.Enabled = False Label2.Enabled = False Button4.Enabled = False TextBox3.Enabled = False Label3.Enabled = True Button7.Enabled = True TextBox4.Enabled = True End If End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click WebBrowser1.Navigate(TextBox4.Text) End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Dim f As New SaveFileDialog f.Filter = "JPG Fie|*.jpg" f.InitialDirectory = "C:\" f.Title = "Save file " f.ShowDialog() If f.FileName = Nothing = True Then MsgBox("Nothing Selected", MsgBoxStyle.Exclamation) Timer1.Stop() Else Button6.Enabled = False Button7.Enabled = False Timer1.Start() Me.Text = Me.Text & Space(2) & "Downloading to :" & Space(1) & f.FileName download = New WebClient Dim url = TextBox2.Text Dim whereToSave = f.FileName ToolStripProgressBar1.Value = 0 ToolStripProgressBar1.Maximum = 100 Try download.DownloadFileAsync(New Uri(url), (whereToSave)) Catch ex As Exception MsgBox("Cannot download image file", MsgBoxStyle.Critical) Button7.Enabled = True End Try End If End Sub End Class