add character limit for male voice

pull/92/head
Arjun Dureja 3 years ago
parent c03bd2ae82
commit 3f32feaa24

@ -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()

@ -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,

Loading…
Cancel
Save