jjlawren/python-plexauth


Handles the authorization flow to obtain tokens from Plex.tv via external redirection.

License: MIT

Language: Python


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 Statistics

Sourcerank 6
Repository Size 9.77 KB
Stars 4
Forks 0
Watchers 1
Open issues 0
Dependencies 1
Contributors 1
Tags 6
Created
Last updated
Last pushed

Top Contributors See all

jjlawren

Packages Referencing this Repo

plexauth
Handles the authorization flow to obtain tokens from Plex.tv via external redirection.
Latest release 0.0.6 - Updated - 4 stars

Recent Tags See all

v0.0.6 November 11, 2020
v0.0.5 October 17, 2019
v0.0.4 September 28, 2019
v0.0.3 September 28, 2019
v0.0.2 August 28, 2019
v0.0.1 August 27, 2019

Something wrong with this page? Make a suggestion

Last synced: 2020-11-11 04:42:01 UTC

Login to resync this repository