ProgrammerNazaryman

Mynakal Downloader

Sep 3rd, 2014
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.88 KB | None | 0 0
  1. 'SOS KOD BY NOENTRYPHC'
  2. 'PHANTOMCREWS'
  3. '2011-2014'
  4. 'PROJEK : MYNAKAL DOWNLOADER VB.NET'
  5. Imports System.Net
  6. Imports System.Text.RegularExpressions
  7.  
  8. Public Class Form1
  9.    
  10.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  11.         If TextBox1.Text = "" Then
  12.             gileha.Text = "Masukkan link video!!"
  13.         Else
  14.             TextBox2.Text = ""
  15.             TextBox3.Text = ""
  16.             gileha.Text = "Checking Video.."
  17.             Dim request As HttpWebRequest = HttpWebRequest.Create(TextBox1.Text)
  18.             request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
  19.             Dim response As HttpWebResponse = request.GetResponse
  20.             Dim source As String = New IO.StreamReader(response.GetResponseStream).ReadToEnd
  21.             If source.Contains("This video cannot be found. Are you sure you typed in the correct url?") Then
  22.                 gileha.Text = "Video not founded"
  23.                 TextBox1.Text = ""
  24.             Else
  25.                 gileha.Text = "Generating download link"
  26.                 If TextBox1.Text.Contains("http://www.mynakal.com/video/") Then
  27.                     TextBox1.Text = TextBox1.Text.Replace("http://www.mynakal.com/video/", "")
  28.                     If TextBox1.Text.Contains("/") Then
  29.                         TextBox1.Text = TextBox1.Text.Replace("/", "")
  30.                     End If
  31.  
  32.                     Dim jaja As HttpWebRequest = HttpWebRequest.Create("http://www.mynakal.com/media/player/config.php?vkey=" + TextBox1.Text)
  33.                     jaja.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
  34.                     Dim response2 As HttpWebResponse = jaja.GetResponse
  35.                     Dim source2 As String = New IO.StreamReader(response2.GetResponseStream).ReadToEnd
  36.                     RichTextBox1.Text = source2
  37.  
  38.                     Dim formula As String = "<src>([^<]*)</src>"
  39.                     For Each item As Match In (New Regex(formula)).Matches(RichTextBox1.Text)
  40.                         TextBox2.AppendText(item.Groups(1).Value)
  41.                         TextBox3.Text = TextBox1.Text
  42.                         gileha.Text = "Done"
  43.                     Next
  44.  
  45.                     If TextBox2.Text.Contains("http://www.mynakal.com/media/player/ads.php") Then
  46.                         TextBox2.Text = TextBox2.Text.Replace("http://www.mynakal.com/media/player/ads.php", "")
  47.  
  48.                     End If
  49.  
  50.                     TextBox1.Text = "http://www.mynakal.com/video/" + TextBox1.Text
  51.                 End If
  52.             End If
  53.         End If
  54.        
  55.     End Sub
  56.  
  57.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  58.         TextBox3.Enabled = False
  59.     End Sub
  60. End Class
Advertisement
Add Comment
Please, Sign In to add comment