removed separate update endpoint
This commit is contained in:
parent
95e4057a49
commit
aee9c05cf4
60
dmmBypass.py
60
dmmBypass.py
|
@ -80,43 +80,54 @@ def retrieve_auth_keys(login, password, token, captcha, session : requests.Sessi
|
|||
print("Failed to log in:", e)
|
||||
return None, None
|
||||
|
||||
def retrieve_update_params(game_id, login_secure, login_session, use_proxy):
|
||||
def agree_to_game_terms(game_id, use_proxy):
|
||||
try:
|
||||
print("Retrieving update file list")
|
||||
data = {"product_id":game_id,"game_type":"GCL","game_os":"win"}
|
||||
print("Accepting updated game terms of use")
|
||||
headers = {"User-Agent": "DMMGamePlayer5-Win/5.3.12 Electron/32.1.0", "Client-App": "DMMGamePlayer5", "Client-version": "5.3.12", "Content-Type": "application/json"}
|
||||
cookies = {"login_secure_id":login_secure, "login_session_id":login_session}
|
||||
url = "https://katworks.sytes.net/KF/Api/DMM/filelist" if use_proxy else "https://apidgp-gameplayer.games.dmm.com/v5/r2/filelist/cl"
|
||||
result = requests.post(url, cookies=cookies, headers=headers, json=data)
|
||||
url = "" if use_proxy else "https://apidgp-gameplayer.games.dmm.com/v5/agreement/confirm/client"
|
||||
data = {"product_id":game_id,"is_notification":False,"is_myapp":False}
|
||||
result = requests.post(url, headers=headers, json=data)
|
||||
result.raise_for_status()
|
||||
result_json = result.json()
|
||||
if result_json["result_code"] != 100:
|
||||
raise Exception(f'{result_json["result_code"]}: {result_json["error"]}')
|
||||
data = result_json["data"]
|
||||
game_version = data["latest_version"]
|
||||
print("Latest version:", game_version)
|
||||
file_list_url = data["file_list_url"]
|
||||
file_list_params = data["sign"]
|
||||
file_list_params = "?" + file_list_params.replace(";", "&").replace("CloudFront-", "")
|
||||
return file_list_url, file_list_params
|
||||
return True
|
||||
except Exception as e:
|
||||
print("Failed to retrieve update file list:", e)
|
||||
return None, None
|
||||
|
||||
def retrieve_launch_params(game_id, mac_addr, hdd_serial, motherboard, login_secure, login_session, use_proxy):
|
||||
print("Failed to accept terms of use:", e)
|
||||
return False
|
||||
|
||||
def retrieve_launch_params(game_id, mac_addr, hdd_serial, motherboard, login_secure, login_session, use_proxy, update_game):
|
||||
try:
|
||||
print("Retrieving launch arguments")
|
||||
data = {"product_id":game_id,"game_type":"GCL","game_os":"win","launch_type":"LIB","mac_address":mac_addr,"hdd_serial":hdd_serial,"motherboard":motherboard,"user_os":"win"}
|
||||
headers = {"User-Agent": "DMMGamePlayer5-Win/5.3.12 Electron/32.1.0", "Client-App": "DMMGamePlayer5", "Client-version": "5.3.12", "Content-Type": "application/json"}
|
||||
cookies = {"login_secure_id":login_secure, "login_session_id":login_session}
|
||||
url = "https://katworks.sytes.net/KF/Api/DMM/launch" if use_proxy else "https://apidgp-gameplayer.games.dmm.com/v5/r2/launch/cl"
|
||||
if update_game:
|
||||
url = "https://katworks.sytes.net/KF/Api/DMM/update" if use_proxy else "https://apidgp-gameplayer.games.dmm.com/v5/r2/launch/cl"
|
||||
else:
|
||||
url = "https://katworks.sytes.net/KF/Api/DMM/launch" if use_proxy else "https://apidgp-gameplayer.games.dmm.com/v5/launch/cl"
|
||||
result = requests.post(url, cookies=cookies, headers=headers, json=data)
|
||||
result.raise_for_status()
|
||||
result_json = result.json()
|
||||
if result_json["result_code"] != 100:
|
||||
if result_json["result_code"] == 308:
|
||||
if agree_to_game_terms(game_id, use_proxy):
|
||||
result = requests.post(url, cookies=cookies, headers=headers, json=data)
|
||||
result.raise_for_status()
|
||||
result_json = result.json()
|
||||
if result_json["result_code"] != 100:
|
||||
raise Exception(f'{result_json["result_code"]}: {result_json["error"]}')
|
||||
else:
|
||||
raise Exception("Failed to agree to updated game terms of use. Use the DMM app to confirm.")
|
||||
elif result_json["result_code"] != 100:
|
||||
raise Exception(f'{result_json["result_code"]}: {result_json["error"]}')
|
||||
data = result_json["data"]
|
||||
return data["execute_args"]
|
||||
if update_game:
|
||||
game_version = data["latest_version"]
|
||||
print("Latest version:", game_version)
|
||||
file_list_params = "?" + data["sign"].replace(";", "&").replace("CloudFront-", "")
|
||||
return data["execute_args"], data["file_list_url"], file_list_params
|
||||
else:
|
||||
return data["execute_args"], None, None
|
||||
except Exception as e:
|
||||
print("Failed to retrieve launch arguments:", e)
|
||||
|
||||
|
@ -145,13 +156,8 @@ def main(config):
|
|||
|
||||
if not use_proxy: input("Enable VPN now and press Enter")
|
||||
|
||||
if update_game:
|
||||
file_list_url, file_access_params = retrieve_update_params(game_id, login_secure, login_session, use_proxy)
|
||||
if file_list_url == None or file_access_params == None:
|
||||
return
|
||||
|
||||
execute_args = retrieve_launch_params(game_id, mac_addr, hdd_serial, motherboard, login_secure, login_session, use_proxy)
|
||||
if execute_args == None:
|
||||
execute_args, file_list_url, file_access_params = retrieve_launch_params(game_id, mac_addr, hdd_serial, motherboard, login_secure, login_session, use_proxy, update_game)
|
||||
if execute_args == None or (update_game and (file_list_url == None or file_access_params == None)):
|
||||
return
|
||||
|
||||
if not use_proxy: input("Disable VPN now and press Enter")
|
||||
|
|
Loading…
Reference in New Issue