From c20c718d28811df23a92bc53e12c190a60f42902 Mon Sep 17 00:00:00 2001 From: Learning for learning <1148995537@qq.com> Date: Fri, 14 Aug 2020 13:53:02 +0800 Subject: [PATCH] Fix error cannot be passed to C code fix: https://github.com/Kr1s77/awesome-python-login-model/issues/100#issuecomment-673897848 --- NeteaseCloudMusicDownload/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NeteaseCloudMusicDownload/api.py b/NeteaseCloudMusicDownload/api.py index f6eb483..90fe539 100644 --- a/NeteaseCloudMusicDownload/api.py +++ b/NeteaseCloudMusicDownload/api.py @@ -33,6 +33,8 @@ class decrypt_music(object): iv = b'0102030405060708' pad = 16 - len(text.encode()) % 16 text = text + pad * chr(pad) + # fix: https://github.com/Kr1s77/awesome-python-login-model/issues/100#issuecomment-673897848 + # error: TypeError: Object type cannot be passed to C code encryptor = AES.new(key.encode(), AES.MODE_CBC, iv) msg = base64.b64encode(encryptor.encrypt(text.encode())) return msg