diff --git a/plexpy/config.py b/plexpy/config.py index 20aee534..4bca4833 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -54,6 +54,7 @@ _CONFIG_DEFINITIONS = { 'PMS_TOKEN': (str, 'PMS', ''), 'PMS_SSL': (int, 'PMS', 0), 'PMS_URL': (str, 'PMS', ''), + 'PMS_URL_OVERRIDE': (str, 'PMS', ''), 'PMS_URL_MANUAL': (int, 'PMS', 0), 'PMS_USE_BIF': (int, 'PMS', 0), 'PMS_UUID': (str, 'PMS', ''), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 49529452..66ccc358 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -276,9 +276,18 @@ class WebInterface(object): @requireAuth(member_of("admin")) def return_plex_xml_url(self, endpoint='', plextv=False, **kwargs): kwargs['X-Plex-Token'] = plexpy.CONFIG.PMS_TOKEN - base_url = 'https://plex.tv' if plextv else plexpy.CONFIG.PMS_URL + + if plextv: + base_url = 'https://plex.tv' + else: + if plexpy.CONFIG.PMS_URL_OVERRIDE: + base_url = plexpy.CONFIG.PMS_URL_OVERRIDE + else: + base_url = plexpy.CONFIG.PMS_URL + if '{machine_id}' in endpoint: endpoint = endpoint.format(machine_id=plexpy.CONFIG.PMS_IDENTIFIER) + return base_url + endpoint + '?' + urllib.urlencode(kwargs) @cherrypy.expose