Git Product home page Git Product logo

mtrans's Issues

源代码内可能泄露个人信息

建议在源码内去除BDUSS
Cookie内有BDUSS 可用于非法登录百度帐号

BaiduTranslator.java, line 57
request.setHeader("Cookie", "BAIDUxxxx");

部分文本计算tk计算错误

我试了一下 类似于这种的文本不能翻译。 价格(%1$s) 谷歌抓包算出的tk为273850.173049 用js代码算出来的tk为54310.450642 楼主有没有什么解决办法

搜狗的Translator失效

搜狗的Translator失效,看目前的应该请求url变化了和增加一个叫s的参数,但是看他的js源码没有闹清楚这个s方法在哪里,在他的app.js里面

var F = s("" + L + O + B + "41ee21a5ab5a13f72687a270816d1bfd"), W = { "from": L, "to": O, "client": "pc", "fr": "browser_pc", "text": B, "pid": "sogou-dict-vr", "useDetect": "on", "useDetectResult": "auto" === L ? "on": "off", "needQc": _.need, "uuid": M, "oxford": "on", "isReturnSugg": "on", "s": F }

Connection pool shut down

java.lang.IllegalStateException: Connection pool shut down
at org.apache.http.util.Asserts.check(Asserts.java:34)
at org.apache.http.pool.AbstractConnPool.lease(AbstractConnPool.java:191)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:267)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:176)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.swjtu.trans.impl.GoogleTranslator.query(GoogleTranslator.java:73)
at com.swjtu.trans.AbstractTranslator.run(AbstractTranslator.java:42)
at com.swjtu.querier.Querier.execute(Querier.java:25)

NoRouteToHostException: No route to host (Host unreachable)

作者您好:
在使用在项目中的 Google 翻译器时,在后续的翻译请求了出现了标题中所示的错误。猜测是因为太频繁导致被封禁了 IP?但是我用使用 Google 翻译是正常的。希望作者能改善或者指导我如何改善该问题。谢谢!

被请求的服务器限制怎么办

rg.apache.http.conn.HttpHostConnectException: Connect to www.google.com:443 [www.google.com/127.0.0.1, www.google.com/2404:6800:4012:0:0:0:0:2004] failed: Connection timed out: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.swjtu.trans.impl.GoogleTranslator.query(GoogleTranslator.java:74)
at com.swjtu.trans.AbstractTranslator.run(AbstractTranslator.java:42)
at com.swjtu.querier.Querier.execute(Querier.java:25)

关于sign和Cookie的计算

你好,我写了一个NodeJS版本的hexo标题自动翻译插件,里面也涉及了调用有关百度翻译,有道翻译,和Google翻译的接口,但是百度翻译接口自升级后,已经无法直接使用了,必须使用appid和appsecret的方式调用。

看到你的项目中对百度翻译接口中的sign和Cookie值是直接指定的,是什么原理呢?另外是否有动态设置的方式?谢谢

Result is null when using BaiduTranslator

The BaiduTranslator worked last month.However when I used it today,its post didn't word ,which caused NullPointerException,while other translators works well.
I had tried other cookie,sign and token,to my disappointed the exception happened again.
I wonder how I can make it work correctly.
Thank you!
java.lang.NullPointerException at com.swjtu.trans.impl.BaiduTranslator.parses(BaiduTranslator.java:73) at com.swjtu.trans.AbstractTranslator.run(AbstractTranslator.java:42) at com.swjtu.querier.Querier.execute(Querier.java:24)

Map selection problem under the GoogleTranslator class setFormData() under jdk 1.8

#title for chinese: jdk 1.8 下 GoogleTranslator 类 setFormData() 的 Map 选择问题

The formData in the setFormData() method is a HashMap, the HashMap does not support key duplication, and the google translation form submission requires a dt field, which has multiple values.

Solution: You can change the HashMap to IdentityHashMap in the AbstractHttpAttribute parent class, and then have the same key, formData.put(new String("key"), "value");

ps:
In order to support internationalization, first use English to play it again. Recently, the google translation API is not used.

setFormData() 方法中 formData 是一个 HashMap, HashMap 不支持 key 重复, 而 google 翻译表单提交时 需要 dt 字段, 该字段有多个值。

解决方案: 可以在 AbstractHttpAttribute 父类中将 HashMap 改为 IdentityHashMap, 然后有相同 key 时, formData.put(new String("key"), "value");

ps:
为了支持国际化, 先用英文打一遍, 用这个频繁调用翻译接口还是会超时,腾讯、google 他们应该有反爬虫机制。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.