From f21727f5a5a7120f5e14407c209c0631403fa466 Mon Sep 17 00:00:00 2001 From: Brian Antunes Date: Tue, 11 Apr 2023 09:02:10 -0400 Subject: [PATCH 1/2] Updated TikTok.py The max character is actually 200, not 300 per the [documentation](https://github.com/oscie57/tiktok-voice/wiki/Request-Parameters) `there is a server limit of 200 characters.` This might be causing the 'error XXX.mp3 file not found' as the app splits based on max_char, and since this is 100 char over the limit the mp3 file never gets created. --- TTS/TikTok.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/TikTok.py b/TTS/TikTok.py index 2bcbd6d..fcb6ce8 100644 --- a/TTS/TikTok.py +++ b/TTS/TikTok.py @@ -88,7 +88,7 @@ class TikTok: } self.URI_BASE = "https://api16-normal-c-useast1a.tiktokv.com/media/api/text/speech/invoke/" - self.max_chars = 300 + self.max_chars = 200 self._session = requests.Session() # set the headers to the session, so we don't have to do it for every request From d8a8001b4121d067937292149a9cb8b20ae73dc2 Mon Sep 17 00:00:00 2001 From: Brian Antunes Date: Tue, 11 Apr 2023 09:18:37 -0400 Subject: [PATCH 2/2] Changed url to resolve conflict --- TTS/TikTok.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TTS/TikTok.py b/TTS/TikTok.py index fcb6ce8..e7d2d08 100644 --- a/TTS/TikTok.py +++ b/TTS/TikTok.py @@ -87,7 +87,9 @@ class TikTok: "Cookie": f"sessionid={settings.config['settings']['tts']['tiktok_sessionid']}", } - self.URI_BASE = "https://api16-normal-c-useast1a.tiktokv.com/media/api/text/speech/invoke/" + self.URI_BASE = ( + "https://api16-normal-c-useast1a.tiktokv.com/media/api/text/speech/invoke/" + ) self.max_chars = 200 self._session = requests.Session()