NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
410 stars 208 forks source link

struct.error: unpack requires a string argument of length 1 #119

Open caiyiyong opened 4 years ago

caiyiyong commented 4 years ago

This error occurred when I executed the script: Traceback (most recent call last): File "test1.py", line 7, in <module> api.login(email=mail, password=passwd) File "/home/caiyiyong/googleplay-api/gpapi/googleplay.py", line 214, in login encryptedPass = self.encryptPassword(email, password).decode('utf-8') File "/home/caiyiyong/googleplay-api/gpapi/googleplay.py", line 103, in encryptPassword modulus = utils.toBigInt(binaryKey[4:][0:i]) File "/home/caiyiyong/googleplay-api/gpapi/utils.py", line 21, in toBigInt decoded = struct.unpack("B", bytes([value]))[0] struct.error: unpack requires a string argument of length 1

When I change 'decoded = struct.unpack("B", bytes([value]))[0]' to 'decoded = struct.unpack("B", bytes([value])[0])[0]' ,The mistake is gone。