elebumm / RedditVideoMakerBot

Create Reddit Videos with just✨ one command ✨
GNU General Public License v3.0
6.66k stars 1.86k forks source link

[Bug]: Text too long to create speech audio #1680

Closed Teric7 closed 1 year ago

Teric7 commented 1 year ago

Describe the bug

======================================================================= The bug is as the title states, I get an error now after generating less than 20 videos in the last 6 hours stating "TTS.TikTok.TikTokTTSException: Code: 2, reason: the text is too long, message: Text too long to create speech audio"

======================================================================= Here is my config.toml:

[ai] ai_similarity_enabled = false ai_similarity_keywords = ""

[settings] allow_nsfw = false theme = "transparent" times_to_run = 10 opacity = 1.0 storymode = true storymodemethod = 1 storymode_max_length = 5000 resolution_w = 1080 resolution_h = 1920 zoom = 1.0

[settings.background] background_video = "minecraft" background_audio = "lofi" background_audio_volume = 0.0 enable_extra_audio = false background_thumbnail = false background_thumbnail_font_family = "arial" background_thumbnail_font_size = 96 background_thumbnail_font_color = "255,255,255"

[settings.tts] voice_choice = "tiktok" random_voice = false elevenlabs_voice_name = "Bella" elevenlabs_api_key = "" aws_polly_voice = "" streamlabs_polly_voice = "" tiktok_voice = "en_us_001" tiktok_sessionid = "" python_voice = "1" py_voice_num = "2" no_emojis = false silence_duration = 0.5

[reddit.creds] client_id = "" client_secret = "" username = "" password = "" 2fa = false

[reddit.thread] random = true subreddit = "AskReddit+AITAH" post_id = "" max_comment_length = 500 min_comment_length = 1 post_lang = "" min_comments = 20

=======================================================================

Full Error:

│ You are using the newest version (3.2) of the bot │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ###############################

Checking TOML configuration

