Fix:(Bug)empty string in story mode
This commit is contained in:
1 parent
dabbd04af9
commit
f0e5138857
5 files changed
+18
-8
No files matched your search
+3
-2
@@ -41,8 +41,9 @@ def get_subreddit_threads(POST_ID: str):
|
||||
check_for_async=False,
|
||||
)
|
||||
except ResponseException as e:
|
||||
if e.response.status_code == 401:
|
||||
print("Invalid credentials - please check them in config.toml")
|
||||
match e.response.status_code:
|
||||
case 401:
|
||||
print("Invalid credentials - please check them in config.toml")
|
||||
except:
|
||||
print("Something went wrong...")
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ def imagemaker( theme,
|
||||
title=reddit_obj['thread_title']
|
||||
texts=reddit_obj['thread_post']
|
||||
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
|
||||
tfont=ImageFont.truetype("fonts\Roboto-Bold.ttf",27) # for title
|
||||
font=ImageFont.truetype("fonts\Roboto-Regular.ttf", 20)# for despcription|comments
|
||||
tfont=ImageFont.truetype("fonts\\Roboto-Bold.ttf",27) # for title
|
||||
font=ImageFont.truetype("fonts\\Roboto-Regular.ttf", 20)# for despcription|comments
|
||||
size=(500,176)
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import re
|
||||
import spacy
|
||||
from utils.voice import sanitize_text
|
||||
|
||||
#working good
|
||||
def posttextparser(obj):
|
||||
@@ -15,10 +16,13 @@ def posttextparser(obj):
|
||||
|
||||
doc= nlp(text)
|
||||
|
||||
newtext=[]
|
||||
newtext:list = []
|
||||
|
||||
|
||||
# to check for space str
|
||||
for line in doc.sents:
|
||||
newtext.append(line.text)
|
||||
# print(line)
|
||||
|
||||
if sanitize_text(line.text):
|
||||
newtext.append(line.text)
|
||||
# print(line)
|
||||
|
||||
return newtext
|
||||
@@ -179,6 +179,8 @@ def make_final_video(
|
||||
audio_bitrate="192k",
|
||||
verbose=False,
|
||||
threads=multiprocessing.cpu_count(),
|
||||
# preset="ultrafast" #for testings
|
||||
|
||||
)
|
||||
ffmpeg_extract_subclip(
|
||||
f"assets/temp/{id}/temp.mp4",
|
||||
|
||||
@@ -26,8 +26,11 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in
|
||||
reddit_object (Dict): Reddit object received from reddit/subreddit.py
|
||||
screenshot_num (int): Number of screenshots to download
|
||||
"""
|
||||
|
||||
print_step("Downloading screenshots of reddit posts...")
|
||||
|
||||
id = re.sub(r"[^\w\s-]", "", reddit_object["thread_id"])
|
||||
|
||||
# ! Make sure the reddit screenshots folder exists
|
||||
Path(f"assets/temp/{id}/png").mkdir(parents=True, exist_ok=True)
|
||||
def download(cookie_file,num=None):
|
||||
|
||||
Reference in new issue
Block a user