Skip to content

Instantly share code, notes, and snippets.

@labeneator
Created August 7, 2017 09:11
Show Gist options
  • Save labeneator/7513730c851bf11312ef6f1784f8a5f6 to your computer and use it in GitHub Desktop.
Save labeneator/7513730c851bf11312ef6f1784f8a5f6 to your computer and use it in GitHub Desktop.
def deobs_pluralsight(fpath, target_dir):
fname = os.path.basename(fpath)
target_fname = fname.replace('psv', 'mp4')
target_file_path = os.path.join(target_dir, target_fname)
with open(target_file_path, "wb") as ofh:
for byte in bytearray(open(fpath, "rb").read()):
ofh.write(chr(byte ^ 101))
def deobfuscate(arg,dirname,fnames):
if fnames:
for fname in fnames:
fpath = os.path.join(dirname, fname)
print fpath
deobs_pluralsight(fpath, target_dir)
source_dir = "/Users/<me>/Library/Application Support/com.pluralsight.pluralsight-mac/ClipDownloads/"
target_dir = "/Users/<me>/Documents/learning/pluralsight"
if not os.path.isdir(target_dir):
mkpath(target_dir)
os.path.walk(source_dir, deobfuscate, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment