mirror of
https://github.com/bellingcat/vk-url-scraper.git
synced 2026-06-11 04:48:36 +03:00
updated captcha logic
This commit is contained in:
@@ -35,10 +35,11 @@ def captcha_handler(captcha):
|
||||
for wait in 24 * [5]: # tries every 5s for 2min
|
||||
print(f"sending request to {url=}", flush=True)
|
||||
r = requests.get(url)
|
||||
print(f"got response {r.text=}", flush=True)
|
||||
if key := regex_string.search(r.text):
|
||||
print(f"got captcha result {key=}", flush=True)
|
||||
return captcha.try_again(key[0])
|
||||
if r.status_code == 200:
|
||||
print(f"got response {r.text=}", flush=True)
|
||||
if key := regex_string.search(r.text):
|
||||
print(f"got captcha result {key=}", flush=True)
|
||||
return captcha.try_again(key[0])
|
||||
print(f"sleeping {wait} seconds", flush=True)
|
||||
time.sleep(wait)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user