Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (17 sloc) 426 Bytes
from PIL import Image
# Extract mjpg to jpg
f = open("miaowth.mjpg")
m = f.read()
m = m.split('\xff\xd8\xff\xe0')
for i in range(1, len(m)):
f = open('extract/frame%d.jpg' % i, 'w')
f.write('\xff\xd8\xff\xe0' + m[i])
f.close()
# Extract hidden message
res = ''
for i in range(1, len(m)):
f = open('extract/frame%d.jpg' % i)
p = f.read()
footer = p.find('\xff\xd9')
res += p[footer + 2]
print res