oscie57 / tiktok-voice

Simple Python script to interact with the TikTok TTS API
515 stars 74 forks source link

Command with File does not work - Text-Command works #38

Open Pillowg1rl opened 1 year ago

Pillowg1rl commented 1 year ago

This Command py main.py -v en_us_001 -p -f "FILENAME.txt" --session 3f***************** does not work and get's back a Status_code 5 error. This one on the other Hand py main.py -v en_us_001 -p -t "This is a test-text" --session 3f****************** does work. The content of the FILENAME.txt is just test

HamzaBenLhouari commented 1 year ago

try this command : py main.py -v en_us_001 -p -f FILENAME.txt --session 3f***** if it doesn't work, you can write a script to generate voice for each paragraph after that you can use moviepy to make them together in a final .mp3 file. can I get the link in line 73 and 119 because mine is not working anymore ( api16-normal-useast5.us.tiktokv.com )

Pillowg1rl commented 1 year ago

Line 73: url = f"https://api16-normal-v6.tiktokv.com/media/api/text/speech/invoke/?text_speaker={text_speaker}&req_text={req_text}&speaker_map_type=0&aid=1233" Line 119: url = f"https://api16-normal-v6.tiktokv.com/media/api/text/speech/invoke/?text_speaker={text_speaker}&req_text={req_text}&speaker_map_type=0&aid=1233"

Yeah. I currently use streamerbot to generate a .bat file that got the text instead of the filename ^^

HamzaBenLhouari commented 1 year ago

Yaa, Me too I use a script to make the voice for each paragraph I use text split with a sleep function to ensure that the code takes a breath ^.^