From 209269ebf576158bfd2df300b3c22f8e61c8b198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=95=E6=96=AF=E5=8D=A1?= Date: Wed, 9 Oct 2024 10:19:00 +0200 Subject: [PATCH] Use f-strings on constants for better readability (#260) --- src/edge_tts/constants.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/edge_tts/constants.py b/src/edge_tts/constants.py index 54f1fc0..ab62b28 100644 --- a/src/edge_tts/constants.py +++ b/src/edge_tts/constants.py @@ -2,14 +2,8 @@ Constants for the Edge TTS project. """ +BASE_URL = "speech.platform.bing.com/consumer/speech/synthesize/readaloud" TRUSTED_CLIENT_TOKEN = "6A5AA1D4EAFF4E9FB37E23D68491D6F4" -WSS_URL = ( - "wss://speech.platform.bing.com/consumer/speech/synthesize/" - + "readaloud/edge/v1?TrustedClientToken=" - + TRUSTED_CLIENT_TOKEN -) -VOICE_LIST = ( - "https://speech.platform.bing.com/consumer/speech/synthesize/" - + "readaloud/voices/list?trustedclienttoken=" - + TRUSTED_CLIENT_TOKEN -) + +WSS_URL = f"wss://{BASE_URL}/edge/v1?TrustedClientToken={TRUSTED_CLIENT_TOKEN}" +VOICE_LIST = f"https://{BASE_URL}/voices/list?trustedclienttoken={TRUSTED_CLIENT_TOKEN}"