OwO-Network / DeepLX

Powerful Free DeepL API, No Token Required
https://ssa.sx/deeplx
MIT License
6.68k stars 534 forks source link

Jsonrpc bad gateway error and alternatives #135

Closed showgood163 closed 3 months ago

showgood163 commented 3 months ago

你好。

近期我在使用deeplx时,遇到了如下问题,导致翻译无法进行:

Post "https://www2.deepl.com/jsonrpc": Bad Gateway

经检查,发现原因是我使用ipv6地址向deepl发出请求,而www2.deepl.com没有AAAA解析结果。

q www2.deepl.com @tls://1.0.0.1
www2.deepl.com. 5m CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.
733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com. 2m48s A 172.65.212.243
www2.deepl.com. 2m48s CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.
www2.deepl.com. 4m28s CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.

q www2.deepl.com @tls://8.8.4.4
www2.deepl.com. 5m CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.
www2.deepl.com. 4m59s CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.
733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com. 5m A 172.65.212.243
www2.deepl.com. 4m58s CNAME 733868e706dd40d3a4a0588fc39b3df8.pacloudflare.com.

但是,www.deepl.com,www3.deepl.com都有AAAA解析结果。同时,访问 https://www2.deepl.com/jsonrpchttps://www3.deepl.com/jsonrpc 都返回405。

q aaaa www.deepl.com @tls://1.0.0.1
www.deepl.com. 4m35s AAAA 2606:4700::6812:4ef
www.deepl.com. 4m35s AAAA 2606:4700::6812:5ef

q aaaa www3.deepl.com @tls://1.0.0.1
www3.deepl.com. 5m AAAA 2606:4700::6812:12b3
www3.deepl.com. 5m AAAA 2606:4700::6812:13b3

请问这个问题能通过更换jsonrpc域名方式解决吗?

missuo commented 3 months ago

You can look at the past issues, it seems that someone mentioned that you can manually resolve IPv6 to any Cloudflare CDN address in /etc/hosts. You can try it.

showgood163 commented 3 months ago

你好。

添加hosts提供DNS解析结果的方式是可行的。 请问未来在deeplx中会有更健壮的解决方式吗?

missuo commented 3 months ago

你好。

添加hosts提供DNS解析结果的方式是可行的。

请问未来在deeplx中会有更健壮的解决方式吗?

We should not modify the system DNS resolution, even if we can modify the system hosts through code, but DeepLX is just a tool, we should not and do not have the right to do so.

showgood163 commented 3 months ago

你好。

我上面说的可能有些问题。我的意思是 https://www3.deepl.com/jsonrpc 作为 https://www2.deepl.com/jsonrpc 的fallback。

missuo commented 3 months ago

你好。

我上面说的可能有些问题。我的意思是 https://www3.deepl.com/jsonrpc 作为 https://www2.deepl.com/jsonrpc 的fallback。

I don't know if there is a difference between the two domains. But for now, based on my capture of the DeepL iOS client, I only saw requests for www2, so we shouldn't modify it.

missuo commented 3 months ago

你好。

我上面说的可能有些问题。我的意思是 https://www3.deepl.com/jsonrpc 作为 https://www2.deepl.com/jsonrpc 的fallback。

I don't know if there is a difference between the two domains. But for now, based on my capture of the DeepL iOS client, I only saw requests for www2, so we shouldn't modify it.

Of course, if www3 is as available and stable, I might use it as a fallback.

showgood163 commented 3 months ago

Okay.