in rawdataset/ytdlps3/download_and_upload.py [0:0]
def log_failure(video_id, error_message, s3_bucket, s3_path):
error_file_path = f"/tmp/{video_id}.txt"
with open(error_file_path, 'w') as f:
f.write(error_message)
# Upload the error file to S3 in the failed/ subfolder
s3_client = boto3.client('s3')
s3_client.upload_file(error_file_path, s3_bucket, f"failed/{video_id}.txt")