func DecryptData(c *http.Client, data []byte, v *Download, aes128Keys *map[string][]byte) {
	var (
		iv          *bytes.Buffer
		keyData     []byte
		cipherBlock cipher.Block
	)

	if v.ExtXKey != nil && (v.ExtXKey.Method == "AES-128" || v.ExtXKey.Method == "aes-128") {

		keyData = (*aes128Keys)[v.ExtXKey.URI]

		if keyData == nil {
			req, _ := http.NewRequest("GET", v.ExtXKey.URI, nil)
			resp, _ := c.Do(req)
			keyData, _ = ioutil.ReadAll(resp.Body)
			resp.Body.Close()
			(*aes128Keys)[v.ExtXKey.URI] = keyData
		}

		if v.ExtXKey.IV == "" {
			iv = bytes.NewBuffer(IVPlaceholder)
			binary.Write(iv, binary.BigEndian, v.SeqNo)
		} else {
			iv = bytes.NewBufferString(v.ExtXKey.IV)
		}

		cipherBlock, _ = aes.NewCipher((*aes128Keys)[v.ExtXKey.URI])
		cipher.NewCBCDecrypter(cipherBlock, iv.Bytes()).CryptBlocks(data, data)
	}

}
// DecryptData decrypts the AES-128 encrypted data
DecryptData decrypts the AES-128 encrypted data
// DecryptData decrypts the AES - 128 encrypted data
func DecryptData(c *http.Client, data []byte, v *Download, aes128Keys *map[string][]byte) {
	var (
		iv          *bytes.Buffer
		keyData     []byte
		cipherBlock cipher.Block
	)
	if v.ExtXKey != nil && (v.ExtXKey.Method == "AES-128" || v.ExtXKey.Method == "aes-128") {
		keyData = (*aes128Keys)[v.ExtXKey.URI]
		if keyData == nil {
			req, _ := http.NewRequest("GET", v.ExtXKey.URI, nil)
			resp, _ := c.Do(req)
			keyData, _ = ioutil.ReadAll(resp.Body)
			resp.Body.Close()
			(*aes128Keys)[v.ExtXKey.URI] = keyData
		}
		if v.ExtXKey.IV == "" {
			iv = bytes.NewBuffer(IVPlaceholder)
			binary.Write(iv, binary.BigEndian, v.SeqNo)
		} else {
			iv = bytes.NewBufferString(v.ExtXKey.IV)
		}
		cipherBlock, _ = aes.NewCipher((*aes128Keys)[v.ExtXKey.URI])
		cipher.NewCBCDecrypter(cipherBlock, iv.Bytes()).CryptBlocks(data, data)
	}
}
func DecryptData ( c * http . Client , data [ ] byte , v * Download , aes128Keys * map [ string ] [ ] byte ) { var ( iv * bytes . Buffer keyData [ ] byte cipherBlock cipher . Block ) if v . ExtXKey != nil && ( v . ExtXKey . Method == " " || v . ExtXKey . Method == " " ) { keyData = ( * aes128Keys ) [ v . ExtXKey . URI ] if keyData == nil { req , _ := http . NewRequest ( " " , v . ExtXKey . URI , nil ) resp , _ := c . Do ( req ) keyData , _ = ioutil . ReadAll ( resp . Body ) resp . Body . Close ( ) ( * aes128Keys ) [ v . ExtXKey . URI ] = keyData } if v . ExtXKey . IV == " " { iv = bytes . NewBuffer ( IVPlaceholder ) binary . Write ( iv , binary . BigEndian , v . SeqNo ) } else { iv = bytes . NewBufferString ( v . ExtXKey . IV ) } cipherBlock , _ = aes . NewCipher ( ( * aes128Keys ) [ v . ExtXKey . URI ] ) cipher . NewCBCDecrypter ( cipherBlock , iv . Bytes ( ) ) . CryptBlocks ( data , data ) } }
DecryptData decrypts the AES-128 encrypted data
DecryptData decrypts the AES - 128 encrypted data