Skip to content

Instantly share code, notes, and snippets.

@jericjan
Created January 13, 2024 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jericjan/38ad598042cfad936ab4b3f005060f7d to your computer and use it in GitHub Desktop.
Save jericjan/38ad598042cfad936ab4b3f005060f7d to your computer and use it in GitHub Desktop.
L4D2 - Consistency error culprit finder
import vpk
from pathlib import Path
import subprocess
# Paste the path to your workshop folder here
workshop_folder = (
"F:/SteamLibrary/steamapps/common/Left 4 Dead 2/left4dead2/addons/workshop"
)
# Paste the file path to the file that has a consistency error here
target_file = "models/infected/charger.mdl"
for file in Path(workshop_folder).glob("*.vpk"):
pak1 = vpk.open(str(file.resolve()))
try:
pakfile = pak1.get_file(target_file)
print(f"{file.name} has it!")
subprocess.call(f"{file.parent / file.stem}.jpg", shell=True)
# Opens in default image viewer
except:
pass
print("Scan complete!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment