def decrypt_SMIL(self, encsmil): encdata = binascii.unhexlify(encsmil) expire_message = 'Your access to play this content has expired.' plus_message = 'please close any Hulu Plus videos you may be watching on other devices' proxy_message = 'you are trying to access Hulu through an anonymous proxy tool' for key in smildeckeys[:]: cbc = common.AES_CBC(binascii.unhexlify(key[0])) smil = cbc.decrypt(encdata, key[1]) log(smil) if (smil.find("<smil") == 0): #log( key) i = smil.rfind("</smil>") smil = smil[0:i + 7] return smil elif expire_message in smil: xbmcgui.Dialog().ok('Content Expired', expire_message) return False elif plus_message in smil: xbmcgui.Dialog().ok('Too many sessions', 'please close any Hulu Plus videos', 'you may be watching on other devices') return False elif proxy_message in smil: xbmcgui.Dialog().ok('Proxy Detected', 'Based on your IP address we noticed', 'you are trying to access Hulu', 'through an anonymous proxy tool') return False
def decrypt_subs(self, encsubs): encdata = binascii.unhexlify(encsubs) for key in subdeckeys[:]: cbc = common.AES_CBC(binascii.unhexlify(key[0])) subs = cbc.decrypt(encdata, key[1]) substart = subs.find("<P") if (substart > -1): i = subs.rfind("</P>") subs = subs[substart:i + 4] return subs
def ADdecrypt(self, data): key = '9d489e6c3adfb6a00a23eb7afc8944affd180546c719db5393e2d4177e40c77d' bindata = base64.decodestring(data)[1:] cbc = common.AES_CBC(binascii.unhexlify(key)) return cbc.decrypt(bindata)
def ADencrypt(self, data, iv): key = '9dbb5e376e65a64324e9269775dafd5b83c38f1d8819d5f1dc4ec2083c081bdb' cbc = common.AES_CBC(binascii.unhexlify(key)) encdata = cbc.encrypt(data, base64.decodestring(iv)) return base64.encodestring(encdata).replace('\n', '')