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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5271d08b8330320e176c03db8cf29fcd14ae6fd10e835cdf68211b95d13fdc3 |
|
MD5 | fc93167d1d63b0a4101a03c72ad47a18 |
|
BLAKE2b-256 | d6c69a1fb3d16c4e81f8d22b0dfa10a52a7673c452df0a966dbfbd7bdd043a14 |