meme support

This commit is contained in:
Kristian committed 2024-03-22 17:41:40 +01:00
1 parent 853ba49b3d
commit b508f2af73
6 files changed
+84 -31

No files matched your search

+2
View File
@@ -25,6 +25,8 @@ theme = { optional = false, default = "dark", example = "light", options = ["dar
times_to_run = { optional = false, default = 1, example = 2, explanation = "Used if you want to run multiple times. Set to an int e.g. 4 or 29 or 1", type = "int", nmin = 1, oob_error = "It's very hard to run something less than once." }
opacity = { optional = false, default = 0.9, example = 0.8, explanation = "Sets the opacity of the comments when overlayed over the background", type = "float", nmin = 0, nmax = 1, oob_error = "The opacity HAS to be between 0 and 1", input_error = "The opacity HAS to be a decimal number between 0 and 1" }
#transition = { optional = true, default = 0.2, example = 0.2, explanation = "Sets the transition time (in seconds) between the comments. Set to 0 if you want to disable it.", type = "float", nmin = 0, nmax = 2, oob_error = "The transition HAS to be between 0 and 2", input_error = "The opacity HAS to be a decimal number between 0 and 2" }
mememode = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Only show post content, and multipile of them (no comments)" }
memes_per_vid = { optional = true, default = 10, example = 10, explanation = "Number of memes per video", type = "int", nmin = 1, oob_error = "It's very hard to run something less than once." }
storymode = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Only read out title and post content, great for subreddits with stories" }
storymodemethod= { optional = true, default = 1, example = 1, explanation = "Style that's used for the storymode. Set to 0 for single picture display in whole video, set to 1 for fancy looking video ", type = "int", nmin = 0, oob_error = "It's very hard to run something less than once.", options = [0, 1] }
storymode_max_length = { optional = true, default = 1000, example = 1000, explanation = "Max length of the storymode video in characters. 200 characters are approximately 50 seconds.", type = "int", nmin = 1, oob_error = "It's very hard to make a video under a second." }
+3 -3
View File
@@ -50,7 +50,7 @@ def get_subreddit_undone(submissions: list, subreddit, times_checked=0, similari
f'This post has under the specified minimum of comments ({settings.config["reddit"]["thread"]["min_comments"]}). Skipping...'
)
continue
if settings.config["settings"]["storymode"]:
if settings.config["settings"]["storymode"] and not settings.config["settings"]["mememode"]:
if not submission.selftext:
print_substep("You are trying to use story mode on post with no post text")
continue
@@ -63,9 +63,9 @@ def get_subreddit_undone(submissions: list, subreddit, times_checked=0, similari
f"Post is too long ({len(submission.selftext)}), try with a different post. ({settings.config['settings']['storymode_max_length']} character limit)"
)
continue
elif len(submission.selftext) < 30:
elif len(submission.selftext) < 30:
continue
if settings.config["settings"]["storymode"] and not submission.is_self:
if settings.config["settings"]["storymode"] and not submission.is_self and not settings.config["settings"]["mememode"]:
continue
if similarity_scores is not None:
return submission, similarity_scores[i].item()