From 4cc1ff7620c5ceded15ef277425ba337350d7d2c Mon Sep 17 00:00:00 2001 From: Clair Delafuente Date: Mon, 18 Aug 2025 14:55:10 -0400 Subject: [PATCH] Initial commit --- .gitignore | 5 +++ README.md | 0 __init__.py | 54 +++++++++++++++++++++++++++ __pycache__/config.cpython-313.pyc | Bin 0 -> 190 bytes config.example.py | 5 +++ logs/appsettings.log | 15 ++++++++ pyproject.toml | 20 ++++++++++ src/appsettings_archiver/__init__.py | 0 tests/__init__.py | 0 9 files changed, 99 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __pycache__/config.cpython-313.pyc create mode 100644 config.example.py create mode 100644 logs/appsettings.log create mode 100644 pyproject.toml create mode 100644 src/appsettings_archiver/__init__.py create mode 100644 tests/__init__.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9af7446 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Ignore production configuration +config.py + +# Ignore Poetry garbage +poetry.lock \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..d159a20 --- /dev/null +++ b/__init__.py @@ -0,0 +1,54 @@ +import requests +import os +import config +import logging +import sys +import json + +VERSION = "0.0.1" + +# Load configuration +ROBLOSECURITY = config.roblosecurity or None +DST_DIR = config.dst_dir or './AppSettings' + +# Collect AppSettings endpoints +AppSettings = { + "PCStudioApp": "https://clientsettingscdn.roblox.com/v2/settings/application/PCStudioApp", + "PCDesktopClient": "https://clientsettingscdn.roblox.com/v2/settings/application/PCDesktopClient", + "MacDesktopClient": "https://clientsettingscdn.roblox.com/v2/settings/application/MacDesktopClient", + "MacStudioClient": "https://clientsettingscdn.roblox.com/v2/settings/application/MacStudioApp", + "UWPApp": "https://clientsettingscdn.roblox.com/v2/settings/application/UWPApp", + "XboxClient": "https://clientsettingscdn.roblox.com/v2/settings/application/XboxClient", + "AndroidApp": "https://clientsettingscdn.roblox.com/v2/settings/application/AndroidApp", +} + +# Prepare logs +if not os.path.exists("logs"): + os.makedirs("logs") +log_format = logging.Formatter( + "[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s" +) +stdout_handler = logging.StreamHandler(sys.stdout) +stdout_handler.setFormatter(log_format) +logfile_handler = logging.FileHandler("logs/appsettings.log", mode="w") +logfile_handler.setFormatter(log_format) +log = logging.getLogger("AppSettings-archiver") +log.setLevel(logging.INFO) +log.addHandler(stdout_handler) +log.addHandler(logfile_handler) + +if ROBLOSECURITY is None: + log.warning(f"{"#"*6} ROBLOSECURITY IS NOT SET, SOME FFLAGS MAY BE MISSING {"#"*6}") + +os.makedirs(DST_DIR, exist_ok=True) + +for AppSetting in AppSettings: + log.info(f"Processing {AppSetting}") + response = requests.get(AppSettings[AppSetting], headers={"Cookie": f".ROBLOSECURITY={ROBLOSECURITY}"}) + if response.status_code == 200: + log.info(f"Successfully retrieved {AppSetting}") + with open(os.path.join(DST_DIR, f"{AppSetting}.json"), "w") as f: + formatted_response = json.dumps(response.json(), indent=4) + f.write(formatted_response) + else: + log.error(f"Failed to retrieve {AppSetting}: {response.status_code}") \ No newline at end of file diff --git a/__pycache__/config.cpython-313.pyc b/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ef81eb050dcc99698bbe587a76a466c6505bf66 GIT binary patch literal 190 zcmey&%ge<81d4@=GjxIUV-N=h7@>^MJV3@&hG2#whG51b#&jl4=35L^yn6bM1qH#W zB_)}8>BWAUOt*N8@{@A%i&K+Ji!w_pZ?UHom&B)J7OiCX3^M4Js*6=jdS*!sk}loE zqU4OsvecrO=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/src/appsettings_archiver/__init__.py b/src/appsettings_archiver/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29