Update all the requirements, reformat a bit and fix the story mode character limit

pull/1607/head
Simon 2 years ago
parent 59cbf94207
commit 1dec673841

@ -107,20 +107,7 @@ def get_subreddit_threads(POST_ID: str):
if submission is None: if submission is None:
return get_subreddit_threads(POST_ID) # submission already done. rerun return get_subreddit_threads(POST_ID) # submission already done. rerun
if settings.config["settings"]["storymode"]: elif not submission.num_comments and settings.config["settings"]["storymode"] == "false":
if not submission.selftext:
print_substep("You are trying to use story mode on post with no post text")
exit()
else:
# Check for the length of the post text
if len(submission.selftext) > (
settings.config["settings"]["storymode_max_length"] or 2000
):
print_substep(
f"Post is too long ({len(submission.selftext)}), try with a different post. ({settings.config['settings']['storymode_max_length']} character limit)"
)
exit()
elif not submission.num_comments:
print_substep("No comments found. Skipping.") print_substep("No comments found. Skipping.")
exit() exit()

@ -1,23 +1,23 @@
boto3==1.24.24 boto3==1.26.142
botocore==1.27.24 botocore==1.29.142
gTTS==2.2.4 gTTS==2.3.2
moviepy==1.0.3 moviepy==1.0.3
playwright==1.23.0 playwright==1.34.0
praw==7.6.1 praw==7.7.0
prawcore~=2.3.0 prawcore~=2.3.0
requests==2.28.1 requests==2.31.0
rich==13.3.5 rich==13.3.5
toml==0.10.2 toml==0.10.2
translators==5.3.1 translators==5.7.6
pyttsx3==2.90 pyttsx3==2.90
Pillow~=9.4.0 Pillow==9.5.0
tomlkit==0.11.8 tomlkit==0.11.8
Flask==2.3.2 Flask==2.3.2
clean-text==0.6.0 clean-text==0.6.0
unidecode==1.3.2 unidecode==1.3.6
spacy==3.4.1 spacy==3.5.3
torch==1.12.1 torch==2.0.1
transformers==4.25.1 transformers==4.29.2
ffmpeg-python==0.2.0 ffmpeg-python==0.2.0
elevenlabs==0.2.10 elevenlabs==0.2.16
yt-dlp==2023.3.4 yt-dlp==2023.3.4

@ -64,13 +64,13 @@ def imagemaker(theme, reddit_obj: dict, txtclr, padding=5, transparent=False) ->
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
if transparent: if transparent:
font = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 50) font = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 100)
tfont = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 50) tfont = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 100)
else: else:
tfont = ImageFont.truetype( tfont = ImageFont.truetype(
os.path.join("fonts", "Roboto-Bold.ttf"), 100 os.path.join("fonts", "Roboto-Bold.ttf"), 100
) # for title ) # for title
font = ImageFont.truetype(os.path.join("fonts", "Roboto-Regular.ttf"), 90) font = ImageFont.truetype(os.path.join("fonts", "Roboto-Regular.ttf"), 100)
size = (1920, 1080) size = (1920, 1080)
image = Image.new("RGBA", size, theme) image = Image.new("RGBA", size, theme)

@ -57,6 +57,19 @@ def get_subreddit_undone(
f'This post has under the specified minimum of comments ({settings.config["reddit"]["thread"]["min_comments"]}). Skipping...' f'This post has under the specified minimum of comments ({settings.config["reddit"]["thread"]["min_comments"]}). Skipping...'
) )
continue continue
if settings.config["settings"]["storymode"]:
if not submission.selftext:
print_substep("You are trying to use story mode on post with no post text")
continue
else:
# Check for the length of the post text
if len(submission.selftext) > (
settings.config["settings"]["storymode_max_length"] or 2000
):
print_substep(
f"Post is too long ({len(submission.selftext)}), try with a different post. ({settings.config['settings']['storymode_max_length']} character limit)"
)
continue
if settings.config["settings"]["storymode"] and not submission.is_self: if settings.config["settings"]["storymode"] and not submission.is_self:
continue continue
if similarity_scores is not None: if similarity_scores is not None:
@ -73,7 +86,7 @@ def get_subreddit_undone(
] # set doesn't have __getitem__ ] # set doesn't have __getitem__
index = times_checked + 1 index = times_checked + 1
if index == len(VALID_TIME_FILTERS): if index == len(VALID_TIME_FILTERS):
print("all time filters have been checked you absolute madlad ") print("All submissions have been done.")
return get_subreddit_undone( return get_subreddit_undone(
subreddit.top( subreddit.top(

@ -377,7 +377,7 @@ def make_final_video(
) )
old_percentage = pbar.n old_percentage = pbar.n
pbar.update(100 - old_percentage) pbar.update(100 - old_percentage)
if(allowOnlyTTSFolder): if allowOnlyTTSFolder:
path = defaultPath + f"/OnlyTTS/{filename}" path = defaultPath + f"/OnlyTTS/{filename}"
path = path[:251] + ".mp4" # Prevent a error by limiting the path length, do not change this. path = path[:251] + ".mp4" # Prevent a error by limiting the path length, do not change this.
print_step("Rendering the Only TTS Video 🎥") print_step("Rendering the Only TTS Video 🎥")

Loading…
Cancel
Save