Skip to content

Commit

Permalink
Merge pull request #29 from fa0311/develop-v4
Browse files Browse the repository at this point in the history
v4.2
  • Loading branch information
fa0311 authored Apr 17, 2022
2 parents 41f7323 + d9e3f1c commit bc703b2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions DMMGamePlayerFastLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ def get_dpg5_config(dgp5_path):
argpar.add_argument("--game-path", default=False)
argpar.add_argument("--login-force", action="store_true")
argpar.add_argument("--skip-exception", action="store_true")
argpar.add_argument("--https-proxy-uri", default=None)
arg = argpar.parse_args()

HEADERS = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36",
}

PROXY = {"https": arg.https_proxy_uri}

DGP5_HEADERS = {
"Host": "apidgp-gameplayer.games.dmm.com",
"Connection": "keep-alive",
Expand Down Expand Up @@ -92,6 +96,7 @@ def get_dpg5_config(dgp5_path):
response = session.get(
"https://www.dmm.com/my/-/login/auth/=/direct_login=1/path=DRVESVwZTkVPEh9cXltIVA4IGV5ETRQWVlID",
headers=HEADERS,
proxies=PROXY,
)
if session.cookies.get("login_session_id") == None:
if not arg.skip_exception:
Expand Down Expand Up @@ -151,6 +156,7 @@ def get_dpg5_config(dgp5_path):
headers=DGP5_HEADERS,
json=DGP5_LAUNCH_PARAMS,
verify=False,
proxies=PROXY,
).json()

if response["result_code"] == 100:
Expand All @@ -163,6 +169,8 @@ def get_dpg5_config(dgp5_path):
text = line.decode("utf-8").strip()
if time.time() - start_time < 2 and not arg.skip_exception:
raise Exception("ゲームが起動しませんでした。ゲームにアップデートがある可能性があります。")
elif response["result_code"] == 801:
raise Exception("日本国外からのアクセスは禁止されています\n" + json.dumps(response))
else:
with open("cookie.bytes", "wb") as f:
f.write(b"")
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
| --game-path | | False | ゲームのパス Falseにすると自動 | |
| --login-force | | False | ログインを強制する | bool |
| --skip-exception | | False | エラーをスキップ | bool |
| --https-proxy-uri | | None | HTTPSプロキシを指定 | string |

## ヘルプ

Expand All @@ -50,6 +51,20 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
> DMMGamePlayerから管理者権限を外して下さい<br>
> (このツールのv4.0以降このエラーは出ないと思いますが)
> **「日本国外からのアクセスは禁止されています」というエラーが出る**<br>
> `--https-proxy-uri`を指定してください<br>
> 例<br>
> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri http://host:port`<br>
> Basic認証<br>
> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri http://user:pass@host:port`<br>
> Socks5<br>
> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri socks5://user:pass@host:port`<br>
> [requests.org/Proxies](https://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies)
> **プロキシを設定した際、ゲームは起動するがゲーム側に通信エラーが発生する**<br>
> ゲーム側で国外アクセスが禁止されています<br>
> ウマ娘、プリコネRは禁止されていました<br>
### 特定のゲームに起こる症状

> **「ゲームのパスの検出に失敗しました」というエラーが出る**<br>
Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "DMMGamePlayerFastLauncher"
#define MyAppVersion "4.1.1"
#define MyAppVersion "4.2.0"
#define MyAppPublisher "yuki"
#define MyAppURL "https://github.com/fa0311/DMMGamePlayerFastLauncher"
#define MyAppExeName "DMMGamePlayerFastLauncher.exe"
Expand Down

0 comments on commit bc703b2

Please sign in to comment.