Skip to content

Commit

Permalink
Fix 403 error (#288)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update Chromium User-Agent version to 130

Signed-off-by: rany <[email protected]>

---------

Fixes: #286
Signed-off-by: rany <[email protected]>
  • Loading branch information
rany2 authored Oct 25, 2024
1 parent 3a21044 commit b55a338
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/edge_tts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
WSS_URL = f"wss://{BASE_URL}/edge/v1?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 = {
"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" Edg/${CHROMIUM_MAJOR_VERSION}.0.0.0",
f" (KHTML, like Gecko) Chrome/{CHROMIUM_MAJOR_VERSION}.0.0.0 Safari/537.36"
f" Edg/{CHROMIUM_MAJOR_VERSION}.0.0.0",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
}
Expand Down

2 comments on commit b55a338

@wujiangchao
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

403 error has appeared again

@newzqg
Copy link

@newzqg newzqg commented on b55a338 Nov 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

403 error has appeared again,pls check it

Please sign in to comment.