error fix : post id fixed

pull/1288/head
electro199 3 years ago
parent 94cffcb640
commit a909661a20

@ -43,7 +43,7 @@ checkversion(__VERSION__)
def main(POST_ID=None): def main(POST_ID=None):
reddit_object = get_subreddit_threads(POST_ID) # reddit_object = get_subreddit_threads(POST_ID)
global redditid global redditid
redditid = id(reddit_object) redditid = id(reddit_object)
length, number_of_comments = save_text_to_mp3(reddit_object) length, number_of_comments = save_text_to_mp3(reddit_object)
@ -85,7 +85,7 @@ if __name__ == "__main__":
) )
config is False and exit() config is False and exit()
try: try:
if len(config["reddit"]["thread"]["post_id"].split("+")) > 1: if config["reddit"]["thread"]["post_id"] :
for index, post_id in enumerate( for index, post_id in enumerate(
config["reddit"]["thread"]["post_id"].split("+") config["reddit"]["thread"]["post_id"].split("+")
): ):

@ -76,13 +76,13 @@ def get_subreddit_threads(POST_ID: str):
if POST_ID: # would only be called if there are multiple queued posts if POST_ID: # would only be called if there are multiple queued posts
submission = reddit.submission(id=POST_ID) submission = reddit.submission(id=POST_ID)
elif ( # elif (
settings.config["reddit"]["thread"]["post_id"] # settings.config["reddit"]["thread"]["post_id"]
and len(str(settings.config["reddit"]["thread"]["post_id"]).split("+")) == 1 # and len(str(settings.config["reddit"]["thread"]["post_id"]).split("+")) == 1
): # ):
submission = reddit.submission( # submission = reddit.submission(
id=settings.config["reddit"]["thread"]["post_id"] # id=settings.config["reddit"]["thread"]["post_id"]
) # )
else: else:
threads = subreddit.hot(limit=25) threads = subreddit.hot(limit=25)
submission = get_subreddit_undone(threads, subreddit) submission = get_subreddit_undone(threads, subreddit)
@ -94,6 +94,9 @@ def get_subreddit_threads(POST_ID: str):
if not submission.selftext and settings.config["reddit"]["thread"]["post_id"] != "": if not submission.selftext and settings.config["reddit"]["thread"]["post_id"] != "":
print_substep("You are trying to use story mode on post with no post text") print_substep("You are trying to use story mode on post with no post text")
exit() exit()
elif not submission.selftext:
print_substep("You are trying to use story mode on post with no post text") # not allow postid post with no self text it story == true
return get_subreddit_threads(POST_ID)
else: else:
# Check for the length of the post text # Check for the length of the post text
if len(submission.selftext) > (settings.config["settings"]["storymode_max_length"] or 2000): if len(submission.selftext) > (settings.config["settings"]["storymode_max_length"] or 2000):

Loading…
Cancel
Save