Check-in [7b8ef174e0]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix GogoleAjax to rejoin split up ssentences (from nested list). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7b8ef174e02bc6f6c0fc10d0f55a2e3a |
User & Date: | mario 2021-06-02 16:44:24 |
Context
2021-06-02
| ||
16:44 | New error note check-in: 6cf288401b user: mario tags: trunk | |
16:44 | Fix GogoleAjax to rejoin split up ssentences (from nested list). check-in: 7b8ef174e0 user: mario tags: trunk | |
2021-05-31
| ||
23:22 | document config: options where used check-in: 83b827c27b user: mario tags: trunk | |
Changes
Changes to pythonpath/httprequests.py.
︙ | ︙ | |||
58 59 60 61 62 63 64 | return self http = fake_requests() log.info("using fake_requests() for now") # headers http.headers.update({ | | | 58 59 60 61 62 63 64 65 66 67 68 69 | return self http = fake_requests() log.info("using fake_requests() for now") # headers http.headers.update({ "User-Agent": "Mozilla/5.0 (X11; Linux; LibreOffice/7.2), PageTranslate/1.9", "Accept-Language": "*; q=1.0", "Accept-Encoding": "utf-8" }) |
Changes to pythonpath/translationbackends.py.
︙ | ︙ | |||
133 134 135 136 137 138 139 | "sl": self.params["from"], "tl": self.params["lang"], "dt": "t", "q": text } ) if r.status_code == 200: | > > | | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | "sl": self.params["from"], "tl": self.params["lang"], "dt": "t", "q": text } ) if r.status_code == 200: r = r.json() # request result should be JSON, else client was probably blocked #log.debug("'" + text + "' ==> " + repr(r)) text = "".join([s[0] for s in r[0]]) # result is usually wrapped in three lists [[[u"translated text", u"original", None, None, 3, None, None, [[]] โ one per sentence else: log.debug("AJAX ERROR: " + repr(r)) return text # DeepL online translator # ยท will easily yield HTTP 429 Too many requests, |
︙ | ︙ |