mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 03:33:08 +00:00
Adds 2FA code input to tools/plex-gettoken.py
(#1319)
* Use getpass for password input * Add 2FA code input
This commit is contained in:
parent
4780026a73
commit
768aa58c90
1 changed files with 4 additions and 2 deletions
|
@ -3,10 +3,12 @@
|
|||
"""
|
||||
Plex-GetToken is a simple method to retrieve a Plex account token.
|
||||
"""
|
||||
from getpass import getpass
|
||||
from plexapi.myplex import MyPlexAccount
|
||||
|
||||
username = input("Plex username: ")
|
||||
password = input("Plex password: ")
|
||||
password = getpass("Plex password: ")
|
||||
code = input("Plex 2FA code (leave blank for none): ")
|
||||
|
||||
account = MyPlexAccount(username, password)
|
||||
account = MyPlexAccount(username, password, code=code)
|
||||
print(account.authenticationToken)
|
||||
|
|
Loading…
Reference in a new issue