dots


dots / scripts / Scripts / plex
xxwhirlpool  ·  2026-04-12

token_plex.py

 1#!/usr/bin/env -S uv run --script
 2# /// script
 3# requires-python = ">=3.14"
 4# dependencies = [
 5#     "plexapi>=4.18.1",
 6# ]
 7# ///
 8
 9# USAGE: token_plex.py [TOKEN]
10#
11# get the temporary plex token
12
13from plexapi.myplex import MyPlexAccount
14import getpass
15import sys
16
17u = input("plex username: ")
18p = getpass.getpass("plex password: ")
19
20acc = MyPlexAccount(u, p)
21
22print("\n" + acc.authenticationToken)