Replace uniform random.choice with random.choices weighted by last_ok recency. Proxies tested successfully more recently get higher selection probability (weight = 1/(1 + age/300)), decaying over ~5 minutes.
Replace uniform random.choice with random.choices weighted by last_ok recency. Proxies tested successfully more recently get higher selection probability (weight = 1/(1 + age/300)), decaying over ~5 minutes.