Skip to content

Client

ropython.client

Client

Client

Source code in ropython/client.py
class Client:
    """
    Client
    """

    def __init__(self, cookie: int = None, proxies: list = None):
        """
        Create's the client

        Attributes:
            cookie: The Roblox cookie in it's entirety
            proxies: The proxies of which to send from. This is not required.
        """
        self.proxise = proxies or {}
        self.session = requests.Session()
        self.session.cookies[".ROBLOSECURITY"] = cookie
        self.session.headers["x-csrf-token"] = get_token() or None

    def get_token(self) -> Optional[str]:
        """
        Get's a x-csrf-token from Roblox which is required for all requests.
        """
        # This doesn't acutally log you out since we aren't passing in a token
        r = self.session.post(
            "https://auth.roblox.com/v2/logout", cookies={".ROBLOSECURITY": self.cookie}
        )
        if r.headers["x-csrf-token"]:
            self.token = r.headers["x-csrf-token"]
            return r.headers["x-csrf-token"]

    async def get_experience(self, UniverseId: int) -> Experience:
        """
        Get a experience object which is required to do anything with experiences.

        Attributes:
            UniverseId: The ID of the game to get
        """
        return Experience(UniverseId)

__init__(self, cookie: int = None, proxies: list = None) special

Create's the client

Attributes:

Name Type Description
cookie

The Roblox cookie in it's entirety

proxies

The proxies of which to send from. This is not required.

Source code in ropython/client.py
def __init__(self, cookie: int = None, proxies: list = None):
    """
    Create's the client

    Attributes:
        cookie: The Roblox cookie in it's entirety
        proxies: The proxies of which to send from. This is not required.
    """
    self.proxise = proxies or {}
    self.session = requests.Session()
    self.session.cookies[".ROBLOSECURITY"] = cookie
    self.session.headers["x-csrf-token"] = get_token() or None

get_experience(self, UniverseId: int) -> Experience async

Get a experience object which is required to do anything with experiences.

Attributes:

Name Type Description
UniverseId

The ID of the game to get

Source code in ropython/client.py
async def get_experience(self, UniverseId: int) -> Experience:
    """
    Get a experience object which is required to do anything with experiences.

    Attributes:
        UniverseId: The ID of the game to get
    """
    return Experience(UniverseId)

get_token(self) -> Optional[str]

Get's a x-csrf-token from Roblox which is required for all requests.

Source code in ropython/client.py
def get_token(self) -> Optional[str]:
    """
    Get's a x-csrf-token from Roblox which is required for all requests.
    """
    # This doesn't acutally log you out since we aren't passing in a token
    r = self.session.post(
        "https://auth.roblox.com/v2/logout", cookies={".ROBLOSECURITY": self.cookie}
    )
    if r.headers["x-csrf-token"]:
        self.token = r.headers["x-csrf-token"]
        return r.headers["x-csrf-token"]