LoginSignup
42
21

More than 5 years have passed since last update.

google-home-notifierが「Error: get key failed from google」を吐いたので対策してみた

Posted at

はじめに

  • gmailなどが届いたら、Google homeさんが教えてくれるようにしていた->参考
  • ところが、日本時間 2018/09/21(金) 午前07:30程度から、メールが着信してもGoogle homeさんが反応しなくなっていた
  • 調べてみたところ、google homeさんをしゃべらせる仕掛けであるgoogle-home-notifierが「Error: get key failed from google」なるエラーを出力していた
  • これは、googleからの戻り値が変わっていたためと分かった
  • googleの変更に合わせて、node_modules/google-tts-api/lib/key.jsを修正してやることで解決した

環境

  • Windows 10 pro バージョン1803
  • Windows Subsystem for Linux(WSL) ubuntu VERSION="18.04.1 LTS (Bionic Beaver)"
  • node.js v10.6.0
  • 'google-home-notifier': '1.2.0',

現象

  • 日本時間 2018/09/21(金) 午前07:30程度から、google-home-notifierが「Error: get key failed from google」なるエラーを出力していた

原因

対策

  • 「node_modules/google-tts-api/lib/key.js」の24行目の「eval(html.match(/TKK=eval\(\'\(.*\)\'\);/g)[0]);」を「eval(html.match(/TKK='[0-9]+.[0-9]+'/g)[0]);」に書き換えた。

おわりに

  • 以上は暫定対策
  • Githubを覗くと、この問題への対策のpull requestがあった
  • そちらを取り込んだ方が確実ではあると思う
  • 今回は、自分で調べて対策した情報を折角なので残す形にした
42
21
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
21