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).
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-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b29fb9dc7b8e5918e7bbb6771271c8ab6f66ab5507e91a1911b4ec6f094b926b |
|
MD5 | 00a4a365340b0c9d751c2e8ae67c7621 |
|
BLAKE2b-256 | 9d5def622eba42dff5e03acf32f04f021349ac8d8981ad2e76987e1470b1b724 |