Skip to content

Commit

Permalink
fix pro headers
Browse files Browse the repository at this point in the history
  • Loading branch information
czyt committed Oct 14, 2024
1 parent 4ea6fad commit 2cc78e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion deepl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestTranslate(t *testing.T) {

func TestTranslateWithProSession(t *testing.T) {
options := []Option{
WithDeeplProSession("fa.e4xxxxxxxxxxxxxxxxxxx"),
WithDeeplProSession("fa.xxxxx-xxxx-xxxxx-xxxx-xxxxxxx"),
}
translate, err := Translate("", "zh", "I am the apple of my father's eyes", options...)
if err != nil {
Expand Down
22 changes: 9 additions & 13 deletions headerIter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ const (

var (
deeplProHeaders = map[string]string{
"Referer": deepLReferServer,
"Content-Type": "application/json",
"Accept": "*/*",
"x-app-os-name": "iOS",
"x-app-os-version": "16.3.0",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"x-app-device": "iPhone13,2",
"User-Agent": "DeepL-iOS/2.9.1 iOS 16.3.0 (iPhone13,2)",
"x-app-build": "510265",
"x-app-version": "2.9.1",
"Connection": "keep-alive",
"Cookie": "",
"Referer": deepLReferServer,
"Origin": deepLReferServer,
"Content-Type": "application/json",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
"Connection": "keep-alive",
"Cookie": "",
}

deeplXHeaders = map[string]string{
Expand Down

0 comments on commit 2cc78e4

Please sign in to comment.