Example #1
0
    def _login(self, mailAddr, namepwd):
        print '_login'

        gameRet = self.net._get('https://www.dmm.co.jp/my/-/login/')
        
        path = self._getPathValue(gameRet);
        print 'path:', path;
        
        xhrTokenHeader = self._getTagToken('"DMM_TOKEN", ',gameRet);
        if xhrTokenHeader=='':
            return ''
        xhrTokenContent = self._getTagToken('"token": ',gameRet);
        if xhrTokenContent == '':
            return ''
        postData = (('token',xhrTokenContent),)
        xhrReturn = self.net._post_xhr('https://www.dmm.co.jp/my/-/login/ajax-get-token/', postData, xhrTokenHeader)
        if xhrReturn == '':
            return ''
        xhr = json.loads(xhrReturn)

        postData = ((xhr['login_id'],mailAddr),
                    ('client_id',''),
                    ('display',''),
                    (xhr['password'],namepwd),
                    ('login_id',mailAddr),
                    ('password',namepwd),
                    ('path', path),
                    ('prompt', ''),
                    ('save_login_id','0'),
                    ('save_password','0'),
                    ('token',xhr['token']),
                    ('use_auto_login','0'))
        loginRet = self.net._post('https://www.dmm.co.jp/my/-/login/auth/', postData)
        if loginRet == '':
            return ''


        if self.pwd._needReset(loginRet,mailAddr):
            ret = self.net._get('https://www.dmm.co.jp/my/-/passwordreminder/')
            postData = (('email', mailAddr),)
            ret = self.net._post('https://www.dmm.co.jp/my/-/passwordreminder/sendmail/', postData)
            namepwd = self.pwd._doReset()
            if namepwd == '':
                return namepwd
            self.net = webreq.Webreq(True)
            return self._login(mailAddr,namepwd);
        
        
        gameRet = self._intoGame()
        if gameRet == '':
            return ''
        gameUrl = self._parseURL(gameRet)

        return gameUrl;
Example #2
0
def _auto():
    net = webreq.Webreq(False)
    counter = 0
    while True:
        time.sleep(1)
        counter += 1
        print counter
        net._get(
            'http://kpli.webcrow.jp/dmm/ido.php?cmd=play&key=cancel&val=auto')
        cookie = net._getCookies()
        print cookie['aigis_title']
        if cookie['aigis_title'] == 'noid':
            net._get('http://kpli.webcrow.jp/dmm/ido.php?cmd=unlockall')
Example #3
0
 def __init__(self):
     self.net = webreq.Webreq(True)
     self.mailAddr = ''
     self.mailUser = ''
     self.backURL = ''
Example #4
0
 def __init__(self):
     self.net = webreq.Webreq(False)
     self.mailUser = ''
     self.mailAddr = ''
     self.mailFlag = ''
Example #5
0
 def __init__(self):
     self.net_b = webreq.Webreq(False)   # 邮件
     self.net_c = webreq.Webreq(True)    # 修改
     self.mailFlag = ''
     self.mailAddr = ''
     self.passWord = ''
Example #6
0
 def __init__(self):
     self.net = webreq.Webreq(True)
     self.pwd = resetpwd.Reset_Pwd()
Example #7
0
    def _cancel(self, mailAddr, namepwd):
        print '_login'

        gameRet = self.net._get('https://www.dmm.co.jp/my/-/login/')
        
        path = self._getPathValue(gameRet);
        print 'path:', path;
        
        xhrTokenHeader = self._getTagToken('"DMM_TOKEN", ',gameRet);
        if xhrTokenHeader=='':
            return ''
        xhrTokenContent = self._getTagToken('"token": ',gameRet);
        if xhrTokenContent == '':
            return ''
        postData = (('token',xhrTokenContent),)
        xhrReturn = self.net._post_xhr('https://www.dmm.co.jp/my/-/login/ajax-get-token/', postData, xhrTokenHeader)
        if xhrReturn == '':
            return ''
        xhr = json.loads(xhrReturn)

        postData = ((xhr['login_id'],mailAddr),
                    ('client_id',''),
                    ('display',''),
                    (xhr['password'],namepwd),
                    ('login_id',mailAddr),
                    ('password',namepwd),
                    ('path', path),
                    ('prompt', ''),
                    ('save_login_id','0'),
                    ('save_password','0'),
                    ('token',xhr['token']),
                    ('use_auto_login','0'))
        loginRet = self.net._post('https://www.dmm.co.jp/my/-/login/auth/', postData)
        if loginRet == '':
            return ''

        if self.pwd._needReset(loginRet,mailAddr):
            ret = self.net._get('https://www.dmm.co.jp/my/-/passwordreminder/')
            postData = (('email', mailAddr),)
            ret = self.net._post('https://www.dmm.co.jp/my/-/passwordreminder/sendmail/', postData)
            namepwd = self.pwd._doReset()
            if namepwd == '':
                return namepwd
            self.net = webreq.Webreq(True)
            return self._cancel(mailAddr,namepwd);
        
        # 进入设置页面
        gameRet = self.net._get('http://www.dmm.co.jp/my/-/top/')
        if gameRet == '':
            return ''
        
        postData = (('mytop', 'true'),)
        gameRet = self.net._post_xhr('https://www.dmm.co.jp/digital/-/mypage/ajax-index/',postData,'')
        if gameRet == '':
            return ''

        gameRet = self.net._get('https://www.dmm.co.jp/my/-/inactivate/payment/')
        if gameRet == '':
            return ''

        gameRet = self.net._get('https://www.dmm.co.jp/digital/-/inactivate/ajax-index/')
        if gameRet == '':
            return ''


        gameRet = self.net._get('https://www.dmm.co.jp/my/-/inactivate/r18com/')
        if gameRet == '':
            return ''

        gameRet = self.net._get('https://www.dmm.co.jp/my/-/inactivate/reason/')
        if gameRet == '':
            return ''
        
        tokenvalue = self._getTokenValue(gameRet)
        print tokenvalue
        postData = (('token',tokenvalue),('reason', ''))
        gameRet = self.net._post('https://www.dmm.co.jp/my/-/inactivate/complete/', postData)
        if gameRet == '':
            return ''
        return gameRet;