Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
  • Loading branch information
fa0311 committed Mar 11, 2022
1 parent a7774f5 commit 21ffa2c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions DMMGamePlayerFastLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"user_os": "win",
}


def dgp5_session():
process = subprocess.Popen(
args="", executable=arg.dmmgameplayer_path, shell=True, stdout=subprocess.PIPE
Expand All @@ -51,21 +52,26 @@ 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:
process.terminate()
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",
Expand Down

0 comments on commit 21ffa2c

Please sign in to comment.