From 65c2d4d26e5c3e51daad0d263acaaa891f54de04 Mon Sep 17 00:00:00 2001 From: kozerskil Date: Wed, 1 Feb 2023 15:03:50 +0100 Subject: [PATCH] Update token_extractor.py I'd like to use this function with some addition where I read stored credentials. This small change would help me a lot. What do you think? --- token_extractor.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/token_extractor.py b/token_extractor.py index d9f51ac..3c5f69b 100644 --- a/token_extractor.py +++ b/token_extractor.py @@ -265,7 +265,14 @@ def main(): print() if not server == "": servers = [server] + run(username, password, servers) + + print() + print("Press ENTER to finish") + input() + +def run(username, password, servers): connector = XiaomiCloudConnector(username, password) print("Logging in...") logged = connector.login() @@ -319,10 +326,6 @@ def main(): else: print("Unable to log in.") - print() - print("Press ENTER to finish") - input() - if __name__ == "__main__": main()