Functionality for interacting with the Mojang API

get_players_current_skin(username)

Grab a player's current skin

Parameters:

Name Type Description Default
username str

A player's username

required

Returns:

Type Description
str

The player's skin, encoded in base64

Raises:

Type Description
ValueError

If no player with that username can be found

RuntimeError

If anything else goes wrong

Notes

While this query is case-insensitive, this method does not check if the provided username is valid

Source code in head_hunter/mojang.py
def get_players_current_skin(username: str) -> str:
    """Grab a player's current skin

    Parameters
    ----------
    username : str
        A player's username

    Returns
    -------
    str
        The player's skin, encoded in base64

    Raises
    ------
    ValueError
        If no player with that username can be found
    RuntimeError
        If anything else goes wrong

    Notes
    -----
    While this query is case-insensitive, this method does not check if the
    provided username is valid
    """
    uuid = _get_uuid_from_username(username)
    return _get_current_skin_from_uuid(uuid)