add character limit for male voice

This commit is contained in:
Arjun Dureja committed 2022-06-03 13:51:43 -04:00
1 parent c03bd2ae82
commit 3f32feaa24
2 files changed
+5 -3

No files matched your search

+2 -2
View File
@@ -15,9 +15,9 @@ print_markdown(
time.sleep(3)
reddit_object = get_askreddit_threads()
load_dotenv()
reddit_object = get_askreddit_threads(os.getenv("VOICE"))
length, number_of_comments = save_text_to_mp3(reddit_object, os.getenv("VOICE"))
download_screenshots_of_reddit_posts(reddit_object, number_of_comments)
download_background()
+3 -1
View File
@@ -5,7 +5,7 @@ from dotenv import load_dotenv
import os
def get_askreddit_threads():
def get_askreddit_threads(voice):
"""
Returns a list of threads from the AskReddit subreddit.
"""
@@ -32,6 +32,8 @@ def get_askreddit_threads():
content["comments"] = []
for top_level_comment in submission.comments:
if voice == "male" and len(top_level_comment.body) > 550:
continue
content["comments"].append(
{
"comment_body": top_level_comment.body,