Skip to content

Instantly share code, notes, and snippets.

@Kardelio
Created April 3, 2024 11:39
Show Gist options
  • Save Kardelio/b3a21d4763d334293b38e34d9178fc1b to your computer and use it in GitHub Desktop.
Save Kardelio/b3a21d4763d334293b38e34d9178fc1b to your computer and use it in GitHub Desktop.
Decompress contents of Git object file (zlib)
#!/usr/bin/env python3
import zlib
import sys
if len(sys.argv) > 1:
print(f"File in was: {sys.argv[1]}")
file=sys.argv[1]
else:
print("File in was BLANK, please pass a zlibbed file path...")
exit(1)
try:
compressed_str = open(file, 'rb').read()
decompressed = zlib.decompress(compressed_str)
print(decompressed)
except:
print("Something went wrong")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment