Skip to content

Commit 8e5b7a9

Browse files
Fix for path at background.py and added TikTok error message just in case
1 parent ee6363c commit 8e5b7a9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

TTS/TikTok.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ def run(self, text: str, filepath: str, random_voice: bool = False):
108108
raise TikTokTTSException(status_code, data["message"])
109109

110110
# decode data from base64 to binary
111-
raw_voices = data["data"]["v_str"]
111+
try:
112+
raw_voices = data["data"]["v_str"]
113+
except:
114+
print("The TikTok TTS returned an invalid response. Please try again later, and report this bug.")
115+
raise TikTokTTSException(0, "Invalid response")
112116
decoded_voices = base64.b64decode(raw_voices)
113117

114118
# write voices to specified filepath

video_creation/background.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from utils.console import print_step, print_substep
1414

1515
# Load background videos
16-
with open("utils/backgrounds.json") as json_file:
16+
with open("./utils/backgrounds.json") as json_file:
1717
background_options = json.load(json_file)
1818

1919
# Remove "__comment" from backgrounds

0 commit comments

Comments
 (0)