mirror of https://github.com/devine-dl/devine.git
fix(clearkey): Do not pad data before decryption
This is seemingly unnecessary and simply incorrect at least for two sources (VGTV, and TRUTV). Without this change it is not possible to correctly merge all segments without at least some problem in the resulting file.
This commit is contained in:
parent
03f3fec5cc
commit
e57d755837
|
@ -7,7 +7,7 @@ from typing import Optional, Union
|
|||
from urllib.parse import urljoin
|
||||
|
||||
from Cryptodome.Cipher import AES
|
||||
from Cryptodome.Util.Padding import pad, unpad
|
||||
from Cryptodome.Util.Padding import unpad
|
||||
from m3u8.model import Key
|
||||
from requests import Session
|
||||
|
||||
|
@ -43,7 +43,7 @@ class ClearKey:
|
|||
|
||||
decrypted = AES. \
|
||||
new(self.key, AES.MODE_CBC, self.iv). \
|
||||
decrypt(pad(path.read_bytes(), AES.block_size))
|
||||
decrypt(path.read_bytes())
|
||||
|
||||
try:
|
||||
decrypted = unpad(decrypted, AES.block_size)
|
||||
|
|
Loading…
Reference in New Issue