mirror of
https://github.com/bellingcat/vk-url-scraper.git
synced 2026-06-13 05:48:37 +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
|
for wait in 24 * [5]: # tries every 5s for 2min
|
||||||
print(f"sending request to {url=}", flush=True)
|
print(f"sending request to {url=}", flush=True)
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
print(f"got response {r.text=}", flush=True)
|
if r.status_code == 200:
|
||||||
if key := regex_string.search(r.text):
|
print(f"got response {r.text=}", flush=True)
|
||||||
print(f"got captcha result {key=}", flush=True)
|
if key := regex_string.search(r.text):
|
||||||
return captcha.try_again(key[0])
|
print(f"got captcha result {key=}", flush=True)
|
||||||
|
return captcha.try_again(key[0])
|
||||||
print(f"sleeping {wait} seconds", flush=True)
|
print(f"sleeping {wait} seconds", flush=True)
|
||||||
time.sleep(wait)
|
time.sleep(wait)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user