Skip to content

Instantly share code, notes, and snippets.

@enXov
Last active January 14, 2026 14:03
Show Gist options
  • Select an option

  • Save enXov/6cac19c2d2bf0b720bf4c42d6f6f1d0f to your computer and use it in GitHub Desktop.

Select an option

Save enXov/6cac19c2d2bf0b720bf4c42d6f6f1d0f to your computer and use it in GitHub Desktop.

Based on my research, here is the general logic regarding this code and Unity Auth: The PLAYER_ID, UNITY_PROJECT_ID, and LEADERBOARD_ID always remain the same. However, there is a crucial point: the token value changes every time you restart the game. In fact, if you leave the game open for about 15 minutes, the token expires and changes again. There is actually a refresh_token system in place; essentially, it's a basic HTTP intercept process.

How to get this information: To capture this data, I personally use Fiddler Everywhere. It’s very simple, has a great ui, provides an understandable flow, and automatically handles HTTPS decryption for me (thanks Fiddler! xd). After entering the game and press the scene(button) which have the leaderboard section, if you analyze the traffic carefully, you will find all these values. This is generally how Unity Auth leaderboards work. Good luck! xd

One final note on bans: Developers using the Unity Auth system often link their tables with Steam IDs. This means if you get banned after using a leaderboard cheat, you most likely won't be able to enter the game again. But no need to worry; if you open a different Steam account, you can get back in with a 99% probability... Though, generally speaking, you do get banned after cheating on the leaderboard xd.

from urllib3.exceptions import InsecureRequestWarning
from requests.exceptions import RequestException
from urllib3 import disable_warnings
from requests import post
disable_warnings(InsecureRequestWarning)
NEW_SCORE: int = 9999999
PLAYER_ID: str = "PLAYER_ID_PLACEHOLDER"
TOKEN: str = "Bearer TOKEN_PLACEHOLDER"
UNITY_PROJECT_ID: str = "UNITY_PROJECT_ID_PLACEHOLDER"
WEEKLY_LEADERBOARD_ID: str = "Weekly_Leaderboard"
def update_player_score() -> str:
headers: dict = {
"User-Agent": "UnityPlayer/6000.1.3f1 (UnityWebRequest/1.0, libcurl/8.10.1-DEV)",
"Accept-Encoding": "deflate, gzip",
"authorization": TOKEN,
"Unity-Client-Version": "6000.1.3f1",
"Unity-Client-Mode": "play",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Unity-Version": "6000.1.3f1"
}
data: dict = {
"score": float(NEW_SCORE)
}
weekly_score_endpoint: str = f"https://leaderboards.services.api.unity.com/v1/projects/{UNITY_PROJECT_ID}/leaderboards/{WEEKLY_LEADERBOARD_ID}/scores/players/{PLAYER_ID}"
try:
response = post(weekly_score_endpoint, headers=headers, json=data, verify=False)
if response.status_code == 200: return f"Weekly Leaderboard scores have been successfully updated! New score: {NEW_SCORE}"
else: return f"An error occurred while updating the Weekly Leaderboard score: {response.status_code} - {response.text}"
except RequestException as e: return f"Request error: {e}"
if __name__ == "__main__": print(update_player_score())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment