From 30c98abec77574b0f18a36d22ba03884d188f041 Mon Sep 17 00:00:00 2001 From: Sanyam Ahuja Date: Thu, 23 Jun 2022 05:08:18 +0530 Subject: [PATCH] Add better_profanity to censor words in title Add better_profanity to censor words in title/filename --- video_creation/final_video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 37b1ac2..0d2ddfa 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -3,7 +3,7 @@ import json import os import time from os.path import exists - +from better_profanity import profanity from moviepy.editor import ( VideoFileClip, AudioFileClip, @@ -111,8 +111,8 @@ def make_final_video(number_of_clips, length): else: return title[0:30] + "..." - filename = f"{get_video_title()}.mp4" - + uncensored_filename = f"{get_video_title()}.mp4" + filename = profanity.censor(uncensored_filename) def save_data(): with open("./video_creation/data/videos.json", "r+") as raw_vids: done_vids = json.load(raw_vids)