Created
August 21, 2022 22:17
-
-
Save velzie/b9f73834fe31702fe2845ef54dfe5dbd to your computer and use it in GitHub Desktop.
Unpacker for source VPK files on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import vpk | |
from pathlib import Path | |
import os | |
pakdir = "pak01_dir.vpk" | |
pak1 = vpk.open(pakdir); | |
os.mkdir("pak01") | |
for filepath in pak1: | |
pakfile = pak1.get_file(filepath); | |
dirname = Path(filepath).parent.as_posix(); | |
Path("pak01/" + dirname).mkdir(parents=True,exist_ok=True) | |
pakfile.save("pak01/" + filepath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment