def _myPlexClientPorts(self):
try:<EOL><INDENT>ports = {}<EOL>account = self.myPlexAccount()<EOL>for device in account.devices():<EOL><INDENT>if device.connections and '<STR_LIT::>' in device.connections[<NUM_LIT:0>][<NUM_LIT:6>:]:<EOL><INDENT>ports[device.clientIdentifier] = device.connections[<NUM_LIT:0>].split('<STR_LIT::>')[-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return ports<EOL><DEDENT>except Exception as err:<EOL><INDENT>log.warning('<STR_LIT>', err)<EOL>return ports<EOL><DEDENT>
Sometimes the PlexServer does not properly advertise port numbers required
            to connect. This attemps to look up device port number from plex.tv.
            See issue #126: Make PlexServer.clients() more user friendly.
              https://github.com/pkkid/python-plexapi/issues/126