示例#1
0
def get_session(login_data):
	try:
		get_session_data = pokemon_pb2.get_session_data()
		get_session_data.ParseFromString(login_data)
		return get_session_data.ses
	except:
		print '[-] problem get_session'
		return None
示例#2
0
def get_session(login_data):
    try:
        get_session_data = pokemon_pb2.get_session_data()
        get_session_data.ParseFromString(login_data)
        return get_session_data.ses
    except:
        print '[-] problem get_session'
        return None
示例#3
0
def get_rpc_server(access_token,first_data):
	try:				
		r=config.s.post(config.api_url,data=first_data,verify=False,timeout=3)
		get_session_data = pokemon_pb2.get_session_data()
		get_session_data.ParseFromString(r.content)
		if get_session_data is not None and get_session_data.rpc_server is not None:
			if 'plfe' in get_session_data.rpc_server:
				return get_session_data
			else:
				get_rpc_server(access_token,first_data)	
		else:
			get_rpc_server(access_token,first_data)
	except requests.exceptions.RequestException as e:
		print '[-] offline..'
		time.sleep(3)
		return get_rpc_server(access_token,first_data)
示例#4
0
def get_rpc_server(access_token, first_data):
    try:
        r = config.s.post(config.api_url,
                          data=first_data,
                          verify=False,
                          timeout=3)
        get_session_data = pokemon_pb2.get_session_data()
        get_session_data.ParseFromString(r.content)
        if get_session_data is not None and get_session_data.rpc_server is not None:
            if 'plfe' in get_session_data.rpc_server:
                return get_session_data
            else:
                get_rpc_server(access_token, first_data)
        else:
            get_rpc_server(access_token, first_data)
    except requests.exceptions.RequestException as e:
        print '[-] offline..'
        time.sleep(3)
        return get_rpc_server(access_token, first_data)
示例#5
0
def get_session(login_data):
	get_session_data = pokemon_pb2.get_session_data()
	get_session_data.ParseFromString(login_data)
	return get_session_data.requests