LOoLzeC

proxygrab.py

Feb 27th, 2019
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.42 KB | None | 0 0
  1. import requests,bs4,threading,sys
  2. gq=0
  3. found=[]
  4. print """
  5.  _____                    
  6. |  __ \                  
  7. | |__) | __ _____  ___   _
  8. |  ___/ '__/ _ \ \/ / | | | Grabber
  9. | |   | | | (_) >  <| |_| |
  10. |_|   |_|  \___/_/\_\\__,  |
  11.         By Deray      __/ |
  12.                      |___/
  13. """
  14. open("grabbed.txt","w").close()
  15.  
  16. def searchproxy(*args):
  17.     global gq,found
  18.     b=bs4.BeautifulSoup(
  19.         requests.get(
  20.             "https://www.proxynova.com/proxy-server-list/country-%s/"%(args[0])
  21.         ).text,
  22.     features="html.parser")
  23.     for x in b.find_all("abbr"):
  24.         for z in b.find_all("a",href=True):
  25.             k=z["href"]
  26.             if "8080" in k or "80" in k:
  27.                 pr="%s:%s"%(
  28.                 x["title"],z["href"].replace(
  29.                 "/proxy-server-list/port-","").replace("/",""))
  30.                 try:
  31.                     if requests.get(
  32.                     "http://dorayy.joomla.com",proxies={
  33.                     "http":pr,"https":pr},
  34.                     timeout=2).status_code == 200:
  35.                         found.append(pr)
  36.                         open("grabbed.txt","a").write(pr+"\n")
  37.                 except:
  38.                     gq+=1
  39.                     print "\r[Grabbing-\033[1;32m%s\033[0m: %s] - [found: %s -> grabbed.txt]"%(args[0],
  40.                     gq,len(found)),;sys.stdout.flush()
  41.                     pass
  42.                 break
  43.                
  44. pq=[]
  45. lang=['ar', 'bd', 'br', 'cl', 'cn', 'co', 'fr', 'de', 'hk', 'in', 'id', 'jp', 'ke', 'nl', 'pl', 'ru', 'rs', 'kr', 'tw', 'th', 'ua', 'gb', 'us', 've']
  46. for p in lang:
  47.     t=threading.Thread(target=searchproxy,args=(p,))
  48.     pq.append(t)
  49. for t in pq:
  50.     t.start()
  51. for t in pq:
  52.     t.join()
Advertisement
Add Comment
Please, Sign In to add comment