From 21ffa2ca13ab0ab585a29223ef71de379b6edbdf Mon Sep 17 00:00:00 2001 From: fa0311 <yukinashi2742756@yahoo.co.jp> Date: Sat, 12 Mar 2022 05:21:06 +0900 Subject: [PATCH] update format --- DMMGamePlayerFastLauncher.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher.py index 103c1bc..97f852a 100644 --- a/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher.py @@ -43,6 +43,7 @@ "user_os": "win", } + def dgp5_session(): process = subprocess.Popen( args="", executable=arg.dmmgameplayer_path, shell=True, stdout=subprocess.PIPE @@ -51,8 +52,10 @@ def dgp5_session(): text = line.decode("utf8").strip() if arg.debug: print(text) - if 'Parsing json string is ' in text: - install_data = json.loads(text.lstrip("Parsing json string is ").rstrip(".")) + if "Parsing json string is " in text: + install_data = json.loads( + text.lstrip("Parsing json string is ").rstrip(".") + ) if 'Header key: "cookie"' in text: cookie = re.findall(r'"(.*?)"', text)[1] if arg.kill: @@ -60,12 +63,15 @@ def dgp5_session(): return install_data, cookie raise Exception("DMMGamePlayerが起動できませんでした") + install_data, headers["cookie"] = dgp5_session() if not arg.game_path: for contents in install_data["contents"]: if contents["productId"] == arg.product_id: - game_path = glob.glob('{path}\*.exe._'.format(path=contents['detail']['path']))[0][:-2] + game_path = glob.glob( + "{path}\*.exe._".format(path=contents["detail"]["path"]) + )[0][:-2] response = requests.session().post( "https://apidgp-gameplayer.games.dmm.com/v5/launch/cl",