Be even more verbose

This commit is contained in:
Michael Shepanski 2017-02-25 00:23:20 -05:00
parent 00fe683a31
commit 35c69f65cb

View file

@ -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