Skip to content

Commit 6404f66

Browse files
committed
Tratando erro de login
1 parent 786d08d commit 6404f66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

instagram/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def fazerLogin(usuario, senha):
2929
res = req.json()
3030
atualizarCSRFToken(session, req.cookies["csrftoken"])
3131

32+
if res["status"] != "ok" or res["authenticated"] != True:
33+
raise Exception("Erro no login: %s" % res)
34+
3235
print("Logado com sucesso!")
3336
print()
3437

0 commit comments

Comments
 (0)