Jump to content
Raven

Trilulilu Downloader [SCR]

Recommended Posts

Imports System.IO
Imports System.Text.RegularExpressions
Imports System.Text.UTF32Encoding
Imports system.Net

Public Class Form1

Dim temp As String
Dim tempStr As String
Dim str As String
Dim userid2, hash2, server2, key2, download2, download4 As String
Dim userid As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Nothing Then
ToolStripStatusLabel1.Text = "No URL Found"
Else
Button1.Enabled = False

Dim client As New WebClient
temp = client.DownloadString(TextBox1.Text)
Dim pattern As String = (("so.addVariable.""userid.*"""))
Dim reg As New System.Text.RegularExpressions.Regex(pattern)
Dim ausgabe As String = reg.Match(temp).Value
userid = ausgabe


Dim testStr As String
testStr = userid


Dim s As String
s = testStr

Dim words() As String


words = Split(s)


Dim i As Integer
For i = 0 To UBound(words)

tempStr = Replace(words(i), "so.addVariable", "")
tempStr = Replace(tempStr, "(""userid"",", "")
tempStr = Replace(tempStr, """", "")
If Len(tempStr) > 0 Then
userid2 = tempStr



End If

Next


Call hash()
Call download()
End If




End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox4.Text = Nothing Then
ToolStripStatusLabel1.Text = "No URL Found"
Else
Button1.Enabled = False

Dim client As New WebClient
temp = client.DownloadString(TextBox4.Text)
Dim pattern As String = (("so.addVariable.""userid.*"""))
Dim reg As New System.Text.RegularExpressions.Regex(pattern)
Dim ausgabe As String = reg.Match(temp).Value
userid = ausgabe


Dim testStr As String
testStr = userid


Dim s As String
s = testStr

Dim words() As String


words = Split(s)


Dim i As Integer
For i = 0 To UBound(words)

tempStr = Replace(words(i), "so.addVariable", "")
tempStr = Replace(tempStr, "(""userid"",", "")
tempStr = Replace(tempStr, """", "")
If Len(tempStr) > 0 Then
userid2 = tempStr



End If

Next

Call hash()
Call download3()
End If

End Sub

Private Sub hash()
Dim pattern As String = (("so.addVariable.""hash.*"""))
Dim reg As New System.Text.RegularExpressions.Regex(pattern)
Dim ausgabe As String = reg.Match(temp).Value


Dim testStr As String
testStr = ausgabe


Dim s As String
s = ausgabe

Dim words() As String


words = Split(s)


Dim i As Integer
For i = 0 To UBound(words)

tempStr = Replace(words(i), "so.addVariable", "")
tempStr = Replace(tempStr, "(""hash"",", "")
tempStr = Replace(tempStr, """", "")
If Len(tempStr) > 0 Then
hash2 = (tempStr)



End If


Next


Call server()
End Sub
Private Sub server()
Dim pattern As String = (("so.addVariable.""server.*"""))
Dim reg As New System.Text.RegularExpressions.Regex(pattern)
Dim ausgabe As String = reg.Match(temp).Value


Dim testStr As String
testStr = ausgabe


Dim s As String
s = ausgabe

Dim words() As String


words = Split(s)


Dim i As Integer
For i = 0 To UBound(words)

tempStr = Replace(words(i), "so.addVariable", "")
tempStr = Replace(tempStr, "(""server"",", "")
tempStr = Replace(tempStr, """", "")
If Len(tempStr) > 0 Then
server2 = (tempStr)



End If

Next


Call key()
End Sub

Private Sub key()
Dim pattern As String = (("so.addVariable.""key.*"""))
Dim reg As New System.Text.RegularExpressions.Regex(pattern)
Dim ausgabe As String = reg.Match(temp).Value


Dim testStr As String
testStr = ausgabe


Dim s As String
s = ausgabe

Dim words() As String


words = Split(s)


Dim i As Integer
For i = 0 To UBound(words)

tempStr = Replace(words(i), "so.addVariable", "")
tempStr = Replace(tempStr, "(""key"",", "")
tempStr = Replace(tempStr, """", "")
If Len(tempStr) > 0 Then
key2 = (tempStr)



End If


Next



End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim saveFileDialog1 As System.Windows.Forms.SaveFileDialog

saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()

saveFileDialog1.CreatePrompt = True
saveFileDialog1.FileName = ""
saveFileDialog1.Title = "Unde Salvezi? :>"
saveFileDialog1.Filter = "Mp3 Files (*.mp3) |*.mp3;"
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
TextBox2.Text = (saveFileDialog1.FileName)

Else
MsgBox("Dc nu ai Salvat?")
End If
saveFileDialog1.Dispose()
saveFileDialog1 = Nothing




End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim saveFileDialog1 As System.Windows.Forms.SaveFileDialog

saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()

saveFileDialog1.CreatePrompt = True
saveFileDialog1.FileName = ""
saveFileDialog1.Title = "Unde Salvezi? :>"
saveFileDialog1.Filter = "FLV Files (*.flv) |*.flv;"
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
TextBox3.Text = (saveFileDialog1.FileName)

Else
MsgBox("Dc nu ai Salvat?")
End If
saveFileDialog1.Dispose()
saveFileDialog1 = Nothing

End Sub
Private Sub download()



download2 = "http://fs" + server2 + ".trilulilu.ro/stream.php?type=audio&hash=" + hash2 + "&username=" + userid2 + "&key=" + key2

My.Computer.Network.DownloadFile(download2, TextBox2.Text)
Me.ProgressBar2.Value = 0


ToolStripStatusLabel1.Text = "Download Complete!"


Button1.Enabled = True
End Sub

Private Sub download3()

download4 = "http://fs" + server2 + ".trilulilu.ro/stream.php?type=video&hash=" + hash2 + "&username=" + userid2 + "&key=" + key2

My.Computer.Network.DownloadFile(download4, TextBox3.Text)

ToolStripStatusLabel1.Text = "Download Complete!"


Button1.Enabled = True
End Sub





Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Width = 448
Height = 230
End Sub


End Class

Pastebin : VB.NET pastebin - collaborative debugging tool

Autor: Raven

Download full project:

RapidShare: 1-CLICK Web hosting - Easy Filehosting

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...