This is an experimental update of Team Universal's UniversalScrapers' cfscrape.py, which tries to solve a CF challenge with local Python code with as few imports as possible.
Thanks for the changes!
I think it's necessary to reset the '.tries' counter after an answer is accepted (when the .request() calls inside '.solve_cf_challenge()' don't try to solve the challenge again). Otherwise that value accumulates and would disrupt the solving of other websites.
edit: this would only happen if the same CloudflareScraper object is used on those other websites, of course. I think that alternative code assumes you need to create a session object for each website.
Thanks for the changes!
I think it's necessary to reset the '.tries' counter after an answer is accepted (when the .request() calls inside '.solve_cf_challenge()' don't try to solve the challenge again). Otherwise that value accumulates and would disrupt the solving of other websites.
edit: this would only happen if the same CloudflareScraper object is used on those other websites, of course. I think that alternative code assumes you need to create a session object for each website.