a7m3dalbalawi

Function to get proxies

Jan 4th, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.53 KB | None | 0 0
  1. Function get_proxy()
  2.         '
  3.         '      ____  __.__                   .___                            
  4.         '     |    |/ _|__| ____    ____   __| _/____   _____   ______ ____  
  5.         '     |      < |  |/    \  / ___\ / __ |/  _ \ /     \ /  ___// ___\
  6.         '     |    |  \|  |   |  \/ /_/  > /_/ (  <_> )  Y Y  \\___ \\  \___
  7.         '     |____|__ \__|___|  /\___  /\____ |\____/|__|_|  /____  >\___  >
  8.         '             \/       \//_____/      \/            \/     \/     \/
  9.         '
  10.         '   I hope it is useful , instagram + snapchat : kingdomsc
  11.         '   How to use : dim proxy() as string = get_proxy
  12.         '
  13.         '
  14.         Dim returns As String = Nothing
  15.         Try
  16.             Dim config As String = New WebClient() With {.Proxy = Nothing}.DownloadString("https://pastebin.com/raw/JTXxi6pV")
  17.             For Each x As Match In Regex.Matches(config, "{(.*?)}-")
  18.                 Dim def As String = x.Groups.Item(1).Value
  19.                 Select Case def.Contains("patteren")
  20.                     Case False
  21.                         Dim url As String = Regex.Match(def, """url"": ""(.*?)""").Groups.Item(1).Value
  22.                         Try
  23.                             Dim urlinside As String = New WebClient() With {.Proxy = Nothing}.DownloadString(url)
  24.                             returns &= urlinside & vbNewLine
  25.                         Catch : GoTo error_hap : End Try
  26.                     Case True
  27.                         Dim url As String = Regex.Match(def, """url"": ""(.*?)""").Groups.Item(1).Value
  28.                         Dim urlinside As String = Nothing, patteren As String = Nothing
  29.                         Try
  30.                             urlinside = New WebClient() With {.Proxy = Nothing}.DownloadString(url)
  31.                         Catch : GoTo error_hap : End Try
  32.                         patteren = Regex.Match(def, """patteren"": ""(.*?)""").Groups.Item(1).Value
  33.                         Dim ret1 As String = Nothing
  34.                         For Each xx As Match In Regex.Matches(urlinside, patteren)
  35.                             If Split(xx.Groups.Item(1).Value, ".").Length > 3 Then
  36.                                 returns &= xx.Groups.Item(1).Value & ":" & xx.Groups.Item(2).Value & vbNewLine
  37.                             End If
  38.                         Next
  39.                 End Select
  40. error_hap:
  41.             Next
  42.             If returns.EndsWith(vbNewLine) Then returns = Mid(returns, 1, returns.Length - 1)
  43.             Return returns
  44.         Catch : Return "error" : End Try
  45.     End Function
Advertisement
Add Comment
Please, Sign In to add comment