Last active 3 months ago

Extracts LaunchOptions from steam, showing appid & options. python3 extract.py ~/.local/.steam/steam/userdata/#####/config/localconfig.vdf

Revision 32c61c3a3a2e57bad85f60614aad56558f0d0b2a

extract.py Raw
1# was generated with chatgpt
2import json
3import re
4
5def extract_launch_options(file_path):
6 # Open the file and read the contents
7 with open(file_path, 'r', encoding='utf-8') as file:
8 file_contents = file.read()
9
10 # Use a regular expression to find appids and their corresponding LaunchOptions
11 pattern = r'"(\d+)"\s*\{[^}]*?"LaunchOptions"\s*"\s*([^"]+)\s*"'
12
13 matches = re.findall(pattern, file_contents)
14
15 if matches:
16 for appid, launch_options in matches:
17 print(f"AppID: {appid}")
18 print(f"Launch Options: {launch_options}")
19 print("-" * 40)
20 else:
21 print("No LaunchOptions found in the file.")
22
23extract_launch_options('/run/media/jackz/3a44ccb4-9c88-4e02-b399-dceb44b3229a/home/jackz/.steam/debian-installation/userdata/98487534/config/localconfig.vdf')