mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Allow FloodWait to be raised in case of non-interactive sign-ins
This commit is contained in:
parent
49414799e2
commit
8a5743ef0c
1 changed files with 15 additions and 6 deletions
|
|
@ -399,8 +399,11 @@ class Client(Methods, BaseClient):
|
||||||
print(e.MESSAGE)
|
print(e.MESSAGE)
|
||||||
self.phone_number = None
|
self.phone_number = None
|
||||||
except FloodWait as e:
|
except FloodWait as e:
|
||||||
print(e.MESSAGE.format(x=e.x))
|
if phone_number_invalid_raises:
|
||||||
time.sleep(e.x)
|
raise
|
||||||
|
else:
|
||||||
|
print(e.MESSAGE.format(x=e.x))
|
||||||
|
time.sleep(e.x)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
else:
|
else:
|
||||||
|
|
@ -493,16 +496,22 @@ class Client(Methods, BaseClient):
|
||||||
print(e.MESSAGE)
|
print(e.MESSAGE)
|
||||||
self.password = None
|
self.password = None
|
||||||
except FloodWait as e:
|
except FloodWait as e:
|
||||||
print(e.MESSAGE.format(x=e.x))
|
if password_hash_invalid_raises:
|
||||||
time.sleep(e.x)
|
raise
|
||||||
|
else:
|
||||||
|
print(e.MESSAGE.format(x=e.x))
|
||||||
|
time.sleep(e.x)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
break
|
break
|
||||||
except FloodWait as e:
|
except FloodWait as e:
|
||||||
print(e.MESSAGE.format(x=e.x))
|
if phone_code_invalid_raises or first_name_invalid_raises:
|
||||||
time.sleep(e.x)
|
raise
|
||||||
|
else:
|
||||||
|
print(e.MESSAGE.format(x=e.x))
|
||||||
|
time.sleep(e.x)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue