| 1 | # was generated with chatgpt |
| 2 | import vdf |
| 3 | import json |
| 4 | |
| 5 | def extract_launch_options(filepath): |
| 6 | with open(filepath, 'r', encoding='utf-8') as f: |
| 7 | data = vdf.load(f) |
| 8 | |
| 9 | results = [] |
| 10 | |
| 11 | def walk(node): |
| 12 | for key, val in node.items(): |
| 13 | if isinstance(val, dict): |
| 14 | if key.isdigit() and "LaunchOptions" in val: |
| 15 | results.append({ |
| 16 | "appid": key, |
| 17 | "LaunchOptions": val["LaunchOptions"] |
| 18 | }) |
| 19 | walk(val) |
| 20 | |
| 21 | walk(data) |
| 22 | return results |
| 23 | |
| 24 | if __name__ == "__main__": |
| 25 | import argparse |
| 26 | |
| 27 | parser = argparse.ArgumentParser("extract") |
| 28 | parser.add_argument("filepath", help="the path to the VDF file to extract") |
| 29 | args = parser.parse_args() |
| 30 | |
| 31 | print(json.dumps(extract_launch_options(args.filepath), indent=2)) |
| 32 |
jackz / Extract Steam Launch Options
Last active 4 months ago
Extracts LaunchOptions from steam, showing appid & options. python3 extract.py ~/.local/.steam/steam/userdata/#####/config/localconfig.vdf
Revision 96a90b48d90a0fb10a00a23b1e958520a28fb509