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