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.2
* Removing dependency `requests==2.23.0` since `gpsoauth` is supporting newest versions
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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ac984c2456ba9dacfad18d2a31c4f01a692edfc358f51c4c0c5a9b04b44bec |
|
MD5 | 386a8958d7202160d3d769a04bb912c1 |
|
BLAKE2b-256 | dc72cc8f966dc2cc5277f9a335f0aa3d0451ce00e7e9725e21d0d9fb5b2368a8 |