elebumm / RedditVideoMakerBot

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

[Bug]: TTS.TikTok.TikTokTTSException: Code: 1, reason: probably the aid value isn't correct, message: Couldn't load speech. Try again. #1682

Closed SajawalHassan closed 1 year ago

SajawalHassan commented 1 year ago

Describe the bug

I am on Arch Linux and have gone through the installation process but when I try to run python3.10 main.py it gives the following error after finding the reddit thread and during converting to mp3.

Using region Punjab server backend.

██████╗ ███████╗██████╗ ██████╗ ██╗████████╗    ██╗   ██╗██╗██████╗ ███████╗ ██████╗     ███╗   ███╗ █████╗ ██╗  ██╗███████╗██████╗
██╔══██╗██╔════╝██╔══██╗██╔══██╗██║╚══██╔══╝    ██║   ██║██║██╔══██╗██╔════╝██╔═══██╗    ████╗ ████║██╔══██╗██║ ██╔╝██╔════╝██╔══██╗
██████╔╝█████╗  ██║  ██║██║  ██║██║   ██║       ██║   ██║██║██║  ██║█████╗  ██║   ██║    ██╔████╔██║███████║█████╔╝ █████╗  ██████╔╝
██╔══██╗██╔══╝  ██║  ██║██║  ██║██║   ██║       ╚██╗ ██╔╝██║██║  ██║██╔══╝  ██║   ██║    ██║╚██╔╝██║██╔══██║██╔═██╗ ██╔══╝  ██╔══██╗
██║  ██║███████╗██████╔╝██████╔╝██║   ██║        ╚████╔╝ ██║██████╔╝███████╗╚██████╔╝    ██║ ╚═╝ ██║██║  ██║██║  ██╗███████╗██║  ██║
╚═╝  ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═╝   ╚═╝         ╚═══╝  ╚═╝╚═════╝ ╚══════╝ ╚═════╝     ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝

       Thanks for using this tool! Feel free to contribute to this project on GitHub! If you have any questions, feel free to join my Discord server or submit a GitHub issue. You can find solutions to many common problems in the        
                                                                                         documentation: https://reddit-video-maker-bot.netlify.app/                                                                                         

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 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 1                                                                                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Logging into Reddit.
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Getting subreddit threads...                                                                                                                                                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Using subreddit: r/AskReddit from TOML config
Video will be: What is something that is way more dangerous than people think it is? 👍Thread url is: https://reddit.com/r/AskReddit/comments/13znaaz/what_is_something_that_is_way_more_dangerous_than/ 👍Thread has 5127 upvotes
Thread has a upvote ratio of 95.0%
Thread has 4402 comments
Received subreddit threads Successfully.
Thread ID is 13znaaz
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Saving Text to MP3 files...                                                                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 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: 1, reason: probably the aid value isn't correct, message: Couldn't load speech. Try again.                                                                                                                                  │
│ Config: {'allow_nsfw': False, 'theme': 'dark', 'times_to_run': 1, 'opacity': 0.9, 'storymode': False, 'storymodemethod': 1, 'storymode_max_length': 1000, 'resolution_w': 1080, 'resolution_h': 1920, 'zoom': 1.0, 'background':         │
│ {'background_video': 'minecraft', 'background_audio': 'lofi', 'background_audio_volume': 0.15, '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', 'elevenlabs_voice_name': 'Bella', 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': 'Matthew',             │
│ 'streamlabs_polly_voice': 'Matthew', 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0.3, 'no_emojis': False, 'random_voice': True}}                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Traceback (most recent call last):
  File "/home/sajawal/Documents/RedditVideoMakerBot/main.py", line 132, in <module>
    raise err
  File "/home/sajawal/Documents/RedditVideoMakerBot/main.py", line 114, in <module>
    run_many(config["settings"]["times_to_run"])
  File "/home/sajawal/Documents/RedditVideoMakerBot/main.py", line 69, in run_many
    main()
  File "/home/sajawal/Documents/RedditVideoMakerBot/main.py", line 51, in main
    length, number_of_comments = save_text_to_mp3(reddit_object)
  File "/home/sajawal/Documents/RedditVideoMakerBot/video_creation/voices.py", line 53, in save_text_to_mp3
    return text_to_mp3.run()
  File "/home/sajawal/Documents/RedditVideoMakerBot/TTS/engine_wrapper.py", line 77, in run
    self.call_tts("title", process_text(self.reddit_object["thread_title"]))
  File "/home/sajawal/Documents/RedditVideoMakerBot/TTS/engine_wrapper.py", line 154, in call_tts
    self.tts_module.run(
  File "/home/sajawal/Documents/RedditVideoMakerBot/TTS/TikTok.py", line 111, in run
    raise TikTokTTSException(status_code, data["message"])
TTS.TikTok.TikTokTTSException: Code: 1, reason: probably the aid value isn't correct, message: Couldn't load speech. Try again.

Things to note

My config.toml file

[ai]
ai_similarity_enabled = false
ai_similarity_keywords = ""

[settings]
allow_nsfw = false
theme = "dark"
times_to_run = 1
opacity = 0.9
storymode = false
storymodemethod = 1
storymode_max_length = 1000
resolution_w = 1080
resolution_h = 1920
zoom = 1.0

[settings.background]
background_video = "minecraft"
background_audio = "lofi"
background_audio_volume = 0.15
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"
elevenlabs_voice_name = "Bella"
elevenlabs_api_key = ""
aws_polly_voice = "Matthew"
streamlabs_polly_voice = "Matthew"
tiktok_voice = "en_us_001"
tiktok_sessionid = "aba538b46ced87ae8e3da1530e92ef7a"
python_voice = "1"
py_voice_num = "2"
silence_duration = 0.3
no_emojis = false
random_voice = true

[reddit.creds]
client_id = "ID"
client_secret = "SECRET
username = "Professional_Leg4739"
password = "PASSWORD"
2fa = false

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

System

If there is any more information needed I would be happy to share it.

Reproduction Steps

First be on Arch Linux then manually install PlayWright through AUR and run the main.py file with python 3.10 with the configurations mentioned above.

Expected behavior

Create the video without any tts error

Screenshots

No response

System Information

Operating System : Arch Linux no distribution Python version : Python 3.10 App version / Branch : Latest

Checklist

Additional Context

No response

SajawalHassan commented 1 year ago

So I fixed it by creating my reddit and tiktok account through email and password, without google auth or 2FA.