Voila c'est pour mon bot youtube , vous trouvez un erreur , ou une ligne manquante ?
Imports System.Net
Public Class F_Main
Dim TRead As New Threading.Thread(AddressOf OFD)
Dim TBoost As New Threading.Thread(AddressOf StartView)
Dim TBoost2 As New Threading.Thread(AddressOf StartView)
Dim TBoost3 As New Threading.Thread(AddressOf StartView)
Dim Prxyz As List(Of String) = New List(Of String)
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TRead.IsBackground = True
TRead.TrySetApartmentState(Threading.ApartmentState.STA)
TRead.Start()
UpdateLog(DateTime.Now + ": Threads created...")
End Sub
Private Sub OFD()
Using ofd As New OpenFileDialog
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
UpdateLog(DateTime.Now + ": Proxies loaded...")
Prxyz.AddRange(IO.File.ReadAllLines(ofd.FileName))
For Each Proxy As [String] In Prxyz
Add(Proxy)
Next
End If
End Using
End Sub
Sub UpdateLog(ByVal Item As [String])
If Me.ListBox2.InvokeRequired Then
Me.Invoke(DirectCast(Sub() ListBox2.Items.Add(Item), MethodInvoker))
Else
ListBox2.Items.Add(Item)
End If
End Sub
Sub Add(ByVal Item As [String])
If Me.ListBox1.InvokeRequired Then
Me.Invoke(DirectCast(Sub() ListBox1.Items.Add(Item), MethodInvoker))
Else
ListBox1.Items.Add(Item)
End If
End Sub
Sub AddViewCount(ByVal i As Int32)
If Label3.InvokeRequired Then
Me.Invoke(DirectCast(Sub() Label2.Text = "Views Added: " & CInt(Label2.Text.Split(":")(1)) + 1, MethodInvoker))
Else
Label2.Text = "Views Added: " & CInt(Label2.Text.Split(":")(1)) + 1
End If
End Sub
Private Sub View(ByVal URL As [String], prx As String, ByVal Views As Int32)
Try
UpdateLog(DateTime.Now + ": Viewing video...")
Dim logincookie As New CookieContainer
Dim postData As String = "referer=" + UserReferer()
Dim tempCookies As New CookieContainer
Dim encoding As New System.Text.UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(TextBox1.Text), HttpWebRequest)
postReq.Proxy = New WebProxy(prx)
postReq.Method = "POST"
postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = UserReferer()
postReq.UserAgent = UserAgent()
postReq.ContentLength = byteData.Length
Dim postreqstream As IO.Stream = postReq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
tempCookies.Add(postresponse.Cookies)
logincookie = tempCookies
UpdateLog(DateTime.Now + ": Successfully added view...")
Catch ex As Exception
UpdateLog(DateTime.Now + ": DEAD PROXY!")
End Try
UpdateLog(DateTime.Now + Void())
End Sub
Private Shared Random As New Random
Private Function Void() As [String]
Dim ar As String() = {": DEAD PROXY!", "Successfully added view..."}
Return ar(Random.Next(0, ar.Length - 1))
End Function
Private Function UserReferer() As [String]
UpdateLog(DateTime.Now + ": Requesting Referer...")
Static Referer As [String]() = _
{"
http://facebook.com",
"
http://twitter.com/"}
Return Referer(Random.Next(0, Referer.Length - 1))
End Function
Private Function UserAgent() As [String]
UpdateLog(DateTime.Now + ": Requesting Agents...")
Static Agents As [String]() = _
{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.26 Safari/537.11",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21",
"Mozilla/6.0 (Windows NT 6.2; WOW64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1",
"Mozilla/5.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4",
"mozilla/3.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/5.0.1",
"Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101213 Opera/9.80 (Windows NT 6.1; U; zh-tw) Presto/2.7.62 Version/11.01"}
Return Agents(Random.Next(0, Agents.Length - 1))
End Function
Dim Count As Int32 = 0
Dim url$ = ""
Private Sub StartView()
UpdateLog(DateTime.Now + ": Starting views...")
For i As Int32 = 0 To Count Step 1
View(url, Prxyz(i), 1)
AddViewCount(1)
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
UpdateLog(DateTime.Now + ": Initialized bot...")
Count = ListBox1.Items.Count
Button1.Enabled = False
url = TextBox1.Text
TBoost.IsBackground = True
TBoost.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost.Start()
TBoost2.IsBackground = True
TBoost2.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost2.Start()
TBoost3.IsBackground = True
TBoost3.TrySetApartmentState(Threading.ApartmentState.STA)
TBoost3.Start()
End Sub
Private Sub F_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Merci de votre aide