fixedLPPauditing

This commit is contained in:
Ubuntu 2025-03-27 07:28:37 +00:00
parent 6b4b406f6c
commit 4f8d2d1567
1 changed files with 22 additions and 6 deletions

View File

@ -166,32 +166,47 @@ def lpp_audit(msg):
aws_access_key_id="AKIAQVLBBGCB45RMLKVW",
aws_secret_access_key="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",
region_name="ap-south-1")
print("outputs1", outputfile, local_file_path)
print("outputs2", originalfile, original_file)
print("outputs1 : ", outputfile,"\n" ,local_file_path)
print("outputs2 : ", originalfile,"\n", original_file)
s3_client.download_file("conversion-kitchen", outputfile, local_file_path)
s3_client.download_file("conversion-kitchen", originalfile, original_file)
print("ran till here 4")
try:
language_code = "en"
print("above os.path.basename")
input_file = os.path.basename(local_file_path)
print(f"{input_file =}")
input_file1 = os.path.splitext(input_file)[0]
screenplay_name = input_file1 +"_LppVetted"
print(f"{screenplay_name =}")
script_file = local_file_path
script_ext = script_file.split(".")[-1]
print(f"{script_ext =}")
script_file_name = screenplay_name + "." + script_ext
print(f"{script_file_name =}")
# name_script = (str(local_file_path).split("."))[0] + "_vetted_a" + "." + (str(local_file_path).split("."))[1]
filename = str(local_file_path).split("/")[-1]
name_script = filename.split("_vetted_a")[0]
name_script = filename.split("_vetted_a")[0].rsplit(".", 1)[0]
doc_file = f"{local_file_path}"
file1 = ContentFile(
open(doc_file, 'rb').read(),
(doc_file.split("/"))[-1],
script_file_name,
)
print("going inside result")
result = filesystem.new_screenplay_without_audit_in_background(
file_user,
file_user.username,
str(name_script),
str(file_user.username),
str(screenplay_name),
file1,
"script-original",
language_code,
)
name_script = str(screenplay_name)
print("already called", result)
audit_id = result.get("script", {}).get("id")
print("ran till here 10")
print(f"{audit_id =}")
if audit_id is not None:
objectt = ScriptTranslations.objects.get(translation_id=lpp_user.translated_script.translation_id)
@ -229,6 +244,7 @@ def lpp_audit(msg):
except Exception as e:
print("Error in auditing vetted output is", e)
print("ran till here 11")
print(audit_id)
"""Blockchain Upload Starts here"""
# sys.stdout = original_stdout
status = ScriptAuditModel.objects.get(