From 35c69f65cbed4dae8bd8acf350f29abe6bcf2dde Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Sat, 25 Feb 2017 00:23:20 -0500 Subject: [PATCH] Be even more verbose --- tools/listtokens.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/listtokens.py b/tools/listtokens.py index d3ff7d48..0b006185 100755 --- a/tools/listtokens.py +++ b/tools/listtokens.py @@ -6,14 +6,19 @@ from plexapi.myplex import MyPlexAccount, MyPlexResource if __name__ == '__main__': + print('List Plex Tokens') + print('----------------') + print('This is a simple utility to fetch and list all known Plex Server') + print('tokens your plex.tv account has access to. Because this information') + print('comes from the plex.tv website, we need to ask for your username') + print('and password. Alternatively, if you do not wish to enter your login') + print('information below, you can retrieve the same information from plex.tv') + print('directly at the URL: %s\n' % MyPlexResource.key) username = input('What is your plex.tv username: ') password = getpass('What is your plex.tv password: ') try: - print('\nLogging into plex.tv..') - account = MyPlexAccount(username, password) - print('Fetching resources from: %s\n' % MyPlexResource.key) - count = 0 - for resource in account.resources(): + count = 0; print() + for resource in MyPlexAccount(username, password).resources(): if resource.accessToken: print('%s %s' % (resource.accessToken, resource.name)) count += 1