diff --git a/youtube_dl/blowfish.py b/youtube_dl/blowfish.py index 200015db0..24c0125f0 100644 --- a/youtube_dl/blowfish.py +++ b/youtube_dl/blowfish.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -import struct +from compat import compat_struct_unpack, compat_struct_pack # Blowfish implementation, translated from original C code by Bruce Schneier. @@ -292,9 +292,9 @@ def blowfish_cbc_decrypt(data, key, iv): """ fmt = ">%dL" % (len(data) // 4) c = Blowfish(key) - ivl, ivr = struct.unpack(">LL", iv) + ivl, ivr = compat_struct_unpack(">LL", iv) out = [] - ind = struct.unpack(fmt, data) + ind = compat_struct_unpack(fmt, data) for i in range(0, len(ind), 2): l, r = c.decipher(ind[i], ind[i + 1]) @@ -305,7 +305,7 @@ def blowfish_cbc_decrypt(data, key, iv): out.append(l) out.append(r) - return struct.pack(fmt, *out) + return compat_struct_pack(fmt, *out) __all__ = ['blowfish_cbc_decrypt']