gtranslate
gtranslate copied to clipboard
Google token variable changing
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:
- get the html, extract the value, and store it, do this every day / every request
- set it 0, like the official chrome extension, and maybe further try imitate its requests.
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.