Fix 403 error (#288)

* Fix typo in setting of User-Agent

I accidently added a $ probably because I was writing some
shell code at the same time. Oops....

Signed-off-by: rany <rany2@riseup.net>

* Update Chromium User-Agent version to 130

Signed-off-by: rany <rany2@riseup.net>

---------

Fixes: https://github.com/rany2/edge-tts/issues/286
Signed-off-by: rany <rany2@riseup.net>
This commit is contained in:
Rany 2024-10-25 12:24:58 +03:00 committed by GitHub
parent 3a21044e78
commit b55a338fb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,11 +8,11 @@ TRUSTED_CLIENT_TOKEN = "6A5AA1D4EAFF4E9FB37E23D68491D6F4"
WSS_URL = f"wss://{BASE_URL}/edge/v1?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}" VOICE_LIST = f"https://{BASE_URL}/voices/list?trustedclienttoken={TRUSTED_CLIENT_TOKEN}"
CHROMIUM_MAJOR_VERSION = "129" CHROMIUM_MAJOR_VERSION = "130"
BASE_HEADERS = { BASE_HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
f" (KHTML, like Gecko) Chrome/${CHROMIUM_MAJOR_VERSION}.0.0.0 Safari/537.36" f" (KHTML, like Gecko) Chrome/{CHROMIUM_MAJOR_VERSION}.0.0.0 Safari/537.36"
f" Edg/${CHROMIUM_MAJOR_VERSION}.0.0.0", f" Edg/{CHROMIUM_MAJOR_VERSION}.0.0.0",
"Accept-Encoding": "gzip, deflate, br", "Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9", "Accept-Language": "en-US,en;q=0.9",
} }