from Crypto.Cipher import AES
from m3u8 import Segment


def is_encrypted(segment: Segment):
    return segment.key


def decrypt_aes128cbc(blob_bytes: [bytes], key_bytes: [bytes], iv_string: str):
    cipher = AES.new(key_bytes, AES.MODE_CBC, int(iv_string, 16).to_bytes(
        16, byteorder='big'))
    return cipher.decrypt(blob_bytes)

477ec67c34f3f5293a375597a0d30c64fcf07c7b
<mask token>

<mask token>


def decrypt_aes128cbc(blob_bytes: [bytes], key_bytes: [bytes], iv_string: str):
    cipher = AES.new(key_bytes, AES.MODE_CBC, int(iv_string, 16).to_bytes(
        16, byteorder='big'))
    return cipher.decrypt(blob_bytes)

<mask token>


def is_encrypted(segment: Segment):
    return segment.key


def decrypt_aes128cbc(blob_bytes: [bytes], key_bytes: [bytes], iv_string: str):
    cipher = AES.new(key_bytes, AES.MODE_CBC, int(iv_string, 16).to_bytes(
        16, byteorder='big'))
    return cipher.decrypt(blob_bytes)

from Crypto.Cipher import AES
from m3u8 import Segment


def is_encrypted(segment: Segment):
    return segment.key


def decrypt_aes128cbc(blob_bytes: [bytes], key_bytes: [bytes], iv_string: str):
    cipher = AES.new(key_bytes, AES.MODE_CBC, int(iv_string, 16).to_bytes(
        16, byteorder='big'))
    return cipher.decrypt(blob_bytes)
