Implemented #10

Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
Domenico Iezzi 2017-10-13 11:20:40 +02:00
parent cfbdd085cd
commit afe654111e

View File

@ -8,6 +8,7 @@ from Crypto.Cipher import PKCS1_OAEP
from clint.textui import progress from clint.textui import progress
import requests import requests
import sys
import base64 import base64
import itertools import itertools
@ -176,6 +177,11 @@ class GooglePlayAPI(object):
if "auth" in params: if "auth" in params:
ac2dmToken = params["auth"] ac2dmToken = params["auth"]
elif "error" in params: elif "error" in params:
if "NeedsBrowser" in params["error"]:
print("\nsecurity check is needed, try to visit\n"
"https://accounts.google.com/b/0/DisplayUnlockCaptcha\n"
"if you use 2FA it is recommended to setup an app specific password\n")
sys.exit(1)
raise LoginError("server says: " + params["error"]) raise LoginError("server says: " + params["error"])
else: else:
raise LoginError("Auth token not found.") raise LoginError("Auth token not found.")