Handles the authorization flow to obtain tokens from Plex.tv via external redirection.
Project description
python-plexauth
Handles the authorization flow to obtain tokens from Plex.tv via external redirection.
Example usage:
import asyncio
from plexauth import PlexAuth
PAYLOAD = {
'X-Plex-Product': 'Test Product',
'X-Plex-Version': '0.0.1',
'X-Plex-Device': 'Test Device',
'X-Plex-Platform': 'Test Platform',
'X-Plex-Device-Name': 'Test Device Name',
'X-Plex-Device-Vendor': 'Test Vendor',
'X-Plex-Model': 'Test Model',
'X-Plex-Client-Platform': 'Test Client Platform'
}
async def main():
async with PlexAuth(PAYLOAD) as plexauth:
await plexauth.initiate_auth()
print("Complete auth at URL: {}".format(plexauth.auth_url()))
token = await plexauth.token()
if token:
print("Token: {}".format(token))
else:
print("No token returned.")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plexauth-0.0.6.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file plexauth-0.0.6.tar.gz
.
File metadata
- Download URL: plexauth-0.0.6.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d53580d9d147c0d741f3d4de8d6b181ac7f77b3106d12f2684ae8529bc553c35 |
|
MD5 | d7e66c3a12fa3f6058799fb215e4523d |
|
BLAKE2b-256 | df876d97e15a8c0124b4e3c46b07d902e6d1f732148aafb0ff3871bfef61ad6a |
File details
Details for the file plexauth-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: plexauth-0.0.6-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c07022c681f5e3b684be82494839493e9c4a2b3b3f33133bdae1b4d066b3d4e3 |
|
MD5 | c36cb42edf9b939c03c2a7539a01a713 |
|
BLAKE2b-256 | 065d652dbaaaa7f8d24b84de4a55d6ce19dc3121518d025b06b621802ae28aec |