############################### If you see any prompts, that means that you have unset/incorrectly set variables, please input the correct values. ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ on the 1st iteration of 10 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Logging into Reddit. ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Getting subreddit threads... │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Using subreddit: r/AskReddit+AITAH from TOML config NSFW Post Detected. Skipping... You are trying to use story mode on post with no post text You are trying to use story mode on post with no post text You are trying to use story mode on post with no post text NSFW Post Detected. Skipping... You are trying to use story mode on post with no post text Video will be: AITA if I refuse to make amends with someone who has been so hurtful but wants
help now that he's disabled? 👍 Thread url is: https://reddit.com/r/AITAH/comments/13ygg0y/aita_if_i_refuse_to_make_amends_with_someone_who/
👍 Thread has 141 upvotes Thread has a upvote ratio of 96.0% Thread has 42 comments Received subreddit threads Successfully. Thread ID is 13ygg0y ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Saving Text to MP3 files... │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1 it/s ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Sorry, something went wrong with this version! Try again, and feel free to report this │ │ issue at GitHub or the Discord community. │ │ Version: 3.2 │ │ Error: Code: 2, reason: the text is too long, message: Text too long to create speech audio │ │ Config: {'allow_nsfw': False, 'theme': 'transparent', 'times_to_run': 10, 'opacity': 1.0, │ │ 'storymode': True, 'storymodemethod': 1, 'storymode_max_length': 5000, 'resolution_w': │ │ 1080, 'resolution_h': 1920, 'zoom': 1.0, 'background': {'background_video': 'minecraft', │ │ 'background_audio': 'lofi', 'background_audio_volume': 0.0, 'enable_extra_audio': False, │ │ 'background_thumbnail': False, 'background_thumbnail_font_family': 'arial', │ │ 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, │ │ 'tts': {'voice_choice': 'tiktok', 'random_voice': False, 'elevenlabs_voice_name': 'Bella', │ │ 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': '', 'streamlabs_polly_voice': '', │ │ 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', │ │ 'py_voice_num': '2', 'no_emojis': False, 'silence_duration': 0.5}} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Traceback (most recent call last): File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\main.py", line 132, in n.py", line 51, in main length, number_of_comments = save_text_to_mp3(reddit_object) File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\video_creation\voices.py", line 53, in save_text_to_mp3 return text_to_mp3.run() File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\engine_wrapper.py", line 91, in run self.call_tts(f"postaudio-{idx}", process_text(text)) File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\engine_wrapper.py", line 154, in call_tts self.tts_module.run( File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\TikTok.py", line 111, in run raise TikTokTTSException(status_code, data["message"]) TTS.TikTok.TikTokTTSException: Code: 2, reason: the text is too long, message: Text too long to create speech audio

=======================================================================

STEPS I'VE TRIED TO FIX IT:

Reproduction Steps

Create less than 20 videos and see if the same happens for you, I am still not entirely sure why this has happened

Expected behavior

I expect it to create 10 videos while I leave and do something else, but I get greeted with this error each time now, used to be a rare coincidence.

Screenshots

No response

System Information

Operating System : [e.g. Windows 11] Python version : [e.g. Python 3.10] App version / Branch : [V.3.2 (Latest)]

Checklist

Additional Context

No response

Teric7 commented 1 year ago

Update, I found somewhat of a reputable solution. I have stopped using the tiktok TTS and am now using streamlabspolly, when I get rate limited it automatically waits 58 seconds rather than just crash or stop doing anything period.

Abrar047 commented 1 year ago

Describe the bug

======================================================================= The bug is as the title states, I get an error now after generating less than 20 videos in the last 6 hours stating "TTS.TikTok.TikTokTTSException: Code: 2, reason: the text is too long, message: Text too long to create speech audio"

======================================================================= Here is my config.toml:

[ai] ai_similarity_enabled = false ai_similarity_keywords = ""

[settings] allow_nsfw = false theme = "transparent" times_to_run = 10 opacity = 1.0 storymode = true storymodemethod = 1 storymode_max_length = 5000 resolution_w = 1080 resolution_h = 1920 zoom = 1.0

[settings.background] background_video = "minecraft" background_audio = "lofi" background_audio_volume = 0.0 enable_extra_audio = false background_thumbnail = false background_thumbnail_font_family = "arial" background_thumbnail_font_size = 96 background_thumbnail_font_color = "255,255,255"

[settings.tts] voice_choice = "tiktok" random_voice = false elevenlabs_voice_name = "Bella" elevenlabs_api_key = "" aws_polly_voice = "" streamlabs_polly_voice = "" tiktok_voice = "en_us_001" tiktok_sessionid = "75a78fc90336144d738ffa12b69eb8a8" python_voice = "1" py_voice_num = "2" no_emojis = false silence_duration = 0.5

[reddit.creds] client_id = "si5emRnaTuqDU1Gue8KNxA" client_secret = "_V4EFLdLt1nErjhre2a6AJ-6BTa5HA" username = "LowSmp" password = "Madgamer20987" 2fa = false

[reddit.thread] random = true subreddit = "AskReddit+AITAH" post_id = "" max_comment_length = 500 min_comment_length = 1 post_lang = "" min_comments = 20

=======================================================================

Full Error:

│ You are using the newest version (3.2) of the bot │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ###############################

Checking TOML configuration

############################### If you see any prompts, that means that you have unset/incorrectly set variables, please input the correct values. ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ on the 1st iteration of 10 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Logging into Reddit. ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Getting subreddit threads... │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Using subreddit: r/AskReddit+AITAH from TOML config NSFW Post Detected. Skipping... You are trying to use story mode on post with no post text You are trying to use story mode on post with no post text You are trying to use story mode on post with no post text NSFW Post Detected. Skipping... You are trying to use story mode on post with no post text Video will be: AITA if I refuse to make amends with someone who has been so hurtful but wants help now that he's disabled? 👍 Thread url is: https://reddit.com/r/AITAH/comments/13ygg0y/aita_if_i_refuse_to_make_amends_with_someone_who/ 👍 Thread has 141 upvotes Thread has a upvote ratio of 96.0% Thread has 42 comments Received subreddit threads Successfully. Thread ID is 13ygg0y ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Saving Text to MP3 files... │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1 it/s ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ Sorry, something went wrong with this version! Try again, and feel free to report this │ │ issue at GitHub or the Discord community. │ │ Version: 3.2 │ │ Error: Code: 2, reason: the text is too long, message: Text too long to create speech audio │ │ Config: {'allow_nsfw': False, 'theme': 'transparent', 'times_to_run': 10, 'opacity': 1.0, │ │ 'storymode': True, 'storymodemethod': 1, 'storymode_max_length': 5000, 'resolution_w': │ │ 1080, 'resolution_h': 1920, 'zoom': 1.0, 'background': {'background_video': 'minecraft', │ │ 'background_audio': 'lofi', 'background_audio_volume': 0.0, 'enable_extra_audio': False, │ │ 'background_thumbnail': False, 'background_thumbnail_font_family': 'arial', │ │ 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, │ │ 'tts': {'voice_choice': 'tiktok', 'random_voice': False, 'elevenlabs_voice_name': 'Bella', │ │ 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': '', 'streamlabs_polly_voice': '', │ │ 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', │ │ 'py_voice_num': '2', 'no_emojis': False, 'silence_duration': 0.5}} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ Traceback (most recent call last): File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\main.py", line 132, in n.py", line 51, in main length, number_of_comments = save_text_to_mp3(reddit_object) File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\video_creation\voices.py", line 53, in save_text_to_mp3 return text_to_mp3.run() File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\engine_wrapper.py", line 91, in run self.call_tts(f"postaudio-{idx}", process_text(text)) File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\engine_wrapper.py", line 154, in call_tts self.tts_module.run( File "c:\Users\lowsm\Desktop\Reddit Vides\RedditVideoMakerBot-3.2\RedditVideoMakerBot-3.2\TTS\TikTok.py", line 111, in run raise TikTokTTSException(status_code, data["message"]) TTS.TikTok.TikTokTTSException: Code: 2, reason: the text is too long, message: Text too long to create speech audio

=======================================================================

STEPS I'VE TRIED TO FIX IT:

  • I have tried changing my tiktok session ID
  • Changing the storymode_max_length to 1000
  • Changing Times to Run to 1

Reproduction Steps

Create less than 20 videos and see if the same happens for you, I am still not entirely sure why this has happened

Expected behavior

I expect it to create 10 videos while I leave and do something else, but I get greeted with this error each time now, used to be a rare coincidence.

Screenshots

No response

System Information

Operating System : [e.g. Windows 11] Python version : [e.g. Python 3.10] App version / Branch : [V.3.2 (Latest)]

Checklist

  • [x] I have searched the open issues for duplicates.
  • [x] I have shown the entire traceback, if possible.

Additional Context

No response

Hey you should remove you reddit username & password from the config file data you shared

Teric7 commented 1 year ago

What reddit username and password

yurimedeiros commented 1 year ago

Qual nome de usuário e senha do reddit

[reddit.creds] client_id = "si5emRnaTuqDU1Gue8KNxA" client_secret = "_V4EFLdLt1nErjhre2a6AJ-6BTa5HA" nome de usuário = "LowSmp" senha = "Madgamer20987" 2fa = false