Skip to content

Commit

Permalink
fix 「ログインに失敗しました」の問題 #34
Browse files Browse the repository at this point in the history
  • Loading branch information
fa0311 committed Jul 22, 2022
1 parent ab4a713 commit c057052
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions DMMGamePlayerFastLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sqlite3
import os
import time
import re


def gen_rand_hex():
Expand Down Expand Up @@ -95,15 +96,25 @@ def get_dpg5_config(dgp5_path):
blob = f.read()
if blob == b"" or arg.login_force:
session = get_dgp5_session(DGP5_PATH)

response = session.get(
"https://www.dmm.com/",
headers=HEADERS,
proxies=PROXY,
).text

reg = '<script{any}id="auto-login"{any}data-encoded="{data}"{any}></script>'.format(any=".*?",data="([0-9a-zA-Z_]*)")
data_encoded = re.findall(reg, response)[0]

response = session.get(
"https://www.dmm.com/my/-/login/auth/=/direct_login=1/path=DRVESVwZTkVPEh9cXltIVA4IGV5ETRQWVlID",
f"https://accounts.dmm.com/service/login/token/=/path={data_encoded}",
headers=HEADERS,
proxies=PROXY,
)
if session.cookies.get("login_session_id") == None:
if not arg.skip_exception:
raise Exception(
"ログインに失敗しました\nDMMGamePlayerでログインしていない時またはDMMGamePlayerが起動している時にこのエラーが発生する可能性があります"
"ログインに失敗しました\nDMMGamePlayerを起動してログインし直して下さい"
)
contents = json.dumps(
{
Expand Down

0 comments on commit c057052

Please sign in to comment.