Skip to content

[Bing] Old API broken #218

@soimort

Description

@soimort

Change required: POST /translator/api/... => POST /ttranslate/...&IG=... (IG is found in the start page)

$ trans -D /b test
  16 bytes > HTTP/1.1 200 OK
  23 bytes > Cache-Control: private
  23 bytes > Content-Length: 161378
  39 bytes > Content-Type: text/html; charset=utf-8
  22 bytes > Vary: Accept-Encoding
  62 bytes > P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND"
  93 bytes > Set-Cookie: SRCHD=AF=NOFORM; domain=.bing.com; expires=Tue, 10-Mar-2020 23:50:21 GMT; path=/
 136 bytes > Set-Cookie: SRCHUID=V=2&GUID=551D8DD075324F579F78E89F2C6B62A9&dmnchg=1; domain=.bing.com; expires=Tue, 10-Mar-2020 23:50:21 GMT; path=/
  98 bytes > Set-Cookie: SRCHUSR=DOB=20180310; domain=.bing.com; expires=Tue, 10-Mar-2020 23:50:21 GMT; path=/
  79 bytes > Set-Cookie: _SS=SID=140013FE97106BB63F6C185096076AE0; domain=.bing.com; path=/
 103 bytes > X-MSEdge-Ref: Ref A: 41BD1A92A3874002969112405582EBD8 Ref B: CPH30EDGE0116 Ref C: 2018-03-10T23:50:21Z
  96 bytes > Set-Cookie: _EDGE_S=F=1&SID=140013FE97106BB63F6C185096076AE0; path=/; httponly; domain=bing.com
  96 bytes > Set-Cookie: _EDGE_V=1; path=/; httponly; expires=Thu, 04-Apr-2019 23:50:21 GMT; domain=bing.com
 114 bytes > Set-Cookie: MUID=0AB62183F52A6FFC32F32A2DF43D6EC1; path=/; expires=Thu, 04-Apr-2019 23:50:21 GMT; domain=bing.com
 108 bytes > Set-Cookie: MUIDB=0AB62183F52A6FFC32F32A2DF43D6EC1; path=/; httponly; expires=Thu, 04-Apr-2019 23:50:21 GMT
  36 bytes > Date: Sat, 10 Mar 2018 23:50:20 GMT
  18 bytes > Connection: close
  23 bytes > HTTP/1.1 403 Forbidden
  24 bytes > Cache-Control: no-cache
  17 bytes > Pragma: no-cache
  19 bytes > Content-Length: 58
  46 bytes > Content-Type: application/json; charset=utf-8
  12 bytes > Expires: -1
  77 bytes > Set-Cookie: mtstkn=; expires=Fri, 09 Mar 2018 23:50:21 GMT; path=/translator
  81 bytes > Set-Cookie: mtstkn=; expires=Fri, 09 Mar 2018 23:50:21 GMT; path=/translator/api
  60 bytes > X-MS-Trans-Info: 80225.45b1dd47-2085-4caf-bb83-afcaa8496efb
  28 bytes > X-AspNet-Version: 4.0.30319
  22 bytes > X-Powered-By: ASP.NET
 103 bytes > X-MSEdge-Ref: Ref A: EC6337A092724E369F91AD8509376888 Ref B: CPH30EDGE0114 Ref C: 2018-03-10T23:50:21Z
  36 bytes > Date: Sat, 10 Mar 2018 23:50:21 GMT
  18 bytes > Connection: close
   1 bytes > 
  58 bytes > {"message":"Service unavailable. Please try again later."}
content = '''
{"message":"Service unavailable. Please try again later."}
'''
tokens = ["{", "\"message\"", ":", "\"Service unavailable. Please try again later.\"", "}"]
ast = {
"0,message"	"\"Service unavailable. Please try again later.\""
}
-- display original text
test

-- display major translation


-- display source language -> target language
[  → English ]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions