Skip to content

Commit 77b24f6

Browse files
committed
fix bing and sogou
1 parent 83ac7ed commit 77b24f6

File tree

4 files changed

+207
-193
lines changed

4 files changed

+207
-193
lines changed

bing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type bingTranslator struct{}
1515
var bing translator = new(bingTranslator)
1616

1717
func (b *bingTranslator) desc() (string, string) {
18-
return "bing", "https://www.bing.com/translator/"
18+
return "bing", "https://cn.bing.com/translator"
1919
}
2020

2121
func BingTranslate(ctx context.Context, req Request) *Response {
@@ -31,7 +31,7 @@ func (b *bingTranslator) translate(ctx context.Context, req Request) (resp *Resp
3131
"text": {req.Text},
3232
}
3333

34-
urlStr := "https://www.bing.com/ttranslatev3"
34+
urlStr := "https://cn.bing.com/ttranslatev3"
3535
body := strings.NewReader(param.Encode())
3636
_, data, err := sendRequest(ctx, "POST", urlStr, body, func(req *http.Request) error {
3737
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ require (
1414
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54 // indirect
1515
gopkg.in/sourcemap.v1 v1.0.5 // indirect
1616
)
17+
18+
go 1.13

0 commit comments

Comments
 (0)