Tool to extract Google device local authentication tokens in Python
Project description
Google home local authentication token extraction
Python 3 package to extract google home devices local authentication tokens from google servers. These local authentication tokens are needed to control Google Home devices(See @rithvikvibhu's Google Home (2.0) API).
Please note: Once you have local google authentication tokens they only live about 1 day long. After that you will need to obtain new ones. You will probably need to run the script repeatedly storing the tokens somewhere convenient.
Quickstart
Note: the package was written and tested on Python 3.
- Install the python package
pip install glocaltokens
Use in your program as (see examples folder for detailed example):
from glocaltokens.client import GLocalAuthenticationTokens
# Using google username and password
client = GLocalAuthenticationTokens(
username='<YOUR_GOOGLE_USERNAME>',
password='<YOUR_GOOGLE_PASSWORD>'
)
# Get master token
print('[*] Master token', client.get_master_token())
# Get access token (lives 1 hour)
print('\n[*] Access token (lives 1 hour)', client.get_access_token())
# Get google device local authentication tokens (live about 1 day)
print('\n[*] Google devices local authentication tokens')
google_devices = client.get_google_devices_json()
Credits
Much credits go to @rithvikvibhu(https://github.com/rithvikvibhu) for doing most of the heavy work like finding a way to extract master and access tokens (See his gist here).
v0.1.1
* Fixing the GetHomeGraphResponse.Home.Device.State.value serialization issue
v0.1
* Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for glocaltokens-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41734d868150fcc2fae37c12ce722e73dea317b47dbab984716f70d9e5b72c69 |
|
MD5 | ea1e3917e9bd7a4e69b4497b5b7f86ee |
|
BLAKE2b-256 | 9d6fc6062d5de7f52e45194aee3ae2037c588aa3cdefe0b323a38f36bc5eaabf |