fix(md5): 🐞 hash_new param fix for downloaded content check

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER 2023-12-28 23:59:31 +03:00
parent 7425303382
commit fcd6866337
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
1 changed files with 3 additions and 2 deletions

View File

@ -35,9 +35,10 @@ def is_md5_hash_matching(filename: str, original_md5_hash: str) -> bool:
with open(filename, "rb") as file:
file_contents = file.read()
computed_md5_hash = hash_new(file_contents, name="MD5").hexdigest()
computed_md5_hash = hash_new(name="MD5")
computed_md5_hash.update(file_contents)
return computed_md5_hash == original_md5_hash
return computed_md5_hash.hexdigest() == original_md5_hash
def download_assets(asset_name: Union[VideoAssets, str]) -> str: