node-snapchat
node-snapchat copied to clipboard
Add story support
We just need to figure out how to decrypt the data with node/openssl. In php it's MCRYPT_RIJNDAEL_128 in CBC mode.
Been trying to crack this with Node too. The equivalent so far for the php MCRYPT_RIJNDAEL_128 is aes-256-cbc with the key and IV. I can't seem to get a working, unencrypted image though.
oh, i got it working, I'll add it in a new branch
function get_story(url, iv, key, output_stream) {
var iv = new Buffer(iv, 'base64');
var key = new Buffer(key, 'base64');
https.get(url), function(blob) {
try {
if(blob.statusCode==200)
return blob.pipe(crypto.createDecipheriv('aes-256-cbc', key, iv))
.pipe(output_stream);
} catch(error) {
// openssl error, if not caught, process exits
}
});
}
should work with both blob and thumb. blob can be mp4 video, jpeg image, or zip of png image overlay and mp4 video