Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function login_acc(username As String, password As String, cc As CookieContainer, Optional proxy As String = "") As String
- Try
- Dim login_page_source As String = page_source("http://www.pornhub.com/login", proxy, cc)
- Dim m1 As Match = Regex.Match(login_page_source, "<input type=""hidden"" class=""js-redirect"" name=""redirect"" value="".*"" />")
- Dim m2 As Match = Regex.Match(login_page_source, "<input type=""hidden"" name=""login_key"" id=""login_key"" value="".*"" />")
- Dim m3 As Match = Regex.Match(login_page_source, "<input type=""hidden"" name=""login_hash"" id=""login_hash"" value="".*"" />")
- Dim sp() As String
- Dim redirect_v As String
- Dim login_key_v As String
- Dim login_hash_v As String
- sp = m1.Value.Split("""")
- redirect_v = sp(7)
- sp = m2.Value.Split("""")
- login_key_v = sp(7)
- sp = m3.Value.Split("""")
- login_hash_v = sp(7)
- Dim login_data As String = "loginPage=1&redirectTo=&redirect=" & redirect_v & "&login_key=" & login_key_v & "&login_hash=" & login_hash_v & "&username=" & username & "&password=" & password
- Dim login_req As String = API_Request("http://www.pornhub.com/front/login_json", login_data, proxy, cc)
- If login_req.Contains("{""success"":1") Then
- Return "S"
- Else
- Return "E"
- End If
- Catch ex As Exception
- Return "E"
- End Try
- End Function
- Private Function API_Request(url As String, postData As String, proxy As String, CC As CookieContainer) As String
- Try
- Dim request As Net.HttpWebRequest = Net.HttpWebRequest.Create(url)
- Dim cd As New System.Net.Mime.ContentDisposition
- cd.FileName = "âĒC:\Users\Flabi\Desktop\baby hot.mp4"
- With request
- .Timeout = 8000
- .ContentType = "application/x-www-form-urlencoded"
- .Method = "POST"
- .ContentLength = postData.Length
- .CookieContainer = CC
- .ServicePoint.Expect100Continue = False
- .UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
- .KeepAlive = False
- .UnsafeAuthenticatedConnectionSharing = False
- End With
- If proxy.Length > 1 Then
- Dim myProxy As New Net.WebProxy(proxy)
- request.Proxy = myProxy
- End If
- Dim requestStream As Stream = request.GetRequestStream()
- Dim postBytes As Byte() = Encoding.ASCII.GetBytes(postData)
- requestStream.Write(postBytes, 0, postBytes.Length)
- requestStream.Close()
- Dim response As HttpWebResponse = request.GetResponse()
- Dim server_response As String
- Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
- server_response = reader.ReadToEnd()
- reader.Dispose()
- requestStream.Dispose()
- response.Dispose()
- Return server_response
- Catch ex As Exception
- Return "error"
- End Try
- End Function
- Private Function page_source(ByVal URL As String, proxy As String, CC As CookieContainer) As String
- Try
- Dim req As Net.HttpWebRequest = Net.HttpWebRequest.Create(URL)
- With req
- .CookieContainer = CC
- .Timeout = 8000
- .UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
- End With
- If proxy.Length > 1 Then
- Dim myProxy As New Net.WebProxy(proxy)
- req.Proxy = myProxy
- End If
- Dim res As Net.HttpWebResponse = req.GetResponse()
- Dim strm As New IO.StreamReader(res.GetResponseStream())
- Dim html As String = strm.ReadToEnd()
- strm.Dispose()
- res.Dispose()
- Return html
- Catch ex As Exception
- Return "error"
- End Try
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement