SHARE
TWEET

Untitled

a guest Sep 19th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import time
  2.  
  3. from splinter import Browser
  4.  
  5. import asyncio
  6.  
  7. from proxybroker import Broker
  8.  
  9. async def show(proxies):
  10.  
  11. proxy_settings = {"network.proxy.type": 1,
  12.  
  13. "permissions.default.image": 2,
  14.  
  15. "permissions.default.stylesheet": 2,
  16.  
  17. "dom.ipc.plugins.enabled.libflashplayer.so": False,
  18.  
  19. "media.navigator.video.enabled": False
  20.  
  21. }
  22.  
  23. browser = Browser('firefox', profile_preferences=proxy_settings)
  24.  
  25. browser.visit("about:config");
  26.  
  27. time.sleep(3)
  28.  
  29. while True:
  30.  
  31. proxy = await proxies.get()
  32.  
  33. if proxy is None: break
  34.  
  35. proxyIP = proxy.host
  36.  
  37. proxyPort = proxy.port
  38.  
  39. print(proxyIP)
  40.  
  41. configScript = "var prefs = Components.classes[\"@mozilla.org/preferences-service;1\"].getService(Components.interfaces.nsIPrefBranch);"+ "prefs.setCharPref('network.proxy.http', '" + proxyIP +"');prefs.setIntPref('network.proxy.http_port', "+ str(proxyPort) +");"+"prefs.setCharPref('network.proxy.ssl', '" + proxyIP + "');prefs.setIntPref('network.proxy.ssl_port', " + str(proxyPort) +");" +"prefs.setCharPref('network.proxy.ftp', '" + proxyIP + "');prefs.setIntPref('network.proxy.ftp_port', " + str(proxyPort) + ");"
  42.  
  43. #print(configScript)
  44.  
  45. browser.visit("about:config");
  46.  
  47. browser.execute_script(configScript);
  48.  
  49. #time.sleep(1)
  50.  
  51. try:
  52.  
  53. browser.visit("https://bash.news/bst/konkurs/best_of_the_best_selo")
  54.  
  55. time.sleep(1)
  56.  
  57. browser.execute_script("go2('/cgi/konkurs.pl?act=like&anketa=16729&konkurs=best_of_the_best_selo','silent');")
  58.  
  59. browser.execute_script("if (typeof windows !== 'undefined') { windows.alert = null }")
  60.  
  61. except Exception as e:
  62.  
  63. print("exception: " + str(e))
  64.  
  65. browser.quit()
  66.  
  67. proxies = asyncio.Queue()
  68.  
  69. broker = Broker(proxies)
  70.  
  71. tasks = asyncio.gather(
  72.  
  73. broker.find(types=['HTTPS'], limit=6000),
  74.  
  75. show(proxies))
  76.  
  77. loop = asyncio.get_event_loop()
  78.  
  79. loop.run_until_complete(tasks)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top