mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-23 04:03:05 +00:00
591579ab3f
Dont mark shows watched if they are already marked so.
24 lines
972 B
Python
Executable file
24 lines
972 B
Python
Executable file
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Remove current Plex Server and a Client from MyPlex account. Useful when running tests in CI.
|
|
"""
|
|
from plexapi.myplex import MyPlexAccount
|
|
from plexapi.server import PlexServer
|
|
from plexapi import X_PLEX_IDENTIFIER
|
|
|
|
|
|
if __name__ == '__main__':
|
|
myplex = MyPlexAccount()
|
|
plex = PlexServer(token=myplex.authenticationToken)
|
|
for device in plex.myPlexAccount().devices():
|
|
if device.clientIdentifier == plex.machineIdentifier:
|
|
print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier))
|
|
device.delete()
|
|
|
|
# If we suddenly remove the client first we wouldn't be able to authenticate to delete the server
|
|
for device in plex.myPlexAccount().devices():
|
|
if device.clientIdentifier == X_PLEX_IDENTIFIER:
|
|
print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier))
|
|
device.delete()
|
|
break
|