The 429 thing bugs me most, your text says it just means overuse but the code treats it exactly like a 5xx and gives it the same escalating cooldown as a dead proxy. Retry after headers are also messier than people expect, sometimes missing, sometimes a full date instead of seconds, and 503s throw them too plus the limit might be on your account not the proxy so a separate throttle counter would help. Also that 403 branch quietly calls mark_success and wipes the fail streak even though 403 could mean banned, bad auth or just a url everyone gets blocked on. While you're in there, lok fail_count if this runs across threads, and narrow that bare except requestexception down to connectionerror and Timeout or you'll end up blaming the proxy for stuff like invalidURL that's actually your own mistake
The 429 thing bugs me most, your text says it just means overuse but the code treats it exactly like a 5xx and gives it the same escalating cooldown as a dead proxy. Retry after headers are also messier than people expect, sometimes missing, sometimes a full date instead of seconds, and 503s throw them too plus the limit might be on your account not the proxy so a separate throttle counter would help. Also that 403 branch quietly calls mark_success and wipes the fail streak even though 403 could mean banned, bad auth or just a url everyone gets blocked on. While you're in there, lok fail_count if this runs across threads, and narrow that bare except requestexception down to connectionerror and Timeout or you'll end up blaming the proxy for stuff like invalidURL that's actually your own mistake