mirror of
https://github.com/thewhiteh4t/pwnedOrNot.git
synced 2026-09-13 21:27:43 +02:00
Added handling for 429 rate limiting responses to dump()
Fixes my issue I created on master branch of creator.
This commit is contained in:
+12
-2
@@ -247,7 +247,12 @@ def dump():
|
||||
)
|
||||
sc = rqst.status_code
|
||||
|
||||
if sc != 200:
|
||||
if sc == 429:
|
||||
retry_sleep = float(rqst.headers['Retry-After'])
|
||||
print(f' {Y}[ retry in {retry_sleep}s]{W}')
|
||||
sleep(retry_sleep)
|
||||
dump()
|
||||
elif sc != 200:
|
||||
print(f' {R}[ No Dumps Found ]{W}')
|
||||
else:
|
||||
print(f' {G}[ Dumps Found ]{W}\n')
|
||||
@@ -328,6 +333,11 @@ def breach_info():
|
||||
)
|
||||
else:
|
||||
print(f' {R}[ Not Breached ]{W}')
|
||||
elif sc == 429:
|
||||
retry_sleep = float(rqst.headers['Retry-After'])
|
||||
print(f' {Y}[ retry in {retry_sleep}s]{W}')
|
||||
sleep(retry_sleep)
|
||||
breach_info()
|
||||
elif sc == 404:
|
||||
print(f' {R}[ Not Breached ]{W}')
|
||||
else:
|
||||
@@ -406,4 +416,4 @@ try:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
print(f'\n{R}[!] {C}Keyboard Interrupt.{W}')
|
||||
exit()
|
||||
exit()
|
||||
|
||||
Reference in New Issue
Block a user