Skip to content

Instantly share code, notes, and snippets.

@pbsds
Last active August 29, 2015 14:19
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 pbsds/4ce7d36785824f5fc4e3 to your computer and use it in GitHub Desktop.
Save pbsds/4ce7d36785824f5fc4e3 to your computer and use it in GitHub Desktop.
Computes a md5 hash from the bgm data of a flipnote
import PPM, sys, hashlib, warnings
warnings.filterwarnings("ignore")#disables the futurewarnings from numpy, bad practice!
if len(sys.argv) < 2:
print "error, no ppm filepath provided"
sys.exit(1)
flip = PPM.PPM().ReadFile(sys.argv[1], ReadFrames=False, ReadSound=True)
if not flip.SoundData[0]:
print "No BGM"
else:
print hashlib.md5(flip.SoundData[0]).hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment