Skip to content

Instantly share code, notes, and snippets.

@JonnyWong16
Created June 17, 2021 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonnyWong16/618af80ccc5d4d81433cebc2d5886fd2 to your computer and use it in GitHub Desktop.
Save JonnyWong16/618af80ccc5d4d81433cebc2d5886fd2 to your computer and use it in GitHub Desktop.
Create a new Plex.tv token for your app.
import uuid
from plexapi.utils import getMyPlexAccount, createMyPlexDevice
account = getMyPlexAccount()
product = input("App name: ")
headers = {
'X-Plex-Platform': '',
'X-Plex-Platform-Version': '',
'X-Plex-Provides': '',
'X-Plex-Version': '',
'X-Plex-Device': '',
'X-Plex-Device-Name': '',
'X-Plex-Product': product,
'X-Plex-Client-Identifier': str(uuid.uuid4())
}
device = createMyPlexDevice(headers=headers, account=account)
print(device.token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment