From e0d07b81a8c41ee663ec14e159afa8612758b2a2 Mon Sep 17 00:00:00 2001 From: Suuringo <72997519+Suuringo@users.noreply.github.com> Date: Sat, 16 Apr 2022 23:49:44 +0200 Subject: [PATCH 1/5] Add --proxy-uri option This option is used to specify an http proxy when making requests to DMM. In particular, this option can be used to circumvent the region-lock when launching games. --- DMMGamePlayerFastLauncher.py | 6 ++++++ README.md | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher.py index de4c3b0..735c8a2 100644 --- a/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher.py @@ -57,8 +57,12 @@ 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("--proxy-uri", default=None) arg = argpar.parse_args() +PROXY = None +if arg.proxy_uri is not None: + PROXY = {"https": arg.proxy_uri} 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", @@ -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: @@ -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: diff --git a/README.md b/README.md index 7f048a6..2875fbb 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,17 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン | --game-path | | False | ゲームのパス Falseにすると自動 | | | --login-force | | False | ログインを強制する | bool | | --skip-exception | | False | エラーをスキップ | bool | +| --proxy-uri | | None | HTTPプロクシを指定 | string | + +### プロクシ + +`--proxy-uri`を指定することで、DMMへのリクエストがすべてプロクシーサーバーに通されます。 + +フォーマット: +`http://:` + +認証が必要の場合(Basic認証のみ): +`http://:@:` ## ヘルプ From 48ac5311532f507b11a4a7721aa30b3b53c02352 Mon Sep 17 00:00:00 2001 From: fa0311 Date: Sun, 17 Apr 2022 13:36:03 +0900 Subject: [PATCH 2/5] update proxy --- DMMGamePlayerFastLauncher.py | 10 ++++++---- README.md | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher.py index 735c8a2..72f2d89 100644 --- a/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher.py @@ -57,17 +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("--proxy-uri", default=None) +argpar.add_argument("--https-proxy-uri", default=None) arg = argpar.parse_args() -PROXY = None -if arg.proxy_uri is not None: - PROXY = {"https": arg.proxy_uri} 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", @@ -169,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"") diff --git a/README.md b/README.md index 2875fbb..74bb402 100644 --- a/README.md +++ b/README.md @@ -32,17 +32,7 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン | --game-path | | False | ゲームのパス Falseにすると自動 | | | --login-force | | False | ログインを強制する | bool | | --skip-exception | | False | エラーをスキップ | bool | -| --proxy-uri | | None | HTTPプロクシを指定 | string | - -### プロクシ - -`--proxy-uri`を指定することで、DMMへのリクエストがすべてプロクシーサーバーに通されます。 - -フォーマット: -`http://:` - -認証が必要の場合(Basic認証のみ): -`http://:@:` +| --https-proxy-uri | | None | HTTPSプロキシを指定 | string | ## ヘルプ @@ -61,6 +51,16 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン > DMMGamePlayerから管理者権限を外して下さい
> (このツールのv4.0以降このエラーは出ないと思いますが) +> **「日本国外からのアクセスは禁止されています」というエラーが出る**
+> `--proxy-uri`を指定してください
+> 例
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri http://host:port`
+> Basic認証
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri http://user:pass@host:port`
+> Socks5
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri socks5://user:pass@host:port`
+> [requests.org/Proxies](https://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies) + ### 特定のゲームに起こる症状 > **「ゲームのパスの検出に失敗しました」というエラーが出る**
From 5b1e106f1879a015f2b7b03a4508befa192402a5 Mon Sep 17 00:00:00 2001 From: fa0311 Date: Sun, 17 Apr 2022 13:37:16 +0900 Subject: [PATCH 3/5] update README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 74bb402..b85c9b9 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン > (このツールのv4.0以降このエラーは出ないと思いますが) > **「日本国外からのアクセスは禁止されています」というエラーが出る**
-> `--proxy-uri`を指定してください
+> `--https-proxy-uri`を指定してください
> 例
-> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri http://host:port`
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri http://host:port`
> Basic認証
-> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri http://user:pass@host:port`
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri http://user:pass@host:port`
> Socks5
-> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --proxy-uri socks5://user:pass@host:port`
+> `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri socks5://user:pass@host:port`
> [requests.org/Proxies](https://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies) ### 特定のゲームに起こる症状 From 291835e0d9cb45f11c7ca7612b3d953c71499d68 Mon Sep 17 00:00:00 2001 From: fa0311 Date: Sun, 17 Apr 2022 13:54:18 +0900 Subject: [PATCH 4/5] update README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b85c9b9..3dceb7c 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン > `%AppData%\DMMGamePlayerFastLauncher\DMMGamePlayerFastLauncher.exe umamusume --https-proxy-uri socks5://user:pass@host:port`
> [requests.org/Proxies](https://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies) +> **プロキシを設定した際、ゲームは起動するがゲーム側に通信エラーが発生する**
+> ゲーム側で国外アクセスが禁止されています
+> ウマ娘、プリコネRは禁止されていました
+ ### 特定のゲームに起こる症状 > **「ゲームのパスの検出に失敗しました」というエラーが出る**
From d9e3f1c53938f1bdae238b655e6dae91ffea563d Mon Sep 17 00:00:00 2001 From: fa0311 Date: Sun, 17 Apr 2022 13:54:24 +0900 Subject: [PATCH 5/5] update version --- setup.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.iss b/setup.iss index da27c26..be37c52 100644 --- a/setup.iss +++ b/setup.iss @@ -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"