Commit 6703ee3
xxwhirlpool
·
2026-04-12 22:32:32 -0400 EDT
parent 8708a29
plex token script
2 files changed,
+33,
-0
+11,
-0
| ... | ... | @@ -39,3 +39,14 @@ cover.py [TOKEN] | |
| 39 | 39 | ```bash | |
| 40 | 40 | m3u.py [TOKEN] | |
| 41 | 41 | ``` | |
| 42 | + | ||
| 43 | + | ## token_plex.py | |
| 44 | + | ||
| 45 | + | - get the plex token | |
| 46 | + | - makes the other scripts easier lol | |
| 47 | + | ||
| 48 | + | ### usage | |
| 49 | + | ||
| 50 | + | ```bash | |
| 51 | + | token.py # follow prompts | |
| 52 | + | ``` |
+22,
-0
| ... | ... | @@ -0,0 +1,22 @@ | |
| 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 | + | ||
| 13 | + | from plexapi.myplex import MyPlexAccount | |
| 14 | + | import getpass | |
| 15 | + | import sys | |
| 16 | + | ||
| 17 | + | u = input("plex username: ") | |
| 18 | + | p = getpass.getpass("plex password: ") | |
| 19 | + | ||
| 20 | + | acc = MyPlexAccount(u, p) | |
| 21 | + | ||
| 22 | + | print("\n" + acc.authenticationToken) |