def getSubtitleJSON(PMS_address, path, options):
    """
    # double check aTV UDID, redo from client IP if needed/possible
    if not 'PlexConnectUDID' in options:
        UDID = getATVFromIP(options['aTVAddress'])
        if UDID:
            options['PlexConnectUDID'] = UDID
    """
    path = path + '?' if not '?' in path else '&'
    path = path + 'encoding=utf-8'
    
    if not 'PlexConnectUDID' in options:
        # aTV unidentified, UDID not known
        return False
    
    UDID = options['PlexConnectUDID']
    
    # determine PMS_uuid, PMSBaseURL from IP (PMS_mark)
    xargs = {}
    PMS_uuid = PlexAPI.getPMSFromAddress(UDID, PMS_address)
    PMS_baseURL = PlexAPI.getPMSProperty(UDID, PMS_uuid, 'baseURL')
    xargs['X-Plex-Token'] = PlexAPI.getPMSProperty(UDID, PMS_uuid, 'accesstoken')
    
    dprint(__name__, 1, "subtitle URL: {0}{1}", PMS_baseURL, path)
    dprint(__name__, 1, "xargs: {0}", xargs)
    
    request = urllib2.Request(PMS_baseURL+path , None, xargs)
    try:
        response = urllib2.urlopen(request, timeout=20)
    except urllib2.URLError as e:
        dprint(__name__, 0, 'No Response from Plex Media Server')
        if hasattr(e, 'reason'):
            dprint(__name__, 0, "We failed to reach a server. Reason: {0}", e.reason)
        elif hasattr(e, 'code'):
            dprint(__name__, 0, "The server couldn't fulfill the request. Error code: {0}", e.code)
        return False
    except __HOLE__:
        dprint(__name__, 0, 'Error loading response XML from Plex Media Server')
        return False
    
    # Todo: Deal with ANSI files. How to select used "codepage"?
    subtitleFile = response.read()
    
    print response.headers
    
    dprint(__name__, 1, "====== received Subtitle ======")
    dprint(__name__, 1, "{0} [...]", subtitleFile[:255])
    dprint(__name__, 1, "====== Subtitle finished ======")
    
    if options['PlexConnectSubtitleFormat']=='srt':
        subtitle = parseSRT(subtitleFile)
    else:
        return False
    
    JSON = json.dumps(subtitle)
    
    dprint(__name__, 1, "====== generated subtitle aTV subtitle JSON ======")
    dprint(__name__, 1, "{0} [...]", JSON[:255])
    dprint(__name__, 1, "====== aTV subtitle JSON finished ======")
    return(JSON)
dataset/ETHPy150Open iBaa/PlexConnect/Subtitle.py/getSubtitleJSON