diff --git a/ptr.py b/ptr.py new file mode 100644 index 0000000..89ac506 --- /dev/null +++ b/ptr.py @@ -0,0 +1,35 @@ +import asyncio +import concurrent.futures +import requests +import sys + +session = requests.session() +session.proxies = {} + +session.proxies['http'] = 'socks5h://localhost:9050' +session.proxies['https'] = 'socks5h://localhost:9050' + +for f in sys.argv: + url = (f) + +headers = {} +headers['User-agent'] = "Black Lives Matter" + +async def main(): + + with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor: + + loop = asyncio.get_event_loop() + futures = [ + loop.run_in_executor( + executor, + session.get(url, headers=headers) + ) + for i in range(10) + ] + for response in await asyncio.gather(*futures): + pass + + +loop = asyncio.get_event_loop() +loop.run_until_complete(main()) \ No newline at end of file