gtranslate icon indicating copy to clipboard operation
gtranslate copied to clipboard

Google token variable changing

Open mote0230 opened this issue 9 years ago • 1 comments

The mystery variable from https://github.com/bpierre/gtranslate/blob/master/providers/google-translate.js#L79 is taken from the html of the translate homepage, and seems to change every day. You can find it if you go to translate.google.com, view source, and search for TKK Last 3 days the values are (at least for me, maybe they change regionally too): 402885, 402922, 402947

I suspect that the token will stop validating once we go to far away from the date our value was took from. Proposed solutions:

  1. get the html, extract the value, and store it, do this every day / every request
  2. set it 0, like the official chrome extension, and maybe further try imitate its requests.

mote0230 avatar Dec 20 '15 11:12 mote0230

2 sounds like the cleanest solution to me, and I guess the Chrome extension doesn’t have to clean the responses the way we do it now.

bpierre avatar Jan 07 '16 20:01 bpierre