added dependancy on env var

pull/447/head
Drugsosos 3 years ago
parent 37d9d050ca
commit 3dcf20f314
No known key found for this signature in database
GPG Key ID: F96ED7B0753A13E6

@ -27,3 +27,7 @@ OPACITY="0.9"
# The absolute path of the folder where you want to save the final video
# If empty or wrong, the path will be 'assets/'
FINAL_VIDEO_PATH=""
# If True, all text that go through TTS will be filtered by inappropriate language
# Use "True" or "False" (default)
PROFANE_FILTER="False"

@ -7,6 +7,7 @@ from rich.progress import track
from rich.console import Console
import re
import os
from video_creation.profane_list.en import profane_list
console = Console()
@ -15,7 +16,7 @@ console = Console()
def profane_filter(text: str, word_list: list) -> str:
word_list.sort(reverse=True, key=len)
filtered_text = text
if any([word in word_list for word in text.split()]):
if any([word in word_list for word in text.split()]) and bool(os.getenv("PROFANE_FILTER", False)):
for word in word_list:
if word in text:
word_lenght = word.__len__()

Loading…
Cancel
Save